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