1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/compute/v1/compute.proto 18 19 package com.google.cloud.compute.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/). 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.compute.v1.Policy} 29 */ 30 public final class Policy extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.Policy) 33 PolicyOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use Policy.newBuilder() to construct. Policy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private Policy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 Policy()40 private Policy() { 41 auditConfigs_ = java.util.Collections.emptyList(); 42 bindings_ = java.util.Collections.emptyList(); 43 etag_ = ""; 44 rules_ = java.util.Collections.emptyList(); 45 } 46 47 @java.lang.Override 48 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)49 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 50 return new Policy(); 51 } 52 53 @java.lang.Override getUnknownFields()54 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 55 return this.unknownFields; 56 } 57 getDescriptor()58 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 59 return com.google.cloud.compute.v1.Compute 60 .internal_static_google_cloud_compute_v1_Policy_descriptor; 61 } 62 63 @java.lang.Override 64 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()65 internalGetFieldAccessorTable() { 66 return com.google.cloud.compute.v1.Compute 67 .internal_static_google_cloud_compute_v1_Policy_fieldAccessorTable 68 .ensureFieldAccessorsInitialized( 69 com.google.cloud.compute.v1.Policy.class, 70 com.google.cloud.compute.v1.Policy.Builder.class); 71 } 72 73 private int bitField0_; 74 public static final int AUDIT_CONFIGS_FIELD_NUMBER = 328080653; 75 76 @SuppressWarnings("serial") 77 private java.util.List<com.google.cloud.compute.v1.AuditConfig> auditConfigs_; 78 /** 79 * 80 * 81 * <pre> 82 * Specifies cloud audit logging configuration for this policy. 83 * </pre> 84 * 85 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 86 */ 87 @java.lang.Override getAuditConfigsList()88 public java.util.List<com.google.cloud.compute.v1.AuditConfig> getAuditConfigsList() { 89 return auditConfigs_; 90 } 91 /** 92 * 93 * 94 * <pre> 95 * Specifies cloud audit logging configuration for this policy. 96 * </pre> 97 * 98 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 99 */ 100 @java.lang.Override 101 public java.util.List<? extends com.google.cloud.compute.v1.AuditConfigOrBuilder> getAuditConfigsOrBuilderList()102 getAuditConfigsOrBuilderList() { 103 return auditConfigs_; 104 } 105 /** 106 * 107 * 108 * <pre> 109 * Specifies cloud audit logging configuration for this policy. 110 * </pre> 111 * 112 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 113 */ 114 @java.lang.Override getAuditConfigsCount()115 public int getAuditConfigsCount() { 116 return auditConfigs_.size(); 117 } 118 /** 119 * 120 * 121 * <pre> 122 * Specifies cloud audit logging configuration for this policy. 123 * </pre> 124 * 125 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 126 */ 127 @java.lang.Override getAuditConfigs(int index)128 public com.google.cloud.compute.v1.AuditConfig getAuditConfigs(int index) { 129 return auditConfigs_.get(index); 130 } 131 /** 132 * 133 * 134 * <pre> 135 * Specifies cloud audit logging configuration for this policy. 136 * </pre> 137 * 138 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 139 */ 140 @java.lang.Override getAuditConfigsOrBuilder(int index)141 public com.google.cloud.compute.v1.AuditConfigOrBuilder getAuditConfigsOrBuilder(int index) { 142 return auditConfigs_.get(index); 143 } 144 145 public static final int BINDINGS_FIELD_NUMBER = 403251854; 146 147 @SuppressWarnings("serial") 148 private java.util.List<com.google.cloud.compute.v1.Binding> bindings_; 149 /** 150 * 151 * 152 * <pre> 153 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 154 * </pre> 155 * 156 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 157 */ 158 @java.lang.Override getBindingsList()159 public java.util.List<com.google.cloud.compute.v1.Binding> getBindingsList() { 160 return bindings_; 161 } 162 /** 163 * 164 * 165 * <pre> 166 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 167 * </pre> 168 * 169 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 170 */ 171 @java.lang.Override 172 public java.util.List<? extends com.google.cloud.compute.v1.BindingOrBuilder> getBindingsOrBuilderList()173 getBindingsOrBuilderList() { 174 return bindings_; 175 } 176 /** 177 * 178 * 179 * <pre> 180 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 181 * </pre> 182 * 183 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 184 */ 185 @java.lang.Override getBindingsCount()186 public int getBindingsCount() { 187 return bindings_.size(); 188 } 189 /** 190 * 191 * 192 * <pre> 193 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 194 * </pre> 195 * 196 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 197 */ 198 @java.lang.Override getBindings(int index)199 public com.google.cloud.compute.v1.Binding getBindings(int index) { 200 return bindings_.get(index); 201 } 202 /** 203 * 204 * 205 * <pre> 206 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 207 * </pre> 208 * 209 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 210 */ 211 @java.lang.Override getBindingsOrBuilder(int index)212 public com.google.cloud.compute.v1.BindingOrBuilder getBindingsOrBuilder(int index) { 213 return bindings_.get(index); 214 } 215 216 public static final int ETAG_FIELD_NUMBER = 3123477; 217 218 @SuppressWarnings("serial") 219 private volatile java.lang.Object etag_ = ""; 220 /** 221 * 222 * 223 * <pre> 224 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. 225 * </pre> 226 * 227 * <code>optional string etag = 3123477;</code> 228 * 229 * @return Whether the etag field is set. 230 */ 231 @java.lang.Override hasEtag()232 public boolean hasEtag() { 233 return ((bitField0_ & 0x00000001) != 0); 234 } 235 /** 236 * 237 * 238 * <pre> 239 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. 240 * </pre> 241 * 242 * <code>optional string etag = 3123477;</code> 243 * 244 * @return The etag. 245 */ 246 @java.lang.Override getEtag()247 public java.lang.String getEtag() { 248 java.lang.Object ref = etag_; 249 if (ref instanceof java.lang.String) { 250 return (java.lang.String) ref; 251 } else { 252 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 253 java.lang.String s = bs.toStringUtf8(); 254 etag_ = s; 255 return s; 256 } 257 } 258 /** 259 * 260 * 261 * <pre> 262 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. 263 * </pre> 264 * 265 * <code>optional string etag = 3123477;</code> 266 * 267 * @return The bytes for etag. 268 */ 269 @java.lang.Override getEtagBytes()270 public com.google.protobuf.ByteString getEtagBytes() { 271 java.lang.Object ref = etag_; 272 if (ref instanceof java.lang.String) { 273 com.google.protobuf.ByteString b = 274 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 275 etag_ = b; 276 return b; 277 } else { 278 return (com.google.protobuf.ByteString) ref; 279 } 280 } 281 282 public static final int IAM_OWNED_FIELD_NUMBER = 450566203; 283 private boolean iamOwned_ = false; 284 /** 285 * <code>optional bool iam_owned = 450566203;</code> 286 * 287 * @return Whether the iamOwned field is set. 288 */ 289 @java.lang.Override hasIamOwned()290 public boolean hasIamOwned() { 291 return ((bitField0_ & 0x00000002) != 0); 292 } 293 /** 294 * <code>optional bool iam_owned = 450566203;</code> 295 * 296 * @return The iamOwned. 297 */ 298 @java.lang.Override getIamOwned()299 public boolean getIamOwned() { 300 return iamOwned_; 301 } 302 303 public static final int RULES_FIELD_NUMBER = 108873975; 304 305 @SuppressWarnings("serial") 306 private java.util.List<com.google.cloud.compute.v1.Rule> rules_; 307 /** 308 * 309 * 310 * <pre> 311 * This is deprecated and has no effect. Do not use. 312 * </pre> 313 * 314 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 315 */ 316 @java.lang.Override getRulesList()317 public java.util.List<com.google.cloud.compute.v1.Rule> getRulesList() { 318 return rules_; 319 } 320 /** 321 * 322 * 323 * <pre> 324 * This is deprecated and has no effect. Do not use. 325 * </pre> 326 * 327 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 328 */ 329 @java.lang.Override 330 public java.util.List<? extends com.google.cloud.compute.v1.RuleOrBuilder> getRulesOrBuilderList()331 getRulesOrBuilderList() { 332 return rules_; 333 } 334 /** 335 * 336 * 337 * <pre> 338 * This is deprecated and has no effect. Do not use. 339 * </pre> 340 * 341 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 342 */ 343 @java.lang.Override getRulesCount()344 public int getRulesCount() { 345 return rules_.size(); 346 } 347 /** 348 * 349 * 350 * <pre> 351 * This is deprecated and has no effect. Do not use. 352 * </pre> 353 * 354 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 355 */ 356 @java.lang.Override getRules(int index)357 public com.google.cloud.compute.v1.Rule getRules(int index) { 358 return rules_.get(index); 359 } 360 /** 361 * 362 * 363 * <pre> 364 * This is deprecated and has no effect. Do not use. 365 * </pre> 366 * 367 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 368 */ 369 @java.lang.Override getRulesOrBuilder(int index)370 public com.google.cloud.compute.v1.RuleOrBuilder getRulesOrBuilder(int index) { 371 return rules_.get(index); 372 } 373 374 public static final int VERSION_FIELD_NUMBER = 351608024; 375 private int version_ = 0; 376 /** 377 * 378 * 379 * <pre> 380 * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 381 * </pre> 382 * 383 * <code>optional int32 version = 351608024;</code> 384 * 385 * @return Whether the version field is set. 386 */ 387 @java.lang.Override hasVersion()388 public boolean hasVersion() { 389 return ((bitField0_ & 0x00000004) != 0); 390 } 391 /** 392 * 393 * 394 * <pre> 395 * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 396 * </pre> 397 * 398 * <code>optional int32 version = 351608024;</code> 399 * 400 * @return The version. 401 */ 402 @java.lang.Override getVersion()403 public int getVersion() { 404 return version_; 405 } 406 407 private byte memoizedIsInitialized = -1; 408 409 @java.lang.Override isInitialized()410 public final boolean isInitialized() { 411 byte isInitialized = memoizedIsInitialized; 412 if (isInitialized == 1) return true; 413 if (isInitialized == 0) return false; 414 415 memoizedIsInitialized = 1; 416 return true; 417 } 418 419 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)420 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 421 if (((bitField0_ & 0x00000001) != 0)) { 422 com.google.protobuf.GeneratedMessageV3.writeString(output, 3123477, etag_); 423 } 424 for (int i = 0; i < rules_.size(); i++) { 425 output.writeMessage(108873975, rules_.get(i)); 426 } 427 for (int i = 0; i < auditConfigs_.size(); i++) { 428 output.writeMessage(328080653, auditConfigs_.get(i)); 429 } 430 if (((bitField0_ & 0x00000004) != 0)) { 431 output.writeInt32(351608024, version_); 432 } 433 for (int i = 0; i < bindings_.size(); i++) { 434 output.writeMessage(403251854, bindings_.get(i)); 435 } 436 if (((bitField0_ & 0x00000002) != 0)) { 437 output.writeBool(450566203, iamOwned_); 438 } 439 getUnknownFields().writeTo(output); 440 } 441 442 @java.lang.Override getSerializedSize()443 public int getSerializedSize() { 444 int size = memoizedSize; 445 if (size != -1) return size; 446 447 size = 0; 448 if (((bitField0_ & 0x00000001) != 0)) { 449 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3123477, etag_); 450 } 451 for (int i = 0; i < rules_.size(); i++) { 452 size += com.google.protobuf.CodedOutputStream.computeMessageSize(108873975, rules_.get(i)); 453 } 454 for (int i = 0; i < auditConfigs_.size(); i++) { 455 size += 456 com.google.protobuf.CodedOutputStream.computeMessageSize(328080653, auditConfigs_.get(i)); 457 } 458 if (((bitField0_ & 0x00000004) != 0)) { 459 size += com.google.protobuf.CodedOutputStream.computeInt32Size(351608024, version_); 460 } 461 for (int i = 0; i < bindings_.size(); i++) { 462 size += com.google.protobuf.CodedOutputStream.computeMessageSize(403251854, bindings_.get(i)); 463 } 464 if (((bitField0_ & 0x00000002) != 0)) { 465 size += com.google.protobuf.CodedOutputStream.computeBoolSize(450566203, iamOwned_); 466 } 467 size += getUnknownFields().getSerializedSize(); 468 memoizedSize = size; 469 return size; 470 } 471 472 @java.lang.Override equals(final java.lang.Object obj)473 public boolean equals(final java.lang.Object obj) { 474 if (obj == this) { 475 return true; 476 } 477 if (!(obj instanceof com.google.cloud.compute.v1.Policy)) { 478 return super.equals(obj); 479 } 480 com.google.cloud.compute.v1.Policy other = (com.google.cloud.compute.v1.Policy) obj; 481 482 if (!getAuditConfigsList().equals(other.getAuditConfigsList())) return false; 483 if (!getBindingsList().equals(other.getBindingsList())) return false; 484 if (hasEtag() != other.hasEtag()) return false; 485 if (hasEtag()) { 486 if (!getEtag().equals(other.getEtag())) return false; 487 } 488 if (hasIamOwned() != other.hasIamOwned()) return false; 489 if (hasIamOwned()) { 490 if (getIamOwned() != other.getIamOwned()) return false; 491 } 492 if (!getRulesList().equals(other.getRulesList())) return false; 493 if (hasVersion() != other.hasVersion()) return false; 494 if (hasVersion()) { 495 if (getVersion() != other.getVersion()) return false; 496 } 497 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 498 return true; 499 } 500 501 @java.lang.Override hashCode()502 public int hashCode() { 503 if (memoizedHashCode != 0) { 504 return memoizedHashCode; 505 } 506 int hash = 41; 507 hash = (19 * hash) + getDescriptor().hashCode(); 508 if (getAuditConfigsCount() > 0) { 509 hash = (37 * hash) + AUDIT_CONFIGS_FIELD_NUMBER; 510 hash = (53 * hash) + getAuditConfigsList().hashCode(); 511 } 512 if (getBindingsCount() > 0) { 513 hash = (37 * hash) + BINDINGS_FIELD_NUMBER; 514 hash = (53 * hash) + getBindingsList().hashCode(); 515 } 516 if (hasEtag()) { 517 hash = (37 * hash) + ETAG_FIELD_NUMBER; 518 hash = (53 * hash) + getEtag().hashCode(); 519 } 520 if (hasIamOwned()) { 521 hash = (37 * hash) + IAM_OWNED_FIELD_NUMBER; 522 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIamOwned()); 523 } 524 if (getRulesCount() > 0) { 525 hash = (37 * hash) + RULES_FIELD_NUMBER; 526 hash = (53 * hash) + getRulesList().hashCode(); 527 } 528 if (hasVersion()) { 529 hash = (37 * hash) + VERSION_FIELD_NUMBER; 530 hash = (53 * hash) + getVersion(); 531 } 532 hash = (29 * hash) + getUnknownFields().hashCode(); 533 memoizedHashCode = hash; 534 return hash; 535 } 536 parseFrom(java.nio.ByteBuffer data)537 public static com.google.cloud.compute.v1.Policy parseFrom(java.nio.ByteBuffer data) 538 throws com.google.protobuf.InvalidProtocolBufferException { 539 return PARSER.parseFrom(data); 540 } 541 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)542 public static com.google.cloud.compute.v1.Policy parseFrom( 543 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 544 throws com.google.protobuf.InvalidProtocolBufferException { 545 return PARSER.parseFrom(data, extensionRegistry); 546 } 547 parseFrom(com.google.protobuf.ByteString data)548 public static com.google.cloud.compute.v1.Policy parseFrom(com.google.protobuf.ByteString data) 549 throws com.google.protobuf.InvalidProtocolBufferException { 550 return PARSER.parseFrom(data); 551 } 552 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)553 public static com.google.cloud.compute.v1.Policy parseFrom( 554 com.google.protobuf.ByteString data, 555 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 556 throws com.google.protobuf.InvalidProtocolBufferException { 557 return PARSER.parseFrom(data, extensionRegistry); 558 } 559 parseFrom(byte[] data)560 public static com.google.cloud.compute.v1.Policy parseFrom(byte[] data) 561 throws com.google.protobuf.InvalidProtocolBufferException { 562 return PARSER.parseFrom(data); 563 } 564 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)565 public static com.google.cloud.compute.v1.Policy parseFrom( 566 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 567 throws com.google.protobuf.InvalidProtocolBufferException { 568 return PARSER.parseFrom(data, extensionRegistry); 569 } 570 parseFrom(java.io.InputStream input)571 public static com.google.cloud.compute.v1.Policy parseFrom(java.io.InputStream input) 572 throws java.io.IOException { 573 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 574 } 575 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)576 public static com.google.cloud.compute.v1.Policy parseFrom( 577 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 578 throws java.io.IOException { 579 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 580 PARSER, input, extensionRegistry); 581 } 582 parseDelimitedFrom(java.io.InputStream input)583 public static com.google.cloud.compute.v1.Policy parseDelimitedFrom(java.io.InputStream input) 584 throws java.io.IOException { 585 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 586 } 587 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)588 public static com.google.cloud.compute.v1.Policy parseDelimitedFrom( 589 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 590 throws java.io.IOException { 591 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 592 PARSER, input, extensionRegistry); 593 } 594 parseFrom( com.google.protobuf.CodedInputStream input)595 public static com.google.cloud.compute.v1.Policy parseFrom( 596 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 597 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 598 } 599 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)600 public static com.google.cloud.compute.v1.Policy parseFrom( 601 com.google.protobuf.CodedInputStream input, 602 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 603 throws java.io.IOException { 604 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 605 PARSER, input, extensionRegistry); 606 } 607 608 @java.lang.Override newBuilderForType()609 public Builder newBuilderForType() { 610 return newBuilder(); 611 } 612 newBuilder()613 public static Builder newBuilder() { 614 return DEFAULT_INSTANCE.toBuilder(); 615 } 616 newBuilder(com.google.cloud.compute.v1.Policy prototype)617 public static Builder newBuilder(com.google.cloud.compute.v1.Policy prototype) { 618 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 619 } 620 621 @java.lang.Override toBuilder()622 public Builder toBuilder() { 623 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 624 } 625 626 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)627 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 628 Builder builder = new Builder(parent); 629 return builder; 630 } 631 /** 632 * 633 * 634 * <pre> 635 * An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/). 636 * </pre> 637 * 638 * Protobuf type {@code google.cloud.compute.v1.Policy} 639 */ 640 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 641 implements 642 // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.Policy) 643 com.google.cloud.compute.v1.PolicyOrBuilder { getDescriptor()644 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 645 return com.google.cloud.compute.v1.Compute 646 .internal_static_google_cloud_compute_v1_Policy_descriptor; 647 } 648 649 @java.lang.Override 650 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()651 internalGetFieldAccessorTable() { 652 return com.google.cloud.compute.v1.Compute 653 .internal_static_google_cloud_compute_v1_Policy_fieldAccessorTable 654 .ensureFieldAccessorsInitialized( 655 com.google.cloud.compute.v1.Policy.class, 656 com.google.cloud.compute.v1.Policy.Builder.class); 657 } 658 659 // Construct using com.google.cloud.compute.v1.Policy.newBuilder() Builder()660 private Builder() {} 661 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)662 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 663 super(parent); 664 } 665 666 @java.lang.Override clear()667 public Builder clear() { 668 super.clear(); 669 bitField0_ = 0; 670 if (auditConfigsBuilder_ == null) { 671 auditConfigs_ = java.util.Collections.emptyList(); 672 } else { 673 auditConfigs_ = null; 674 auditConfigsBuilder_.clear(); 675 } 676 bitField0_ = (bitField0_ & ~0x00000001); 677 if (bindingsBuilder_ == null) { 678 bindings_ = java.util.Collections.emptyList(); 679 } else { 680 bindings_ = null; 681 bindingsBuilder_.clear(); 682 } 683 bitField0_ = (bitField0_ & ~0x00000002); 684 etag_ = ""; 685 iamOwned_ = false; 686 if (rulesBuilder_ == null) { 687 rules_ = java.util.Collections.emptyList(); 688 } else { 689 rules_ = null; 690 rulesBuilder_.clear(); 691 } 692 bitField0_ = (bitField0_ & ~0x00000010); 693 version_ = 0; 694 return this; 695 } 696 697 @java.lang.Override getDescriptorForType()698 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 699 return com.google.cloud.compute.v1.Compute 700 .internal_static_google_cloud_compute_v1_Policy_descriptor; 701 } 702 703 @java.lang.Override getDefaultInstanceForType()704 public com.google.cloud.compute.v1.Policy getDefaultInstanceForType() { 705 return com.google.cloud.compute.v1.Policy.getDefaultInstance(); 706 } 707 708 @java.lang.Override build()709 public com.google.cloud.compute.v1.Policy build() { 710 com.google.cloud.compute.v1.Policy result = buildPartial(); 711 if (!result.isInitialized()) { 712 throw newUninitializedMessageException(result); 713 } 714 return result; 715 } 716 717 @java.lang.Override buildPartial()718 public com.google.cloud.compute.v1.Policy buildPartial() { 719 com.google.cloud.compute.v1.Policy result = new com.google.cloud.compute.v1.Policy(this); 720 buildPartialRepeatedFields(result); 721 if (bitField0_ != 0) { 722 buildPartial0(result); 723 } 724 onBuilt(); 725 return result; 726 } 727 buildPartialRepeatedFields(com.google.cloud.compute.v1.Policy result)728 private void buildPartialRepeatedFields(com.google.cloud.compute.v1.Policy result) { 729 if (auditConfigsBuilder_ == null) { 730 if (((bitField0_ & 0x00000001) != 0)) { 731 auditConfigs_ = java.util.Collections.unmodifiableList(auditConfigs_); 732 bitField0_ = (bitField0_ & ~0x00000001); 733 } 734 result.auditConfigs_ = auditConfigs_; 735 } else { 736 result.auditConfigs_ = auditConfigsBuilder_.build(); 737 } 738 if (bindingsBuilder_ == null) { 739 if (((bitField0_ & 0x00000002) != 0)) { 740 bindings_ = java.util.Collections.unmodifiableList(bindings_); 741 bitField0_ = (bitField0_ & ~0x00000002); 742 } 743 result.bindings_ = bindings_; 744 } else { 745 result.bindings_ = bindingsBuilder_.build(); 746 } 747 if (rulesBuilder_ == null) { 748 if (((bitField0_ & 0x00000010) != 0)) { 749 rules_ = java.util.Collections.unmodifiableList(rules_); 750 bitField0_ = (bitField0_ & ~0x00000010); 751 } 752 result.rules_ = rules_; 753 } else { 754 result.rules_ = rulesBuilder_.build(); 755 } 756 } 757 buildPartial0(com.google.cloud.compute.v1.Policy result)758 private void buildPartial0(com.google.cloud.compute.v1.Policy result) { 759 int from_bitField0_ = bitField0_; 760 int to_bitField0_ = 0; 761 if (((from_bitField0_ & 0x00000004) != 0)) { 762 result.etag_ = etag_; 763 to_bitField0_ |= 0x00000001; 764 } 765 if (((from_bitField0_ & 0x00000008) != 0)) { 766 result.iamOwned_ = iamOwned_; 767 to_bitField0_ |= 0x00000002; 768 } 769 if (((from_bitField0_ & 0x00000020) != 0)) { 770 result.version_ = version_; 771 to_bitField0_ |= 0x00000004; 772 } 773 result.bitField0_ |= to_bitField0_; 774 } 775 776 @java.lang.Override clone()777 public Builder clone() { 778 return super.clone(); 779 } 780 781 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)782 public Builder setField( 783 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 784 return super.setField(field, value); 785 } 786 787 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)788 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 789 return super.clearField(field); 790 } 791 792 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)793 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 794 return super.clearOneof(oneof); 795 } 796 797 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)798 public Builder setRepeatedField( 799 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 800 return super.setRepeatedField(field, index, value); 801 } 802 803 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)804 public Builder addRepeatedField( 805 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 806 return super.addRepeatedField(field, value); 807 } 808 809 @java.lang.Override mergeFrom(com.google.protobuf.Message other)810 public Builder mergeFrom(com.google.protobuf.Message other) { 811 if (other instanceof com.google.cloud.compute.v1.Policy) { 812 return mergeFrom((com.google.cloud.compute.v1.Policy) other); 813 } else { 814 super.mergeFrom(other); 815 return this; 816 } 817 } 818 mergeFrom(com.google.cloud.compute.v1.Policy other)819 public Builder mergeFrom(com.google.cloud.compute.v1.Policy other) { 820 if (other == com.google.cloud.compute.v1.Policy.getDefaultInstance()) return this; 821 if (auditConfigsBuilder_ == null) { 822 if (!other.auditConfigs_.isEmpty()) { 823 if (auditConfigs_.isEmpty()) { 824 auditConfigs_ = other.auditConfigs_; 825 bitField0_ = (bitField0_ & ~0x00000001); 826 } else { 827 ensureAuditConfigsIsMutable(); 828 auditConfigs_.addAll(other.auditConfigs_); 829 } 830 onChanged(); 831 } 832 } else { 833 if (!other.auditConfigs_.isEmpty()) { 834 if (auditConfigsBuilder_.isEmpty()) { 835 auditConfigsBuilder_.dispose(); 836 auditConfigsBuilder_ = null; 837 auditConfigs_ = other.auditConfigs_; 838 bitField0_ = (bitField0_ & ~0x00000001); 839 auditConfigsBuilder_ = 840 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 841 ? getAuditConfigsFieldBuilder() 842 : null; 843 } else { 844 auditConfigsBuilder_.addAllMessages(other.auditConfigs_); 845 } 846 } 847 } 848 if (bindingsBuilder_ == null) { 849 if (!other.bindings_.isEmpty()) { 850 if (bindings_.isEmpty()) { 851 bindings_ = other.bindings_; 852 bitField0_ = (bitField0_ & ~0x00000002); 853 } else { 854 ensureBindingsIsMutable(); 855 bindings_.addAll(other.bindings_); 856 } 857 onChanged(); 858 } 859 } else { 860 if (!other.bindings_.isEmpty()) { 861 if (bindingsBuilder_.isEmpty()) { 862 bindingsBuilder_.dispose(); 863 bindingsBuilder_ = null; 864 bindings_ = other.bindings_; 865 bitField0_ = (bitField0_ & ~0x00000002); 866 bindingsBuilder_ = 867 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 868 ? getBindingsFieldBuilder() 869 : null; 870 } else { 871 bindingsBuilder_.addAllMessages(other.bindings_); 872 } 873 } 874 } 875 if (other.hasEtag()) { 876 etag_ = other.etag_; 877 bitField0_ |= 0x00000004; 878 onChanged(); 879 } 880 if (other.hasIamOwned()) { 881 setIamOwned(other.getIamOwned()); 882 } 883 if (rulesBuilder_ == null) { 884 if (!other.rules_.isEmpty()) { 885 if (rules_.isEmpty()) { 886 rules_ = other.rules_; 887 bitField0_ = (bitField0_ & ~0x00000010); 888 } else { 889 ensureRulesIsMutable(); 890 rules_.addAll(other.rules_); 891 } 892 onChanged(); 893 } 894 } else { 895 if (!other.rules_.isEmpty()) { 896 if (rulesBuilder_.isEmpty()) { 897 rulesBuilder_.dispose(); 898 rulesBuilder_ = null; 899 rules_ = other.rules_; 900 bitField0_ = (bitField0_ & ~0x00000010); 901 rulesBuilder_ = 902 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 903 ? getRulesFieldBuilder() 904 : null; 905 } else { 906 rulesBuilder_.addAllMessages(other.rules_); 907 } 908 } 909 } 910 if (other.hasVersion()) { 911 setVersion(other.getVersion()); 912 } 913 this.mergeUnknownFields(other.getUnknownFields()); 914 onChanged(); 915 return this; 916 } 917 918 @java.lang.Override isInitialized()919 public final boolean isInitialized() { 920 return true; 921 } 922 923 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)924 public Builder mergeFrom( 925 com.google.protobuf.CodedInputStream input, 926 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 927 throws java.io.IOException { 928 if (extensionRegistry == null) { 929 throw new java.lang.NullPointerException(); 930 } 931 try { 932 boolean done = false; 933 while (!done) { 934 int tag = input.readTag(); 935 switch (tag) { 936 case 0: 937 done = true; 938 break; 939 case 24987818: 940 { 941 etag_ = input.readStringRequireUtf8(); 942 bitField0_ |= 0x00000004; 943 break; 944 } // case 24987818 945 case 870991802: 946 { 947 com.google.cloud.compute.v1.Rule m = 948 input.readMessage(com.google.cloud.compute.v1.Rule.parser(), extensionRegistry); 949 if (rulesBuilder_ == null) { 950 ensureRulesIsMutable(); 951 rules_.add(m); 952 } else { 953 rulesBuilder_.addMessage(m); 954 } 955 break; 956 } // case 870991802 957 case -1670322070: 958 { 959 com.google.cloud.compute.v1.AuditConfig m = 960 input.readMessage( 961 com.google.cloud.compute.v1.AuditConfig.parser(), extensionRegistry); 962 if (auditConfigsBuilder_ == null) { 963 ensureAuditConfigsIsMutable(); 964 auditConfigs_.add(m); 965 } else { 966 auditConfigsBuilder_.addMessage(m); 967 } 968 break; 969 } // case -1670322070 970 case -1482103104: 971 { 972 version_ = input.readInt32(); 973 bitField0_ |= 0x00000020; 974 break; 975 } // case -1482103104 976 case -1068952462: 977 { 978 com.google.cloud.compute.v1.Binding m = 979 input.readMessage( 980 com.google.cloud.compute.v1.Binding.parser(), extensionRegistry); 981 if (bindingsBuilder_ == null) { 982 ensureBindingsIsMutable(); 983 bindings_.add(m); 984 } else { 985 bindingsBuilder_.addMessage(m); 986 } 987 break; 988 } // case -1068952462 989 case -690437672: 990 { 991 iamOwned_ = input.readBool(); 992 bitField0_ |= 0x00000008; 993 break; 994 } // case -690437672 995 default: 996 { 997 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 998 done = true; // was an endgroup tag 999 } 1000 break; 1001 } // default: 1002 } // switch (tag) 1003 } // while (!done) 1004 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1005 throw e.unwrapIOException(); 1006 } finally { 1007 onChanged(); 1008 } // finally 1009 return this; 1010 } 1011 1012 private int bitField0_; 1013 1014 private java.util.List<com.google.cloud.compute.v1.AuditConfig> auditConfigs_ = 1015 java.util.Collections.emptyList(); 1016 ensureAuditConfigsIsMutable()1017 private void ensureAuditConfigsIsMutable() { 1018 if (!((bitField0_ & 0x00000001) != 0)) { 1019 auditConfigs_ = 1020 new java.util.ArrayList<com.google.cloud.compute.v1.AuditConfig>(auditConfigs_); 1021 bitField0_ |= 0x00000001; 1022 } 1023 } 1024 1025 private com.google.protobuf.RepeatedFieldBuilderV3< 1026 com.google.cloud.compute.v1.AuditConfig, 1027 com.google.cloud.compute.v1.AuditConfig.Builder, 1028 com.google.cloud.compute.v1.AuditConfigOrBuilder> 1029 auditConfigsBuilder_; 1030 1031 /** 1032 * 1033 * 1034 * <pre> 1035 * Specifies cloud audit logging configuration for this policy. 1036 * </pre> 1037 * 1038 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1039 */ getAuditConfigsList()1040 public java.util.List<com.google.cloud.compute.v1.AuditConfig> getAuditConfigsList() { 1041 if (auditConfigsBuilder_ == null) { 1042 return java.util.Collections.unmodifiableList(auditConfigs_); 1043 } else { 1044 return auditConfigsBuilder_.getMessageList(); 1045 } 1046 } 1047 /** 1048 * 1049 * 1050 * <pre> 1051 * Specifies cloud audit logging configuration for this policy. 1052 * </pre> 1053 * 1054 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1055 */ getAuditConfigsCount()1056 public int getAuditConfigsCount() { 1057 if (auditConfigsBuilder_ == null) { 1058 return auditConfigs_.size(); 1059 } else { 1060 return auditConfigsBuilder_.getCount(); 1061 } 1062 } 1063 /** 1064 * 1065 * 1066 * <pre> 1067 * Specifies cloud audit logging configuration for this policy. 1068 * </pre> 1069 * 1070 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1071 */ getAuditConfigs(int index)1072 public com.google.cloud.compute.v1.AuditConfig getAuditConfigs(int index) { 1073 if (auditConfigsBuilder_ == null) { 1074 return auditConfigs_.get(index); 1075 } else { 1076 return auditConfigsBuilder_.getMessage(index); 1077 } 1078 } 1079 /** 1080 * 1081 * 1082 * <pre> 1083 * Specifies cloud audit logging configuration for this policy. 1084 * </pre> 1085 * 1086 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1087 */ setAuditConfigs(int index, com.google.cloud.compute.v1.AuditConfig value)1088 public Builder setAuditConfigs(int index, com.google.cloud.compute.v1.AuditConfig value) { 1089 if (auditConfigsBuilder_ == null) { 1090 if (value == null) { 1091 throw new NullPointerException(); 1092 } 1093 ensureAuditConfigsIsMutable(); 1094 auditConfigs_.set(index, value); 1095 onChanged(); 1096 } else { 1097 auditConfigsBuilder_.setMessage(index, value); 1098 } 1099 return this; 1100 } 1101 /** 1102 * 1103 * 1104 * <pre> 1105 * Specifies cloud audit logging configuration for this policy. 1106 * </pre> 1107 * 1108 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1109 */ setAuditConfigs( int index, com.google.cloud.compute.v1.AuditConfig.Builder builderForValue)1110 public Builder setAuditConfigs( 1111 int index, com.google.cloud.compute.v1.AuditConfig.Builder builderForValue) { 1112 if (auditConfigsBuilder_ == null) { 1113 ensureAuditConfigsIsMutable(); 1114 auditConfigs_.set(index, builderForValue.build()); 1115 onChanged(); 1116 } else { 1117 auditConfigsBuilder_.setMessage(index, builderForValue.build()); 1118 } 1119 return this; 1120 } 1121 /** 1122 * 1123 * 1124 * <pre> 1125 * Specifies cloud audit logging configuration for this policy. 1126 * </pre> 1127 * 1128 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1129 */ addAuditConfigs(com.google.cloud.compute.v1.AuditConfig value)1130 public Builder addAuditConfigs(com.google.cloud.compute.v1.AuditConfig value) { 1131 if (auditConfigsBuilder_ == null) { 1132 if (value == null) { 1133 throw new NullPointerException(); 1134 } 1135 ensureAuditConfigsIsMutable(); 1136 auditConfigs_.add(value); 1137 onChanged(); 1138 } else { 1139 auditConfigsBuilder_.addMessage(value); 1140 } 1141 return this; 1142 } 1143 /** 1144 * 1145 * 1146 * <pre> 1147 * Specifies cloud audit logging configuration for this policy. 1148 * </pre> 1149 * 1150 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1151 */ addAuditConfigs(int index, com.google.cloud.compute.v1.AuditConfig value)1152 public Builder addAuditConfigs(int index, com.google.cloud.compute.v1.AuditConfig value) { 1153 if (auditConfigsBuilder_ == null) { 1154 if (value == null) { 1155 throw new NullPointerException(); 1156 } 1157 ensureAuditConfigsIsMutable(); 1158 auditConfigs_.add(index, value); 1159 onChanged(); 1160 } else { 1161 auditConfigsBuilder_.addMessage(index, value); 1162 } 1163 return this; 1164 } 1165 /** 1166 * 1167 * 1168 * <pre> 1169 * Specifies cloud audit logging configuration for this policy. 1170 * </pre> 1171 * 1172 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1173 */ addAuditConfigs( com.google.cloud.compute.v1.AuditConfig.Builder builderForValue)1174 public Builder addAuditConfigs( 1175 com.google.cloud.compute.v1.AuditConfig.Builder builderForValue) { 1176 if (auditConfigsBuilder_ == null) { 1177 ensureAuditConfigsIsMutable(); 1178 auditConfigs_.add(builderForValue.build()); 1179 onChanged(); 1180 } else { 1181 auditConfigsBuilder_.addMessage(builderForValue.build()); 1182 } 1183 return this; 1184 } 1185 /** 1186 * 1187 * 1188 * <pre> 1189 * Specifies cloud audit logging configuration for this policy. 1190 * </pre> 1191 * 1192 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1193 */ addAuditConfigs( int index, com.google.cloud.compute.v1.AuditConfig.Builder builderForValue)1194 public Builder addAuditConfigs( 1195 int index, com.google.cloud.compute.v1.AuditConfig.Builder builderForValue) { 1196 if (auditConfigsBuilder_ == null) { 1197 ensureAuditConfigsIsMutable(); 1198 auditConfigs_.add(index, builderForValue.build()); 1199 onChanged(); 1200 } else { 1201 auditConfigsBuilder_.addMessage(index, builderForValue.build()); 1202 } 1203 return this; 1204 } 1205 /** 1206 * 1207 * 1208 * <pre> 1209 * Specifies cloud audit logging configuration for this policy. 1210 * </pre> 1211 * 1212 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1213 */ addAllAuditConfigs( java.lang.Iterable<? extends com.google.cloud.compute.v1.AuditConfig> values)1214 public Builder addAllAuditConfigs( 1215 java.lang.Iterable<? extends com.google.cloud.compute.v1.AuditConfig> values) { 1216 if (auditConfigsBuilder_ == null) { 1217 ensureAuditConfigsIsMutable(); 1218 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, auditConfigs_); 1219 onChanged(); 1220 } else { 1221 auditConfigsBuilder_.addAllMessages(values); 1222 } 1223 return this; 1224 } 1225 /** 1226 * 1227 * 1228 * <pre> 1229 * Specifies cloud audit logging configuration for this policy. 1230 * </pre> 1231 * 1232 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1233 */ clearAuditConfigs()1234 public Builder clearAuditConfigs() { 1235 if (auditConfigsBuilder_ == null) { 1236 auditConfigs_ = java.util.Collections.emptyList(); 1237 bitField0_ = (bitField0_ & ~0x00000001); 1238 onChanged(); 1239 } else { 1240 auditConfigsBuilder_.clear(); 1241 } 1242 return this; 1243 } 1244 /** 1245 * 1246 * 1247 * <pre> 1248 * Specifies cloud audit logging configuration for this policy. 1249 * </pre> 1250 * 1251 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1252 */ removeAuditConfigs(int index)1253 public Builder removeAuditConfigs(int index) { 1254 if (auditConfigsBuilder_ == null) { 1255 ensureAuditConfigsIsMutable(); 1256 auditConfigs_.remove(index); 1257 onChanged(); 1258 } else { 1259 auditConfigsBuilder_.remove(index); 1260 } 1261 return this; 1262 } 1263 /** 1264 * 1265 * 1266 * <pre> 1267 * Specifies cloud audit logging configuration for this policy. 1268 * </pre> 1269 * 1270 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1271 */ getAuditConfigsBuilder(int index)1272 public com.google.cloud.compute.v1.AuditConfig.Builder getAuditConfigsBuilder(int index) { 1273 return getAuditConfigsFieldBuilder().getBuilder(index); 1274 } 1275 /** 1276 * 1277 * 1278 * <pre> 1279 * Specifies cloud audit logging configuration for this policy. 1280 * </pre> 1281 * 1282 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1283 */ getAuditConfigsOrBuilder(int index)1284 public com.google.cloud.compute.v1.AuditConfigOrBuilder getAuditConfigsOrBuilder(int index) { 1285 if (auditConfigsBuilder_ == null) { 1286 return auditConfigs_.get(index); 1287 } else { 1288 return auditConfigsBuilder_.getMessageOrBuilder(index); 1289 } 1290 } 1291 /** 1292 * 1293 * 1294 * <pre> 1295 * Specifies cloud audit logging configuration for this policy. 1296 * </pre> 1297 * 1298 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1299 */ 1300 public java.util.List<? extends com.google.cloud.compute.v1.AuditConfigOrBuilder> getAuditConfigsOrBuilderList()1301 getAuditConfigsOrBuilderList() { 1302 if (auditConfigsBuilder_ != null) { 1303 return auditConfigsBuilder_.getMessageOrBuilderList(); 1304 } else { 1305 return java.util.Collections.unmodifiableList(auditConfigs_); 1306 } 1307 } 1308 /** 1309 * 1310 * 1311 * <pre> 1312 * Specifies cloud audit logging configuration for this policy. 1313 * </pre> 1314 * 1315 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1316 */ addAuditConfigsBuilder()1317 public com.google.cloud.compute.v1.AuditConfig.Builder addAuditConfigsBuilder() { 1318 return getAuditConfigsFieldBuilder() 1319 .addBuilder(com.google.cloud.compute.v1.AuditConfig.getDefaultInstance()); 1320 } 1321 /** 1322 * 1323 * 1324 * <pre> 1325 * Specifies cloud audit logging configuration for this policy. 1326 * </pre> 1327 * 1328 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1329 */ addAuditConfigsBuilder(int index)1330 public com.google.cloud.compute.v1.AuditConfig.Builder addAuditConfigsBuilder(int index) { 1331 return getAuditConfigsFieldBuilder() 1332 .addBuilder(index, com.google.cloud.compute.v1.AuditConfig.getDefaultInstance()); 1333 } 1334 /** 1335 * 1336 * 1337 * <pre> 1338 * Specifies cloud audit logging configuration for this policy. 1339 * </pre> 1340 * 1341 * <code>repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653;</code> 1342 */ 1343 public java.util.List<com.google.cloud.compute.v1.AuditConfig.Builder> getAuditConfigsBuilderList()1344 getAuditConfigsBuilderList() { 1345 return getAuditConfigsFieldBuilder().getBuilderList(); 1346 } 1347 1348 private com.google.protobuf.RepeatedFieldBuilderV3< 1349 com.google.cloud.compute.v1.AuditConfig, 1350 com.google.cloud.compute.v1.AuditConfig.Builder, 1351 com.google.cloud.compute.v1.AuditConfigOrBuilder> getAuditConfigsFieldBuilder()1352 getAuditConfigsFieldBuilder() { 1353 if (auditConfigsBuilder_ == null) { 1354 auditConfigsBuilder_ = 1355 new com.google.protobuf.RepeatedFieldBuilderV3< 1356 com.google.cloud.compute.v1.AuditConfig, 1357 com.google.cloud.compute.v1.AuditConfig.Builder, 1358 com.google.cloud.compute.v1.AuditConfigOrBuilder>( 1359 auditConfigs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); 1360 auditConfigs_ = null; 1361 } 1362 return auditConfigsBuilder_; 1363 } 1364 1365 private java.util.List<com.google.cloud.compute.v1.Binding> bindings_ = 1366 java.util.Collections.emptyList(); 1367 ensureBindingsIsMutable()1368 private void ensureBindingsIsMutable() { 1369 if (!((bitField0_ & 0x00000002) != 0)) { 1370 bindings_ = new java.util.ArrayList<com.google.cloud.compute.v1.Binding>(bindings_); 1371 bitField0_ |= 0x00000002; 1372 } 1373 } 1374 1375 private com.google.protobuf.RepeatedFieldBuilderV3< 1376 com.google.cloud.compute.v1.Binding, 1377 com.google.cloud.compute.v1.Binding.Builder, 1378 com.google.cloud.compute.v1.BindingOrBuilder> 1379 bindingsBuilder_; 1380 1381 /** 1382 * 1383 * 1384 * <pre> 1385 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1386 * </pre> 1387 * 1388 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1389 */ getBindingsList()1390 public java.util.List<com.google.cloud.compute.v1.Binding> getBindingsList() { 1391 if (bindingsBuilder_ == null) { 1392 return java.util.Collections.unmodifiableList(bindings_); 1393 } else { 1394 return bindingsBuilder_.getMessageList(); 1395 } 1396 } 1397 /** 1398 * 1399 * 1400 * <pre> 1401 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1402 * </pre> 1403 * 1404 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1405 */ getBindingsCount()1406 public int getBindingsCount() { 1407 if (bindingsBuilder_ == null) { 1408 return bindings_.size(); 1409 } else { 1410 return bindingsBuilder_.getCount(); 1411 } 1412 } 1413 /** 1414 * 1415 * 1416 * <pre> 1417 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1418 * </pre> 1419 * 1420 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1421 */ getBindings(int index)1422 public com.google.cloud.compute.v1.Binding getBindings(int index) { 1423 if (bindingsBuilder_ == null) { 1424 return bindings_.get(index); 1425 } else { 1426 return bindingsBuilder_.getMessage(index); 1427 } 1428 } 1429 /** 1430 * 1431 * 1432 * <pre> 1433 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1434 * </pre> 1435 * 1436 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1437 */ setBindings(int index, com.google.cloud.compute.v1.Binding value)1438 public Builder setBindings(int index, com.google.cloud.compute.v1.Binding value) { 1439 if (bindingsBuilder_ == null) { 1440 if (value == null) { 1441 throw new NullPointerException(); 1442 } 1443 ensureBindingsIsMutable(); 1444 bindings_.set(index, value); 1445 onChanged(); 1446 } else { 1447 bindingsBuilder_.setMessage(index, value); 1448 } 1449 return this; 1450 } 1451 /** 1452 * 1453 * 1454 * <pre> 1455 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1456 * </pre> 1457 * 1458 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1459 */ setBindings( int index, com.google.cloud.compute.v1.Binding.Builder builderForValue)1460 public Builder setBindings( 1461 int index, com.google.cloud.compute.v1.Binding.Builder builderForValue) { 1462 if (bindingsBuilder_ == null) { 1463 ensureBindingsIsMutable(); 1464 bindings_.set(index, builderForValue.build()); 1465 onChanged(); 1466 } else { 1467 bindingsBuilder_.setMessage(index, builderForValue.build()); 1468 } 1469 return this; 1470 } 1471 /** 1472 * 1473 * 1474 * <pre> 1475 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1476 * </pre> 1477 * 1478 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1479 */ addBindings(com.google.cloud.compute.v1.Binding value)1480 public Builder addBindings(com.google.cloud.compute.v1.Binding value) { 1481 if (bindingsBuilder_ == null) { 1482 if (value == null) { 1483 throw new NullPointerException(); 1484 } 1485 ensureBindingsIsMutable(); 1486 bindings_.add(value); 1487 onChanged(); 1488 } else { 1489 bindingsBuilder_.addMessage(value); 1490 } 1491 return this; 1492 } 1493 /** 1494 * 1495 * 1496 * <pre> 1497 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1498 * </pre> 1499 * 1500 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1501 */ addBindings(int index, com.google.cloud.compute.v1.Binding value)1502 public Builder addBindings(int index, com.google.cloud.compute.v1.Binding value) { 1503 if (bindingsBuilder_ == null) { 1504 if (value == null) { 1505 throw new NullPointerException(); 1506 } 1507 ensureBindingsIsMutable(); 1508 bindings_.add(index, value); 1509 onChanged(); 1510 } else { 1511 bindingsBuilder_.addMessage(index, value); 1512 } 1513 return this; 1514 } 1515 /** 1516 * 1517 * 1518 * <pre> 1519 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1520 * </pre> 1521 * 1522 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1523 */ addBindings(com.google.cloud.compute.v1.Binding.Builder builderForValue)1524 public Builder addBindings(com.google.cloud.compute.v1.Binding.Builder builderForValue) { 1525 if (bindingsBuilder_ == null) { 1526 ensureBindingsIsMutable(); 1527 bindings_.add(builderForValue.build()); 1528 onChanged(); 1529 } else { 1530 bindingsBuilder_.addMessage(builderForValue.build()); 1531 } 1532 return this; 1533 } 1534 /** 1535 * 1536 * 1537 * <pre> 1538 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1539 * </pre> 1540 * 1541 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1542 */ addBindings( int index, com.google.cloud.compute.v1.Binding.Builder builderForValue)1543 public Builder addBindings( 1544 int index, com.google.cloud.compute.v1.Binding.Builder builderForValue) { 1545 if (bindingsBuilder_ == null) { 1546 ensureBindingsIsMutable(); 1547 bindings_.add(index, builderForValue.build()); 1548 onChanged(); 1549 } else { 1550 bindingsBuilder_.addMessage(index, builderForValue.build()); 1551 } 1552 return this; 1553 } 1554 /** 1555 * 1556 * 1557 * <pre> 1558 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1559 * </pre> 1560 * 1561 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1562 */ addAllBindings( java.lang.Iterable<? extends com.google.cloud.compute.v1.Binding> values)1563 public Builder addAllBindings( 1564 java.lang.Iterable<? extends com.google.cloud.compute.v1.Binding> values) { 1565 if (bindingsBuilder_ == null) { 1566 ensureBindingsIsMutable(); 1567 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, bindings_); 1568 onChanged(); 1569 } else { 1570 bindingsBuilder_.addAllMessages(values); 1571 } 1572 return this; 1573 } 1574 /** 1575 * 1576 * 1577 * <pre> 1578 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1579 * </pre> 1580 * 1581 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1582 */ clearBindings()1583 public Builder clearBindings() { 1584 if (bindingsBuilder_ == null) { 1585 bindings_ = java.util.Collections.emptyList(); 1586 bitField0_ = (bitField0_ & ~0x00000002); 1587 onChanged(); 1588 } else { 1589 bindingsBuilder_.clear(); 1590 } 1591 return this; 1592 } 1593 /** 1594 * 1595 * 1596 * <pre> 1597 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1598 * </pre> 1599 * 1600 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1601 */ removeBindings(int index)1602 public Builder removeBindings(int index) { 1603 if (bindingsBuilder_ == null) { 1604 ensureBindingsIsMutable(); 1605 bindings_.remove(index); 1606 onChanged(); 1607 } else { 1608 bindingsBuilder_.remove(index); 1609 } 1610 return this; 1611 } 1612 /** 1613 * 1614 * 1615 * <pre> 1616 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1617 * </pre> 1618 * 1619 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1620 */ getBindingsBuilder(int index)1621 public com.google.cloud.compute.v1.Binding.Builder getBindingsBuilder(int index) { 1622 return getBindingsFieldBuilder().getBuilder(index); 1623 } 1624 /** 1625 * 1626 * 1627 * <pre> 1628 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1629 * </pre> 1630 * 1631 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1632 */ getBindingsOrBuilder(int index)1633 public com.google.cloud.compute.v1.BindingOrBuilder getBindingsOrBuilder(int index) { 1634 if (bindingsBuilder_ == null) { 1635 return bindings_.get(index); 1636 } else { 1637 return bindingsBuilder_.getMessageOrBuilder(index); 1638 } 1639 } 1640 /** 1641 * 1642 * 1643 * <pre> 1644 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1645 * </pre> 1646 * 1647 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1648 */ 1649 public java.util.List<? extends com.google.cloud.compute.v1.BindingOrBuilder> getBindingsOrBuilderList()1650 getBindingsOrBuilderList() { 1651 if (bindingsBuilder_ != null) { 1652 return bindingsBuilder_.getMessageOrBuilderList(); 1653 } else { 1654 return java.util.Collections.unmodifiableList(bindings_); 1655 } 1656 } 1657 /** 1658 * 1659 * 1660 * <pre> 1661 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1662 * </pre> 1663 * 1664 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1665 */ addBindingsBuilder()1666 public com.google.cloud.compute.v1.Binding.Builder addBindingsBuilder() { 1667 return getBindingsFieldBuilder() 1668 .addBuilder(com.google.cloud.compute.v1.Binding.getDefaultInstance()); 1669 } 1670 /** 1671 * 1672 * 1673 * <pre> 1674 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1675 * </pre> 1676 * 1677 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1678 */ addBindingsBuilder(int index)1679 public com.google.cloud.compute.v1.Binding.Builder addBindingsBuilder(int index) { 1680 return getBindingsFieldBuilder() 1681 .addBuilder(index, com.google.cloud.compute.v1.Binding.getDefaultInstance()); 1682 } 1683 /** 1684 * 1685 * 1686 * <pre> 1687 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. 1688 * </pre> 1689 * 1690 * <code>repeated .google.cloud.compute.v1.Binding bindings = 403251854;</code> 1691 */ getBindingsBuilderList()1692 public java.util.List<com.google.cloud.compute.v1.Binding.Builder> getBindingsBuilderList() { 1693 return getBindingsFieldBuilder().getBuilderList(); 1694 } 1695 1696 private com.google.protobuf.RepeatedFieldBuilderV3< 1697 com.google.cloud.compute.v1.Binding, 1698 com.google.cloud.compute.v1.Binding.Builder, 1699 com.google.cloud.compute.v1.BindingOrBuilder> getBindingsFieldBuilder()1700 getBindingsFieldBuilder() { 1701 if (bindingsBuilder_ == null) { 1702 bindingsBuilder_ = 1703 new com.google.protobuf.RepeatedFieldBuilderV3< 1704 com.google.cloud.compute.v1.Binding, 1705 com.google.cloud.compute.v1.Binding.Builder, 1706 com.google.cloud.compute.v1.BindingOrBuilder>( 1707 bindings_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); 1708 bindings_ = null; 1709 } 1710 return bindingsBuilder_; 1711 } 1712 1713 private java.lang.Object etag_ = ""; 1714 /** 1715 * 1716 * 1717 * <pre> 1718 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. 1719 * </pre> 1720 * 1721 * <code>optional string etag = 3123477;</code> 1722 * 1723 * @return Whether the etag field is set. 1724 */ hasEtag()1725 public boolean hasEtag() { 1726 return ((bitField0_ & 0x00000004) != 0); 1727 } 1728 /** 1729 * 1730 * 1731 * <pre> 1732 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. 1733 * </pre> 1734 * 1735 * <code>optional string etag = 3123477;</code> 1736 * 1737 * @return The etag. 1738 */ getEtag()1739 public java.lang.String getEtag() { 1740 java.lang.Object ref = etag_; 1741 if (!(ref instanceof java.lang.String)) { 1742 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1743 java.lang.String s = bs.toStringUtf8(); 1744 etag_ = s; 1745 return s; 1746 } else { 1747 return (java.lang.String) ref; 1748 } 1749 } 1750 /** 1751 * 1752 * 1753 * <pre> 1754 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. 1755 * </pre> 1756 * 1757 * <code>optional string etag = 3123477;</code> 1758 * 1759 * @return The bytes for etag. 1760 */ getEtagBytes()1761 public com.google.protobuf.ByteString getEtagBytes() { 1762 java.lang.Object ref = etag_; 1763 if (ref instanceof String) { 1764 com.google.protobuf.ByteString b = 1765 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1766 etag_ = b; 1767 return b; 1768 } else { 1769 return (com.google.protobuf.ByteString) ref; 1770 } 1771 } 1772 /** 1773 * 1774 * 1775 * <pre> 1776 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. 1777 * </pre> 1778 * 1779 * <code>optional string etag = 3123477;</code> 1780 * 1781 * @param value The etag to set. 1782 * @return This builder for chaining. 1783 */ setEtag(java.lang.String value)1784 public Builder setEtag(java.lang.String value) { 1785 if (value == null) { 1786 throw new NullPointerException(); 1787 } 1788 etag_ = value; 1789 bitField0_ |= 0x00000004; 1790 onChanged(); 1791 return this; 1792 } 1793 /** 1794 * 1795 * 1796 * <pre> 1797 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. 1798 * </pre> 1799 * 1800 * <code>optional string etag = 3123477;</code> 1801 * 1802 * @return This builder for chaining. 1803 */ clearEtag()1804 public Builder clearEtag() { 1805 etag_ = getDefaultInstance().getEtag(); 1806 bitField0_ = (bitField0_ & ~0x00000004); 1807 onChanged(); 1808 return this; 1809 } 1810 /** 1811 * 1812 * 1813 * <pre> 1814 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. 1815 * </pre> 1816 * 1817 * <code>optional string etag = 3123477;</code> 1818 * 1819 * @param value The bytes for etag to set. 1820 * @return This builder for chaining. 1821 */ setEtagBytes(com.google.protobuf.ByteString value)1822 public Builder setEtagBytes(com.google.protobuf.ByteString value) { 1823 if (value == null) { 1824 throw new NullPointerException(); 1825 } 1826 checkByteStringIsUtf8(value); 1827 etag_ = value; 1828 bitField0_ |= 0x00000004; 1829 onChanged(); 1830 return this; 1831 } 1832 1833 private boolean iamOwned_; 1834 /** 1835 * <code>optional bool iam_owned = 450566203;</code> 1836 * 1837 * @return Whether the iamOwned field is set. 1838 */ 1839 @java.lang.Override hasIamOwned()1840 public boolean hasIamOwned() { 1841 return ((bitField0_ & 0x00000008) != 0); 1842 } 1843 /** 1844 * <code>optional bool iam_owned = 450566203;</code> 1845 * 1846 * @return The iamOwned. 1847 */ 1848 @java.lang.Override getIamOwned()1849 public boolean getIamOwned() { 1850 return iamOwned_; 1851 } 1852 /** 1853 * <code>optional bool iam_owned = 450566203;</code> 1854 * 1855 * @param value The iamOwned to set. 1856 * @return This builder for chaining. 1857 */ setIamOwned(boolean value)1858 public Builder setIamOwned(boolean value) { 1859 1860 iamOwned_ = value; 1861 bitField0_ |= 0x00000008; 1862 onChanged(); 1863 return this; 1864 } 1865 /** 1866 * <code>optional bool iam_owned = 450566203;</code> 1867 * 1868 * @return This builder for chaining. 1869 */ clearIamOwned()1870 public Builder clearIamOwned() { 1871 bitField0_ = (bitField0_ & ~0x00000008); 1872 iamOwned_ = false; 1873 onChanged(); 1874 return this; 1875 } 1876 1877 private java.util.List<com.google.cloud.compute.v1.Rule> rules_ = 1878 java.util.Collections.emptyList(); 1879 ensureRulesIsMutable()1880 private void ensureRulesIsMutable() { 1881 if (!((bitField0_ & 0x00000010) != 0)) { 1882 rules_ = new java.util.ArrayList<com.google.cloud.compute.v1.Rule>(rules_); 1883 bitField0_ |= 0x00000010; 1884 } 1885 } 1886 1887 private com.google.protobuf.RepeatedFieldBuilderV3< 1888 com.google.cloud.compute.v1.Rule, 1889 com.google.cloud.compute.v1.Rule.Builder, 1890 com.google.cloud.compute.v1.RuleOrBuilder> 1891 rulesBuilder_; 1892 1893 /** 1894 * 1895 * 1896 * <pre> 1897 * This is deprecated and has no effect. Do not use. 1898 * </pre> 1899 * 1900 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 1901 */ getRulesList()1902 public java.util.List<com.google.cloud.compute.v1.Rule> getRulesList() { 1903 if (rulesBuilder_ == null) { 1904 return java.util.Collections.unmodifiableList(rules_); 1905 } else { 1906 return rulesBuilder_.getMessageList(); 1907 } 1908 } 1909 /** 1910 * 1911 * 1912 * <pre> 1913 * This is deprecated and has no effect. Do not use. 1914 * </pre> 1915 * 1916 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 1917 */ getRulesCount()1918 public int getRulesCount() { 1919 if (rulesBuilder_ == null) { 1920 return rules_.size(); 1921 } else { 1922 return rulesBuilder_.getCount(); 1923 } 1924 } 1925 /** 1926 * 1927 * 1928 * <pre> 1929 * This is deprecated and has no effect. Do not use. 1930 * </pre> 1931 * 1932 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 1933 */ getRules(int index)1934 public com.google.cloud.compute.v1.Rule getRules(int index) { 1935 if (rulesBuilder_ == null) { 1936 return rules_.get(index); 1937 } else { 1938 return rulesBuilder_.getMessage(index); 1939 } 1940 } 1941 /** 1942 * 1943 * 1944 * <pre> 1945 * This is deprecated and has no effect. Do not use. 1946 * </pre> 1947 * 1948 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 1949 */ setRules(int index, com.google.cloud.compute.v1.Rule value)1950 public Builder setRules(int index, com.google.cloud.compute.v1.Rule value) { 1951 if (rulesBuilder_ == null) { 1952 if (value == null) { 1953 throw new NullPointerException(); 1954 } 1955 ensureRulesIsMutable(); 1956 rules_.set(index, value); 1957 onChanged(); 1958 } else { 1959 rulesBuilder_.setMessage(index, value); 1960 } 1961 return this; 1962 } 1963 /** 1964 * 1965 * 1966 * <pre> 1967 * This is deprecated and has no effect. Do not use. 1968 * </pre> 1969 * 1970 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 1971 */ setRules(int index, com.google.cloud.compute.v1.Rule.Builder builderForValue)1972 public Builder setRules(int index, com.google.cloud.compute.v1.Rule.Builder builderForValue) { 1973 if (rulesBuilder_ == null) { 1974 ensureRulesIsMutable(); 1975 rules_.set(index, builderForValue.build()); 1976 onChanged(); 1977 } else { 1978 rulesBuilder_.setMessage(index, builderForValue.build()); 1979 } 1980 return this; 1981 } 1982 /** 1983 * 1984 * 1985 * <pre> 1986 * This is deprecated and has no effect. Do not use. 1987 * </pre> 1988 * 1989 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 1990 */ addRules(com.google.cloud.compute.v1.Rule value)1991 public Builder addRules(com.google.cloud.compute.v1.Rule value) { 1992 if (rulesBuilder_ == null) { 1993 if (value == null) { 1994 throw new NullPointerException(); 1995 } 1996 ensureRulesIsMutable(); 1997 rules_.add(value); 1998 onChanged(); 1999 } else { 2000 rulesBuilder_.addMessage(value); 2001 } 2002 return this; 2003 } 2004 /** 2005 * 2006 * 2007 * <pre> 2008 * This is deprecated and has no effect. Do not use. 2009 * </pre> 2010 * 2011 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2012 */ addRules(int index, com.google.cloud.compute.v1.Rule value)2013 public Builder addRules(int index, com.google.cloud.compute.v1.Rule value) { 2014 if (rulesBuilder_ == null) { 2015 if (value == null) { 2016 throw new NullPointerException(); 2017 } 2018 ensureRulesIsMutable(); 2019 rules_.add(index, value); 2020 onChanged(); 2021 } else { 2022 rulesBuilder_.addMessage(index, value); 2023 } 2024 return this; 2025 } 2026 /** 2027 * 2028 * 2029 * <pre> 2030 * This is deprecated and has no effect. Do not use. 2031 * </pre> 2032 * 2033 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2034 */ addRules(com.google.cloud.compute.v1.Rule.Builder builderForValue)2035 public Builder addRules(com.google.cloud.compute.v1.Rule.Builder builderForValue) { 2036 if (rulesBuilder_ == null) { 2037 ensureRulesIsMutable(); 2038 rules_.add(builderForValue.build()); 2039 onChanged(); 2040 } else { 2041 rulesBuilder_.addMessage(builderForValue.build()); 2042 } 2043 return this; 2044 } 2045 /** 2046 * 2047 * 2048 * <pre> 2049 * This is deprecated and has no effect. Do not use. 2050 * </pre> 2051 * 2052 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2053 */ addRules(int index, com.google.cloud.compute.v1.Rule.Builder builderForValue)2054 public Builder addRules(int index, com.google.cloud.compute.v1.Rule.Builder builderForValue) { 2055 if (rulesBuilder_ == null) { 2056 ensureRulesIsMutable(); 2057 rules_.add(index, builderForValue.build()); 2058 onChanged(); 2059 } else { 2060 rulesBuilder_.addMessage(index, builderForValue.build()); 2061 } 2062 return this; 2063 } 2064 /** 2065 * 2066 * 2067 * <pre> 2068 * This is deprecated and has no effect. Do not use. 2069 * </pre> 2070 * 2071 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2072 */ addAllRules( java.lang.Iterable<? extends com.google.cloud.compute.v1.Rule> values)2073 public Builder addAllRules( 2074 java.lang.Iterable<? extends com.google.cloud.compute.v1.Rule> values) { 2075 if (rulesBuilder_ == null) { 2076 ensureRulesIsMutable(); 2077 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); 2078 onChanged(); 2079 } else { 2080 rulesBuilder_.addAllMessages(values); 2081 } 2082 return this; 2083 } 2084 /** 2085 * 2086 * 2087 * <pre> 2088 * This is deprecated and has no effect. Do not use. 2089 * </pre> 2090 * 2091 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2092 */ clearRules()2093 public Builder clearRules() { 2094 if (rulesBuilder_ == null) { 2095 rules_ = java.util.Collections.emptyList(); 2096 bitField0_ = (bitField0_ & ~0x00000010); 2097 onChanged(); 2098 } else { 2099 rulesBuilder_.clear(); 2100 } 2101 return this; 2102 } 2103 /** 2104 * 2105 * 2106 * <pre> 2107 * This is deprecated and has no effect. Do not use. 2108 * </pre> 2109 * 2110 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2111 */ removeRules(int index)2112 public Builder removeRules(int index) { 2113 if (rulesBuilder_ == null) { 2114 ensureRulesIsMutable(); 2115 rules_.remove(index); 2116 onChanged(); 2117 } else { 2118 rulesBuilder_.remove(index); 2119 } 2120 return this; 2121 } 2122 /** 2123 * 2124 * 2125 * <pre> 2126 * This is deprecated and has no effect. Do not use. 2127 * </pre> 2128 * 2129 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2130 */ getRulesBuilder(int index)2131 public com.google.cloud.compute.v1.Rule.Builder getRulesBuilder(int index) { 2132 return getRulesFieldBuilder().getBuilder(index); 2133 } 2134 /** 2135 * 2136 * 2137 * <pre> 2138 * This is deprecated and has no effect. Do not use. 2139 * </pre> 2140 * 2141 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2142 */ getRulesOrBuilder(int index)2143 public com.google.cloud.compute.v1.RuleOrBuilder getRulesOrBuilder(int index) { 2144 if (rulesBuilder_ == null) { 2145 return rules_.get(index); 2146 } else { 2147 return rulesBuilder_.getMessageOrBuilder(index); 2148 } 2149 } 2150 /** 2151 * 2152 * 2153 * <pre> 2154 * This is deprecated and has no effect. Do not use. 2155 * </pre> 2156 * 2157 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2158 */ 2159 public java.util.List<? extends com.google.cloud.compute.v1.RuleOrBuilder> getRulesOrBuilderList()2160 getRulesOrBuilderList() { 2161 if (rulesBuilder_ != null) { 2162 return rulesBuilder_.getMessageOrBuilderList(); 2163 } else { 2164 return java.util.Collections.unmodifiableList(rules_); 2165 } 2166 } 2167 /** 2168 * 2169 * 2170 * <pre> 2171 * This is deprecated and has no effect. Do not use. 2172 * </pre> 2173 * 2174 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2175 */ addRulesBuilder()2176 public com.google.cloud.compute.v1.Rule.Builder addRulesBuilder() { 2177 return getRulesFieldBuilder() 2178 .addBuilder(com.google.cloud.compute.v1.Rule.getDefaultInstance()); 2179 } 2180 /** 2181 * 2182 * 2183 * <pre> 2184 * This is deprecated and has no effect. Do not use. 2185 * </pre> 2186 * 2187 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2188 */ addRulesBuilder(int index)2189 public com.google.cloud.compute.v1.Rule.Builder addRulesBuilder(int index) { 2190 return getRulesFieldBuilder() 2191 .addBuilder(index, com.google.cloud.compute.v1.Rule.getDefaultInstance()); 2192 } 2193 /** 2194 * 2195 * 2196 * <pre> 2197 * This is deprecated and has no effect. Do not use. 2198 * </pre> 2199 * 2200 * <code>repeated .google.cloud.compute.v1.Rule rules = 108873975;</code> 2201 */ getRulesBuilderList()2202 public java.util.List<com.google.cloud.compute.v1.Rule.Builder> getRulesBuilderList() { 2203 return getRulesFieldBuilder().getBuilderList(); 2204 } 2205 2206 private com.google.protobuf.RepeatedFieldBuilderV3< 2207 com.google.cloud.compute.v1.Rule, 2208 com.google.cloud.compute.v1.Rule.Builder, 2209 com.google.cloud.compute.v1.RuleOrBuilder> getRulesFieldBuilder()2210 getRulesFieldBuilder() { 2211 if (rulesBuilder_ == null) { 2212 rulesBuilder_ = 2213 new com.google.protobuf.RepeatedFieldBuilderV3< 2214 com.google.cloud.compute.v1.Rule, 2215 com.google.cloud.compute.v1.Rule.Builder, 2216 com.google.cloud.compute.v1.RuleOrBuilder>( 2217 rules_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); 2218 rules_ = null; 2219 } 2220 return rulesBuilder_; 2221 } 2222 2223 private int version_; 2224 /** 2225 * 2226 * 2227 * <pre> 2228 * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 2229 * </pre> 2230 * 2231 * <code>optional int32 version = 351608024;</code> 2232 * 2233 * @return Whether the version field is set. 2234 */ 2235 @java.lang.Override hasVersion()2236 public boolean hasVersion() { 2237 return ((bitField0_ & 0x00000020) != 0); 2238 } 2239 /** 2240 * 2241 * 2242 * <pre> 2243 * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 2244 * </pre> 2245 * 2246 * <code>optional int32 version = 351608024;</code> 2247 * 2248 * @return The version. 2249 */ 2250 @java.lang.Override getVersion()2251 public int getVersion() { 2252 return version_; 2253 } 2254 /** 2255 * 2256 * 2257 * <pre> 2258 * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 2259 * </pre> 2260 * 2261 * <code>optional int32 version = 351608024;</code> 2262 * 2263 * @param value The version to set. 2264 * @return This builder for chaining. 2265 */ setVersion(int value)2266 public Builder setVersion(int value) { 2267 2268 version_ = value; 2269 bitField0_ |= 0x00000020; 2270 onChanged(); 2271 return this; 2272 } 2273 /** 2274 * 2275 * 2276 * <pre> 2277 * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 2278 * </pre> 2279 * 2280 * <code>optional int32 version = 351608024;</code> 2281 * 2282 * @return This builder for chaining. 2283 */ clearVersion()2284 public Builder clearVersion() { 2285 bitField0_ = (bitField0_ & ~0x00000020); 2286 version_ = 0; 2287 onChanged(); 2288 return this; 2289 } 2290 2291 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2292 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 2293 return super.setUnknownFields(unknownFields); 2294 } 2295 2296 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2297 public final Builder mergeUnknownFields( 2298 final com.google.protobuf.UnknownFieldSet unknownFields) { 2299 return super.mergeUnknownFields(unknownFields); 2300 } 2301 2302 // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.Policy) 2303 } 2304 2305 // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.Policy) 2306 private static final com.google.cloud.compute.v1.Policy DEFAULT_INSTANCE; 2307 2308 static { 2309 DEFAULT_INSTANCE = new com.google.cloud.compute.v1.Policy(); 2310 } 2311 getDefaultInstance()2312 public static com.google.cloud.compute.v1.Policy getDefaultInstance() { 2313 return DEFAULT_INSTANCE; 2314 } 2315 2316 private static final com.google.protobuf.Parser<Policy> PARSER = 2317 new com.google.protobuf.AbstractParser<Policy>() { 2318 @java.lang.Override 2319 public Policy parsePartialFrom( 2320 com.google.protobuf.CodedInputStream input, 2321 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2322 throws com.google.protobuf.InvalidProtocolBufferException { 2323 Builder builder = newBuilder(); 2324 try { 2325 builder.mergeFrom(input, extensionRegistry); 2326 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2327 throw e.setUnfinishedMessage(builder.buildPartial()); 2328 } catch (com.google.protobuf.UninitializedMessageException e) { 2329 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 2330 } catch (java.io.IOException e) { 2331 throw new com.google.protobuf.InvalidProtocolBufferException(e) 2332 .setUnfinishedMessage(builder.buildPartial()); 2333 } 2334 return builder.buildPartial(); 2335 } 2336 }; 2337 parser()2338 public static com.google.protobuf.Parser<Policy> parser() { 2339 return PARSER; 2340 } 2341 2342 @java.lang.Override getParserForType()2343 public com.google.protobuf.Parser<Policy> getParserForType() { 2344 return PARSER; 2345 } 2346 2347 @java.lang.Override getDefaultInstanceForType()2348 public com.google.cloud.compute.v1.Policy getDefaultInstanceForType() { 2349 return DEFAULT_INSTANCE; 2350 } 2351 } 2352