• 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/cloud/orgpolicy/v1/orgpolicy.proto
18 
19 package com.google.cloud.orgpolicy.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Defines a Cloud Organization `Policy` which is used to specify `Constraints`
26  * for configurations of Cloud Platform resources.
27  * </pre>
28  *
29  * Protobuf type {@code google.cloud.orgpolicy.v1.Policy}
30  */
31 public final class Policy extends com.google.protobuf.GeneratedMessageV3
32     implements
33     // @@protoc_insertion_point(message_implements:google.cloud.orgpolicy.v1.Policy)
34     PolicyOrBuilder {
35   private static final long serialVersionUID = 0L;
36   // Use Policy.newBuilder() to construct.
Policy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37   private Policy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
38     super(builder);
39   }
40 
Policy()41   private Policy() {
42     constraint_ = "";
43     etag_ = com.google.protobuf.ByteString.EMPTY;
44   }
45 
46   @java.lang.Override
47   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)48   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
49     return new Policy();
50   }
51 
52   @java.lang.Override
getUnknownFields()53   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
54     return this.unknownFields;
55   }
56 
getDescriptor()57   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
58     return com.google.cloud.orgpolicy.v1.OrgPolicyProto
59         .internal_static_google_cloud_orgpolicy_v1_Policy_descriptor;
60   }
61 
62   @java.lang.Override
63   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()64       internalGetFieldAccessorTable() {
65     return com.google.cloud.orgpolicy.v1.OrgPolicyProto
66         .internal_static_google_cloud_orgpolicy_v1_Policy_fieldAccessorTable
67         .ensureFieldAccessorsInitialized(
68             com.google.cloud.orgpolicy.v1.Policy.class,
69             com.google.cloud.orgpolicy.v1.Policy.Builder.class);
70   }
71 
72   public interface ListPolicyOrBuilder
73       extends
74       // @@protoc_insertion_point(interface_extends:google.cloud.orgpolicy.v1.Policy.ListPolicy)
75       com.google.protobuf.MessageOrBuilder {
76 
77     /**
78      *
79      *
80      * <pre>
81      * List of values allowed  at this resource. Can only be set if `all_values`
82      * is set to `ALL_VALUES_UNSPECIFIED`.
83      * </pre>
84      *
85      * <code>repeated string allowed_values = 1;</code>
86      *
87      * @return A list containing the allowedValues.
88      */
getAllowedValuesList()89     java.util.List<java.lang.String> getAllowedValuesList();
90     /**
91      *
92      *
93      * <pre>
94      * List of values allowed  at this resource. Can only be set if `all_values`
95      * is set to `ALL_VALUES_UNSPECIFIED`.
96      * </pre>
97      *
98      * <code>repeated string allowed_values = 1;</code>
99      *
100      * @return The count of allowedValues.
101      */
getAllowedValuesCount()102     int getAllowedValuesCount();
103     /**
104      *
105      *
106      * <pre>
107      * List of values allowed  at this resource. Can only be set if `all_values`
108      * is set to `ALL_VALUES_UNSPECIFIED`.
109      * </pre>
110      *
111      * <code>repeated string allowed_values = 1;</code>
112      *
113      * @param index The index of the element to return.
114      * @return The allowedValues at the given index.
115      */
getAllowedValues(int index)116     java.lang.String getAllowedValues(int index);
117     /**
118      *
119      *
120      * <pre>
121      * List of values allowed  at this resource. Can only be set if `all_values`
122      * is set to `ALL_VALUES_UNSPECIFIED`.
123      * </pre>
124      *
125      * <code>repeated string allowed_values = 1;</code>
126      *
127      * @param index The index of the value to return.
128      * @return The bytes of the allowedValues at the given index.
129      */
getAllowedValuesBytes(int index)130     com.google.protobuf.ByteString getAllowedValuesBytes(int index);
131 
132     /**
133      *
134      *
135      * <pre>
136      * List of values denied at this resource. Can only be set if `all_values`
137      * is set to `ALL_VALUES_UNSPECIFIED`.
138      * </pre>
139      *
140      * <code>repeated string denied_values = 2;</code>
141      *
142      * @return A list containing the deniedValues.
143      */
getDeniedValuesList()144     java.util.List<java.lang.String> getDeniedValuesList();
145     /**
146      *
147      *
148      * <pre>
149      * List of values denied at this resource. Can only be set if `all_values`
150      * is set to `ALL_VALUES_UNSPECIFIED`.
151      * </pre>
152      *
153      * <code>repeated string denied_values = 2;</code>
154      *
155      * @return The count of deniedValues.
156      */
getDeniedValuesCount()157     int getDeniedValuesCount();
158     /**
159      *
160      *
161      * <pre>
162      * List of values denied at this resource. Can only be set if `all_values`
163      * is set to `ALL_VALUES_UNSPECIFIED`.
164      * </pre>
165      *
166      * <code>repeated string denied_values = 2;</code>
167      *
168      * @param index The index of the element to return.
169      * @return The deniedValues at the given index.
170      */
getDeniedValues(int index)171     java.lang.String getDeniedValues(int index);
172     /**
173      *
174      *
175      * <pre>
176      * List of values denied at this resource. Can only be set if `all_values`
177      * is set to `ALL_VALUES_UNSPECIFIED`.
178      * </pre>
179      *
180      * <code>repeated string denied_values = 2;</code>
181      *
182      * @param index The index of the value to return.
183      * @return The bytes of the deniedValues at the given index.
184      */
getDeniedValuesBytes(int index)185     com.google.protobuf.ByteString getDeniedValuesBytes(int index);
186 
187     /**
188      *
189      *
190      * <pre>
191      * The policy all_values state.
192      * </pre>
193      *
194      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues all_values = 3;</code>
195      *
196      * @return The enum numeric value on the wire for allValues.
197      */
getAllValuesValue()198     int getAllValuesValue();
199     /**
200      *
201      *
202      * <pre>
203      * The policy all_values state.
204      * </pre>
205      *
206      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues all_values = 3;</code>
207      *
208      * @return The allValues.
209      */
getAllValues()210     com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues getAllValues();
211 
212     /**
213      *
214      *
215      * <pre>
216      * Optional. The Google Cloud Console will try to default to a configuration
217      * that matches the value specified in this `Policy`. If `suggested_value`
218      * is not set, it will inherit the value specified higher in the hierarchy,
219      * unless `inherit_from_parent` is `false`.
220      * </pre>
221      *
222      * <code>string suggested_value = 4;</code>
223      *
224      * @return The suggestedValue.
225      */
getSuggestedValue()226     java.lang.String getSuggestedValue();
227     /**
228      *
229      *
230      * <pre>
231      * Optional. The Google Cloud Console will try to default to a configuration
232      * that matches the value specified in this `Policy`. If `suggested_value`
233      * is not set, it will inherit the value specified higher in the hierarchy,
234      * unless `inherit_from_parent` is `false`.
235      * </pre>
236      *
237      * <code>string suggested_value = 4;</code>
238      *
239      * @return The bytes for suggestedValue.
240      */
getSuggestedValueBytes()241     com.google.protobuf.ByteString getSuggestedValueBytes();
242 
243     /**
244      *
245      *
246      * <pre>
247      * Determines the inheritance behavior for this `Policy`.
248      * By default, a `ListPolicy` set at a resource supercedes any `Policy` set
249      * anywhere up the resource hierarchy. However, if `inherit_from_parent` is
250      * set to `true`, then the values from the effective `Policy` of the parent
251      * resource are inherited, meaning the values set in this `Policy` are
252      * added to the values inherited up the hierarchy.
253      * Setting `Policy` hierarchies that inherit both allowed values and denied
254      * values isn't recommended in most circumstances to keep the configuration
255      * simple and understandable. However, it is possible to set a `Policy` with
256      * `allowed_values` set that inherits a `Policy` with `denied_values` set.
257      * In this case, the values that are allowed must be in `allowed_values` and
258      * not present in `denied_values`.
259      * For example, suppose you have a `Constraint`
260      * `constraints/serviceuser.services`, which has a `constraint_type` of
261      * `list_constraint`, and with `constraint_default` set to `ALLOW`.
262      * Suppose that at the Organization level, a `Policy` is applied that
263      * restricts the allowed API activations to {`E1`, `E2`}. Then, if a
264      * `Policy` is applied to a project below the Organization that has
265      * `inherit_from_parent` set to `false` and field all_values set to DENY,
266      * then an attempt to activate any API will be denied.
267      * The following examples demonstrate different possible layerings for
268      * `projects/bar` parented by `organizations/foo`:
269      * Example 1 (no inherited values):
270      *   `organizations/foo` has a `Policy` with values:
271      *     {allowed_values: "E1" allowed_values:"E2"}
272      *   `projects/bar` has `inherit_from_parent` `false` and values:
273      *     {allowed_values: "E3" allowed_values: "E4"}
274      * The accepted values at `organizations/foo` are `E1`, `E2`.
275      * The accepted values at `projects/bar` are `E3`, and `E4`.
276      * Example 2 (inherited values):
277      *   `organizations/foo` has a `Policy` with values:
278      *     {allowed_values: "E1" allowed_values:"E2"}
279      *   `projects/bar` has a `Policy` with values:
280      *     {value: "E3" value: "E4" inherit_from_parent: true}
281      * The accepted values at `organizations/foo` are `E1`, `E2`.
282      * The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`.
283      * Example 3 (inheriting both allowed and denied values):
284      *   `organizations/foo` has a `Policy` with values:
285      *     {allowed_values: "E1" allowed_values: "E2"}
286      *   `projects/bar` has a `Policy` with:
287      *     {denied_values: "E1"}
288      * The accepted values at `organizations/foo` are `E1`, `E2`.
289      * The value accepted at `projects/bar` is `E2`.
290      * Example 4 (RestoreDefault):
291      *   `organizations/foo` has a `Policy` with values:
292      *     {allowed_values: "E1" allowed_values:"E2"}
293      *   `projects/bar` has a `Policy` with values:
294      *     {RestoreDefault: {}}
295      * The accepted values at `organizations/foo` are `E1`, `E2`.
296      * The accepted values at `projects/bar` are either all or none depending on
297      * the value of `constraint_default` (if `ALLOW`, all; if
298      * `DENY`, none).
299      * Example 5 (no policy inherits parent policy):
300      *   `organizations/foo` has no `Policy` set.
301      *   `projects/bar` has no `Policy` set.
302      * The accepted values at both levels are either all or none depending on
303      * the value of `constraint_default` (if `ALLOW`, all; if
304      * `DENY`, none).
305      * Example 6 (ListConstraint allowing all):
306      *   `organizations/foo` has a `Policy` with values:
307      *     {allowed_values: "E1" allowed_values: "E2"}
308      *   `projects/bar` has a `Policy` with:
309      *     {all: ALLOW}
310      * The accepted values at `organizations/foo` are `E1`, E2`.
311      * Any value is accepted at `projects/bar`.
312      * Example 7 (ListConstraint allowing none):
313      *   `organizations/foo` has a `Policy` with values:
314      *     {allowed_values: "E1" allowed_values: "E2"}
315      *   `projects/bar` has a `Policy` with:
316      *     {all: DENY}
317      * The accepted values at `organizations/foo` are `E1`, E2`.
318      * No value is accepted at `projects/bar`.
319      * Example 10 (allowed and denied subtrees of Resource Manager hierarchy):
320      * Given the following resource hierarchy
321      *   O1-&gt;{F1, F2}; F1-&gt;{P1}; F2-&gt;{P2, P3},
322      *   `organizations/foo` has a `Policy` with values:
323      *     {allowed_values: "under:organizations/O1"}
324      *   `projects/bar` has a `Policy` with:
325      *     {allowed_values: "under:projects/P3"}
326      *     {denied_values: "under:folders/F2"}
327      * The accepted values at `organizations/foo` are `organizations/O1`,
328      *   `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`,
329      *   `projects/P3`.
330      * The accepted values at `projects/bar` are `organizations/O1`,
331      *   `folders/F1`, `projects/P1`.
332      * </pre>
333      *
334      * <code>bool inherit_from_parent = 5;</code>
335      *
336      * @return The inheritFromParent.
337      */
getInheritFromParent()338     boolean getInheritFromParent();
339   }
340   /**
341    *
342    *
343    * <pre>
344    * Used in `policy_type` to specify how `list_policy` behaves at this
345    * resource.
346    * `ListPolicy` can define specific values and subtrees of Cloud Resource
347    * Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that
348    * are allowed or denied by setting the `allowed_values` and `denied_values`
349    * fields. This is achieved by using the `under:` and optional `is:` prefixes.
350    * The `under:` prefix is used to denote resource subtree values.
351    * The `is:` prefix is used to denote specific values, and is required only
352    * if the value contains a ":". Values prefixed with "is:" are treated the
353    * same as values with no prefix.
354    * Ancestry subtrees must be in one of the following formats:
355    *     - "projects/&lt;project-id&gt;", e.g. "projects/tokyo-rain-123"
356    *     - "folders/&lt;folder-id&gt;", e.g. "folders/1234"
357    *     - "organizations/&lt;organization-id&gt;", e.g. "organizations/1234"
358    * The `supports_under` field of the associated `Constraint`  defines whether
359    * ancestry prefixes can be used. You can set `allowed_values` and
360    * `denied_values` in the same `Policy` if `all_values` is
361    * `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all
362    * values. If `all_values` is set to either `ALLOW` or `DENY`,
363    * `allowed_values` and `denied_values` must be unset.
364    * </pre>
365    *
366    * Protobuf type {@code google.cloud.orgpolicy.v1.Policy.ListPolicy}
367    */
368   public static final class ListPolicy extends com.google.protobuf.GeneratedMessageV3
369       implements
370       // @@protoc_insertion_point(message_implements:google.cloud.orgpolicy.v1.Policy.ListPolicy)
371       ListPolicyOrBuilder {
372     private static final long serialVersionUID = 0L;
373     // Use ListPolicy.newBuilder() to construct.
ListPolicy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)374     private ListPolicy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
375       super(builder);
376     }
377 
ListPolicy()378     private ListPolicy() {
379       allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
380       deniedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
381       allValues_ = 0;
382       suggestedValue_ = "";
383     }
384 
385     @java.lang.Override
386     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)387     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
388       return new ListPolicy();
389     }
390 
391     @java.lang.Override
getUnknownFields()392     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
393       return this.unknownFields;
394     }
395 
getDescriptor()396     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
397       return com.google.cloud.orgpolicy.v1.OrgPolicyProto
398           .internal_static_google_cloud_orgpolicy_v1_Policy_ListPolicy_descriptor;
399     }
400 
401     @java.lang.Override
402     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()403         internalGetFieldAccessorTable() {
404       return com.google.cloud.orgpolicy.v1.OrgPolicyProto
405           .internal_static_google_cloud_orgpolicy_v1_Policy_ListPolicy_fieldAccessorTable
406           .ensureFieldAccessorsInitialized(
407               com.google.cloud.orgpolicy.v1.Policy.ListPolicy.class,
408               com.google.cloud.orgpolicy.v1.Policy.ListPolicy.Builder.class);
409     }
410 
411     /**
412      *
413      *
414      * <pre>
415      * This enum can be used to set `Policies` that apply to all possible
416      * configuration values rather than specific values in `allowed_values` or
417      * `denied_values`.
418      * Settting this to `ALLOW` will mean this `Policy` allows all values.
419      * Similarly, setting it to `DENY` will mean no values are allowed. If
420      * set to either `ALLOW` or `DENY,  `allowed_values` and `denied_values`
421      * must be unset. Setting this to `ALL_VALUES_UNSPECIFIED` allows for
422      * setting `allowed_values` and `denied_values`.
423      * </pre>
424      *
425      * Protobuf enum {@code google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues}
426      */
427     public enum AllValues implements com.google.protobuf.ProtocolMessageEnum {
428       /**
429        *
430        *
431        * <pre>
432        * Indicates that allowed_values or denied_values must be set.
433        * </pre>
434        *
435        * <code>ALL_VALUES_UNSPECIFIED = 0;</code>
436        */
437       ALL_VALUES_UNSPECIFIED(0),
438       /**
439        *
440        *
441        * <pre>
442        * A policy with this set allows all values.
443        * </pre>
444        *
445        * <code>ALLOW = 1;</code>
446        */
447       ALLOW(1),
448       /**
449        *
450        *
451        * <pre>
452        * A policy with this set denies all values.
453        * </pre>
454        *
455        * <code>DENY = 2;</code>
456        */
457       DENY(2),
458       UNRECOGNIZED(-1),
459       ;
460 
461       /**
462        *
463        *
464        * <pre>
465        * Indicates that allowed_values or denied_values must be set.
466        * </pre>
467        *
468        * <code>ALL_VALUES_UNSPECIFIED = 0;</code>
469        */
470       public static final int ALL_VALUES_UNSPECIFIED_VALUE = 0;
471       /**
472        *
473        *
474        * <pre>
475        * A policy with this set allows all values.
476        * </pre>
477        *
478        * <code>ALLOW = 1;</code>
479        */
480       public static final int ALLOW_VALUE = 1;
481       /**
482        *
483        *
484        * <pre>
485        * A policy with this set denies all values.
486        * </pre>
487        *
488        * <code>DENY = 2;</code>
489        */
490       public static final int DENY_VALUE = 2;
491 
getNumber()492       public final int getNumber() {
493         if (this == UNRECOGNIZED) {
494           throw new java.lang.IllegalArgumentException(
495               "Can't get the number of an unknown enum value.");
496         }
497         return value;
498       }
499 
500       /**
501        * @param value The numeric wire value of the corresponding enum entry.
502        * @return The enum associated with the given numeric wire value.
503        * @deprecated Use {@link #forNumber(int)} instead.
504        */
505       @java.lang.Deprecated
valueOf(int value)506       public static AllValues valueOf(int value) {
507         return forNumber(value);
508       }
509 
510       /**
511        * @param value The numeric wire value of the corresponding enum entry.
512        * @return The enum associated with the given numeric wire value.
513        */
forNumber(int value)514       public static AllValues forNumber(int value) {
515         switch (value) {
516           case 0:
517             return ALL_VALUES_UNSPECIFIED;
518           case 1:
519             return ALLOW;
520           case 2:
521             return DENY;
522           default:
523             return null;
524         }
525       }
526 
internalGetValueMap()527       public static com.google.protobuf.Internal.EnumLiteMap<AllValues> internalGetValueMap() {
528         return internalValueMap;
529       }
530 
531       private static final com.google.protobuf.Internal.EnumLiteMap<AllValues> internalValueMap =
532           new com.google.protobuf.Internal.EnumLiteMap<AllValues>() {
533             public AllValues findValueByNumber(int number) {
534               return AllValues.forNumber(number);
535             }
536           };
537 
getValueDescriptor()538       public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
539         if (this == UNRECOGNIZED) {
540           throw new java.lang.IllegalStateException(
541               "Can't get the descriptor of an unrecognized enum value.");
542         }
543         return getDescriptor().getValues().get(ordinal());
544       }
545 
getDescriptorForType()546       public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
547         return getDescriptor();
548       }
549 
getDescriptor()550       public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
551         return com.google.cloud.orgpolicy.v1.Policy.ListPolicy.getDescriptor()
552             .getEnumTypes()
553             .get(0);
554       }
555 
556       private static final AllValues[] VALUES = values();
557 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)558       public static AllValues valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
559         if (desc.getType() != getDescriptor()) {
560           throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
561         }
562         if (desc.getIndex() == -1) {
563           return UNRECOGNIZED;
564         }
565         return VALUES[desc.getIndex()];
566       }
567 
568       private final int value;
569 
AllValues(int value)570       private AllValues(int value) {
571         this.value = value;
572       }
573 
574       // @@protoc_insertion_point(enum_scope:google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues)
575     }
576 
577     public static final int ALLOWED_VALUES_FIELD_NUMBER = 1;
578 
579     @SuppressWarnings("serial")
580     private com.google.protobuf.LazyStringList allowedValues_;
581     /**
582      *
583      *
584      * <pre>
585      * List of values allowed  at this resource. Can only be set if `all_values`
586      * is set to `ALL_VALUES_UNSPECIFIED`.
587      * </pre>
588      *
589      * <code>repeated string allowed_values = 1;</code>
590      *
591      * @return A list containing the allowedValues.
592      */
getAllowedValuesList()593     public com.google.protobuf.ProtocolStringList getAllowedValuesList() {
594       return allowedValues_;
595     }
596     /**
597      *
598      *
599      * <pre>
600      * List of values allowed  at this resource. Can only be set if `all_values`
601      * is set to `ALL_VALUES_UNSPECIFIED`.
602      * </pre>
603      *
604      * <code>repeated string allowed_values = 1;</code>
605      *
606      * @return The count of allowedValues.
607      */
getAllowedValuesCount()608     public int getAllowedValuesCount() {
609       return allowedValues_.size();
610     }
611     /**
612      *
613      *
614      * <pre>
615      * List of values allowed  at this resource. Can only be set if `all_values`
616      * is set to `ALL_VALUES_UNSPECIFIED`.
617      * </pre>
618      *
619      * <code>repeated string allowed_values = 1;</code>
620      *
621      * @param index The index of the element to return.
622      * @return The allowedValues at the given index.
623      */
getAllowedValues(int index)624     public java.lang.String getAllowedValues(int index) {
625       return allowedValues_.get(index);
626     }
627     /**
628      *
629      *
630      * <pre>
631      * List of values allowed  at this resource. Can only be set if `all_values`
632      * is set to `ALL_VALUES_UNSPECIFIED`.
633      * </pre>
634      *
635      * <code>repeated string allowed_values = 1;</code>
636      *
637      * @param index The index of the value to return.
638      * @return The bytes of the allowedValues at the given index.
639      */
getAllowedValuesBytes(int index)640     public com.google.protobuf.ByteString getAllowedValuesBytes(int index) {
641       return allowedValues_.getByteString(index);
642     }
643 
644     public static final int DENIED_VALUES_FIELD_NUMBER = 2;
645 
646     @SuppressWarnings("serial")
647     private com.google.protobuf.LazyStringList deniedValues_;
648     /**
649      *
650      *
651      * <pre>
652      * List of values denied at this resource. Can only be set if `all_values`
653      * is set to `ALL_VALUES_UNSPECIFIED`.
654      * </pre>
655      *
656      * <code>repeated string denied_values = 2;</code>
657      *
658      * @return A list containing the deniedValues.
659      */
getDeniedValuesList()660     public com.google.protobuf.ProtocolStringList getDeniedValuesList() {
661       return deniedValues_;
662     }
663     /**
664      *
665      *
666      * <pre>
667      * List of values denied at this resource. Can only be set if `all_values`
668      * is set to `ALL_VALUES_UNSPECIFIED`.
669      * </pre>
670      *
671      * <code>repeated string denied_values = 2;</code>
672      *
673      * @return The count of deniedValues.
674      */
getDeniedValuesCount()675     public int getDeniedValuesCount() {
676       return deniedValues_.size();
677     }
678     /**
679      *
680      *
681      * <pre>
682      * List of values denied at this resource. Can only be set if `all_values`
683      * is set to `ALL_VALUES_UNSPECIFIED`.
684      * </pre>
685      *
686      * <code>repeated string denied_values = 2;</code>
687      *
688      * @param index The index of the element to return.
689      * @return The deniedValues at the given index.
690      */
getDeniedValues(int index)691     public java.lang.String getDeniedValues(int index) {
692       return deniedValues_.get(index);
693     }
694     /**
695      *
696      *
697      * <pre>
698      * List of values denied at this resource. Can only be set if `all_values`
699      * is set to `ALL_VALUES_UNSPECIFIED`.
700      * </pre>
701      *
702      * <code>repeated string denied_values = 2;</code>
703      *
704      * @param index The index of the value to return.
705      * @return The bytes of the deniedValues at the given index.
706      */
getDeniedValuesBytes(int index)707     public com.google.protobuf.ByteString getDeniedValuesBytes(int index) {
708       return deniedValues_.getByteString(index);
709     }
710 
711     public static final int ALL_VALUES_FIELD_NUMBER = 3;
712     private int allValues_ = 0;
713     /**
714      *
715      *
716      * <pre>
717      * The policy all_values state.
718      * </pre>
719      *
720      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues all_values = 3;</code>
721      *
722      * @return The enum numeric value on the wire for allValues.
723      */
724     @java.lang.Override
getAllValuesValue()725     public int getAllValuesValue() {
726       return allValues_;
727     }
728     /**
729      *
730      *
731      * <pre>
732      * The policy all_values state.
733      * </pre>
734      *
735      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues all_values = 3;</code>
736      *
737      * @return The allValues.
738      */
739     @java.lang.Override
getAllValues()740     public com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues getAllValues() {
741       com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues result =
742           com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues.forNumber(allValues_);
743       return result == null
744           ? com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues.UNRECOGNIZED
745           : result;
746     }
747 
748     public static final int SUGGESTED_VALUE_FIELD_NUMBER = 4;
749 
750     @SuppressWarnings("serial")
751     private volatile java.lang.Object suggestedValue_ = "";
752     /**
753      *
754      *
755      * <pre>
756      * Optional. The Google Cloud Console will try to default to a configuration
757      * that matches the value specified in this `Policy`. If `suggested_value`
758      * is not set, it will inherit the value specified higher in the hierarchy,
759      * unless `inherit_from_parent` is `false`.
760      * </pre>
761      *
762      * <code>string suggested_value = 4;</code>
763      *
764      * @return The suggestedValue.
765      */
766     @java.lang.Override
getSuggestedValue()767     public java.lang.String getSuggestedValue() {
768       java.lang.Object ref = suggestedValue_;
769       if (ref instanceof java.lang.String) {
770         return (java.lang.String) ref;
771       } else {
772         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
773         java.lang.String s = bs.toStringUtf8();
774         suggestedValue_ = s;
775         return s;
776       }
777     }
778     /**
779      *
780      *
781      * <pre>
782      * Optional. The Google Cloud Console will try to default to a configuration
783      * that matches the value specified in this `Policy`. If `suggested_value`
784      * is not set, it will inherit the value specified higher in the hierarchy,
785      * unless `inherit_from_parent` is `false`.
786      * </pre>
787      *
788      * <code>string suggested_value = 4;</code>
789      *
790      * @return The bytes for suggestedValue.
791      */
792     @java.lang.Override
getSuggestedValueBytes()793     public com.google.protobuf.ByteString getSuggestedValueBytes() {
794       java.lang.Object ref = suggestedValue_;
795       if (ref instanceof java.lang.String) {
796         com.google.protobuf.ByteString b =
797             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
798         suggestedValue_ = b;
799         return b;
800       } else {
801         return (com.google.protobuf.ByteString) ref;
802       }
803     }
804 
805     public static final int INHERIT_FROM_PARENT_FIELD_NUMBER = 5;
806     private boolean inheritFromParent_ = false;
807     /**
808      *
809      *
810      * <pre>
811      * Determines the inheritance behavior for this `Policy`.
812      * By default, a `ListPolicy` set at a resource supercedes any `Policy` set
813      * anywhere up the resource hierarchy. However, if `inherit_from_parent` is
814      * set to `true`, then the values from the effective `Policy` of the parent
815      * resource are inherited, meaning the values set in this `Policy` are
816      * added to the values inherited up the hierarchy.
817      * Setting `Policy` hierarchies that inherit both allowed values and denied
818      * values isn't recommended in most circumstances to keep the configuration
819      * simple and understandable. However, it is possible to set a `Policy` with
820      * `allowed_values` set that inherits a `Policy` with `denied_values` set.
821      * In this case, the values that are allowed must be in `allowed_values` and
822      * not present in `denied_values`.
823      * For example, suppose you have a `Constraint`
824      * `constraints/serviceuser.services`, which has a `constraint_type` of
825      * `list_constraint`, and with `constraint_default` set to `ALLOW`.
826      * Suppose that at the Organization level, a `Policy` is applied that
827      * restricts the allowed API activations to {`E1`, `E2`}. Then, if a
828      * `Policy` is applied to a project below the Organization that has
829      * `inherit_from_parent` set to `false` and field all_values set to DENY,
830      * then an attempt to activate any API will be denied.
831      * The following examples demonstrate different possible layerings for
832      * `projects/bar` parented by `organizations/foo`:
833      * Example 1 (no inherited values):
834      *   `organizations/foo` has a `Policy` with values:
835      *     {allowed_values: "E1" allowed_values:"E2"}
836      *   `projects/bar` has `inherit_from_parent` `false` and values:
837      *     {allowed_values: "E3" allowed_values: "E4"}
838      * The accepted values at `organizations/foo` are `E1`, `E2`.
839      * The accepted values at `projects/bar` are `E3`, and `E4`.
840      * Example 2 (inherited values):
841      *   `organizations/foo` has a `Policy` with values:
842      *     {allowed_values: "E1" allowed_values:"E2"}
843      *   `projects/bar` has a `Policy` with values:
844      *     {value: "E3" value: "E4" inherit_from_parent: true}
845      * The accepted values at `organizations/foo` are `E1`, `E2`.
846      * The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`.
847      * Example 3 (inheriting both allowed and denied values):
848      *   `organizations/foo` has a `Policy` with values:
849      *     {allowed_values: "E1" allowed_values: "E2"}
850      *   `projects/bar` has a `Policy` with:
851      *     {denied_values: "E1"}
852      * The accepted values at `organizations/foo` are `E1`, `E2`.
853      * The value accepted at `projects/bar` is `E2`.
854      * Example 4 (RestoreDefault):
855      *   `organizations/foo` has a `Policy` with values:
856      *     {allowed_values: "E1" allowed_values:"E2"}
857      *   `projects/bar` has a `Policy` with values:
858      *     {RestoreDefault: {}}
859      * The accepted values at `organizations/foo` are `E1`, `E2`.
860      * The accepted values at `projects/bar` are either all or none depending on
861      * the value of `constraint_default` (if `ALLOW`, all; if
862      * `DENY`, none).
863      * Example 5 (no policy inherits parent policy):
864      *   `organizations/foo` has no `Policy` set.
865      *   `projects/bar` has no `Policy` set.
866      * The accepted values at both levels are either all or none depending on
867      * the value of `constraint_default` (if `ALLOW`, all; if
868      * `DENY`, none).
869      * Example 6 (ListConstraint allowing all):
870      *   `organizations/foo` has a `Policy` with values:
871      *     {allowed_values: "E1" allowed_values: "E2"}
872      *   `projects/bar` has a `Policy` with:
873      *     {all: ALLOW}
874      * The accepted values at `organizations/foo` are `E1`, E2`.
875      * Any value is accepted at `projects/bar`.
876      * Example 7 (ListConstraint allowing none):
877      *   `organizations/foo` has a `Policy` with values:
878      *     {allowed_values: "E1" allowed_values: "E2"}
879      *   `projects/bar` has a `Policy` with:
880      *     {all: DENY}
881      * The accepted values at `organizations/foo` are `E1`, E2`.
882      * No value is accepted at `projects/bar`.
883      * Example 10 (allowed and denied subtrees of Resource Manager hierarchy):
884      * Given the following resource hierarchy
885      *   O1-&gt;{F1, F2}; F1-&gt;{P1}; F2-&gt;{P2, P3},
886      *   `organizations/foo` has a `Policy` with values:
887      *     {allowed_values: "under:organizations/O1"}
888      *   `projects/bar` has a `Policy` with:
889      *     {allowed_values: "under:projects/P3"}
890      *     {denied_values: "under:folders/F2"}
891      * The accepted values at `organizations/foo` are `organizations/O1`,
892      *   `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`,
893      *   `projects/P3`.
894      * The accepted values at `projects/bar` are `organizations/O1`,
895      *   `folders/F1`, `projects/P1`.
896      * </pre>
897      *
898      * <code>bool inherit_from_parent = 5;</code>
899      *
900      * @return The inheritFromParent.
901      */
902     @java.lang.Override
getInheritFromParent()903     public boolean getInheritFromParent() {
904       return inheritFromParent_;
905     }
906 
907     private byte memoizedIsInitialized = -1;
908 
909     @java.lang.Override
isInitialized()910     public final boolean isInitialized() {
911       byte isInitialized = memoizedIsInitialized;
912       if (isInitialized == 1) return true;
913       if (isInitialized == 0) return false;
914 
915       memoizedIsInitialized = 1;
916       return true;
917     }
918 
919     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)920     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
921       for (int i = 0; i < allowedValues_.size(); i++) {
922         com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedValues_.getRaw(i));
923       }
924       for (int i = 0; i < deniedValues_.size(); i++) {
925         com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deniedValues_.getRaw(i));
926       }
927       if (allValues_
928           != com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues.ALL_VALUES_UNSPECIFIED
929               .getNumber()) {
930         output.writeEnum(3, allValues_);
931       }
932       if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(suggestedValue_)) {
933         com.google.protobuf.GeneratedMessageV3.writeString(output, 4, suggestedValue_);
934       }
935       if (inheritFromParent_ != false) {
936         output.writeBool(5, inheritFromParent_);
937       }
938       getUnknownFields().writeTo(output);
939     }
940 
941     @java.lang.Override
getSerializedSize()942     public int getSerializedSize() {
943       int size = memoizedSize;
944       if (size != -1) return size;
945 
946       size = 0;
947       {
948         int dataSize = 0;
949         for (int i = 0; i < allowedValues_.size(); i++) {
950           dataSize += computeStringSizeNoTag(allowedValues_.getRaw(i));
951         }
952         size += dataSize;
953         size += 1 * getAllowedValuesList().size();
954       }
955       {
956         int dataSize = 0;
957         for (int i = 0; i < deniedValues_.size(); i++) {
958           dataSize += computeStringSizeNoTag(deniedValues_.getRaw(i));
959         }
960         size += dataSize;
961         size += 1 * getDeniedValuesList().size();
962       }
963       if (allValues_
964           != com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues.ALL_VALUES_UNSPECIFIED
965               .getNumber()) {
966         size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, allValues_);
967       }
968       if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(suggestedValue_)) {
969         size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, suggestedValue_);
970       }
971       if (inheritFromParent_ != false) {
972         size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, inheritFromParent_);
973       }
974       size += getUnknownFields().getSerializedSize();
975       memoizedSize = size;
976       return size;
977     }
978 
979     @java.lang.Override
equals(final java.lang.Object obj)980     public boolean equals(final java.lang.Object obj) {
981       if (obj == this) {
982         return true;
983       }
984       if (!(obj instanceof com.google.cloud.orgpolicy.v1.Policy.ListPolicy)) {
985         return super.equals(obj);
986       }
987       com.google.cloud.orgpolicy.v1.Policy.ListPolicy other =
988           (com.google.cloud.orgpolicy.v1.Policy.ListPolicy) obj;
989 
990       if (!getAllowedValuesList().equals(other.getAllowedValuesList())) return false;
991       if (!getDeniedValuesList().equals(other.getDeniedValuesList())) return false;
992       if (allValues_ != other.allValues_) return false;
993       if (!getSuggestedValue().equals(other.getSuggestedValue())) return false;
994       if (getInheritFromParent() != other.getInheritFromParent()) return false;
995       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
996       return true;
997     }
998 
999     @java.lang.Override
hashCode()1000     public int hashCode() {
1001       if (memoizedHashCode != 0) {
1002         return memoizedHashCode;
1003       }
1004       int hash = 41;
1005       hash = (19 * hash) + getDescriptor().hashCode();
1006       if (getAllowedValuesCount() > 0) {
1007         hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER;
1008         hash = (53 * hash) + getAllowedValuesList().hashCode();
1009       }
1010       if (getDeniedValuesCount() > 0) {
1011         hash = (37 * hash) + DENIED_VALUES_FIELD_NUMBER;
1012         hash = (53 * hash) + getDeniedValuesList().hashCode();
1013       }
1014       hash = (37 * hash) + ALL_VALUES_FIELD_NUMBER;
1015       hash = (53 * hash) + allValues_;
1016       hash = (37 * hash) + SUGGESTED_VALUE_FIELD_NUMBER;
1017       hash = (53 * hash) + getSuggestedValue().hashCode();
1018       hash = (37 * hash) + INHERIT_FROM_PARENT_FIELD_NUMBER;
1019       hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInheritFromParent());
1020       hash = (29 * hash) + getUnknownFields().hashCode();
1021       memoizedHashCode = hash;
1022       return hash;
1023     }
1024 
parseFrom( java.nio.ByteBuffer data)1025     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseFrom(
1026         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
1027       return PARSER.parseFrom(data);
1028     }
1029 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1030     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseFrom(
1031         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1032         throws com.google.protobuf.InvalidProtocolBufferException {
1033       return PARSER.parseFrom(data, extensionRegistry);
1034     }
1035 
parseFrom( com.google.protobuf.ByteString data)1036     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseFrom(
1037         com.google.protobuf.ByteString data)
1038         throws com.google.protobuf.InvalidProtocolBufferException {
1039       return PARSER.parseFrom(data);
1040     }
1041 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1042     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseFrom(
1043         com.google.protobuf.ByteString data,
1044         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1045         throws com.google.protobuf.InvalidProtocolBufferException {
1046       return PARSER.parseFrom(data, extensionRegistry);
1047     }
1048 
parseFrom(byte[] data)1049     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseFrom(byte[] data)
1050         throws com.google.protobuf.InvalidProtocolBufferException {
1051       return PARSER.parseFrom(data);
1052     }
1053 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1054     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseFrom(
1055         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1056         throws com.google.protobuf.InvalidProtocolBufferException {
1057       return PARSER.parseFrom(data, extensionRegistry);
1058     }
1059 
parseFrom( java.io.InputStream input)1060     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseFrom(
1061         java.io.InputStream input) throws java.io.IOException {
1062       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
1063     }
1064 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1065     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseFrom(
1066         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1067         throws java.io.IOException {
1068       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
1069           PARSER, input, extensionRegistry);
1070     }
1071 
parseDelimitedFrom( java.io.InputStream input)1072     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseDelimitedFrom(
1073         java.io.InputStream input) throws java.io.IOException {
1074       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
1075     }
1076 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1077     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseDelimitedFrom(
1078         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1079         throws java.io.IOException {
1080       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
1081           PARSER, input, extensionRegistry);
1082     }
1083 
parseFrom( com.google.protobuf.CodedInputStream input)1084     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseFrom(
1085         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
1086       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
1087     }
1088 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1089     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy parseFrom(
1090         com.google.protobuf.CodedInputStream input,
1091         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1092         throws java.io.IOException {
1093       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
1094           PARSER, input, extensionRegistry);
1095     }
1096 
1097     @java.lang.Override
newBuilderForType()1098     public Builder newBuilderForType() {
1099       return newBuilder();
1100     }
1101 
newBuilder()1102     public static Builder newBuilder() {
1103       return DEFAULT_INSTANCE.toBuilder();
1104     }
1105 
newBuilder(com.google.cloud.orgpolicy.v1.Policy.ListPolicy prototype)1106     public static Builder newBuilder(com.google.cloud.orgpolicy.v1.Policy.ListPolicy prototype) {
1107       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
1108     }
1109 
1110     @java.lang.Override
toBuilder()1111     public Builder toBuilder() {
1112       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
1113     }
1114 
1115     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1116     protected Builder newBuilderForType(
1117         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1118       Builder builder = new Builder(parent);
1119       return builder;
1120     }
1121     /**
1122      *
1123      *
1124      * <pre>
1125      * Used in `policy_type` to specify how `list_policy` behaves at this
1126      * resource.
1127      * `ListPolicy` can define specific values and subtrees of Cloud Resource
1128      * Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that
1129      * are allowed or denied by setting the `allowed_values` and `denied_values`
1130      * fields. This is achieved by using the `under:` and optional `is:` prefixes.
1131      * The `under:` prefix is used to denote resource subtree values.
1132      * The `is:` prefix is used to denote specific values, and is required only
1133      * if the value contains a ":". Values prefixed with "is:" are treated the
1134      * same as values with no prefix.
1135      * Ancestry subtrees must be in one of the following formats:
1136      *     - "projects/&lt;project-id&gt;", e.g. "projects/tokyo-rain-123"
1137      *     - "folders/&lt;folder-id&gt;", e.g. "folders/1234"
1138      *     - "organizations/&lt;organization-id&gt;", e.g. "organizations/1234"
1139      * The `supports_under` field of the associated `Constraint`  defines whether
1140      * ancestry prefixes can be used. You can set `allowed_values` and
1141      * `denied_values` in the same `Policy` if `all_values` is
1142      * `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all
1143      * values. If `all_values` is set to either `ALLOW` or `DENY`,
1144      * `allowed_values` and `denied_values` must be unset.
1145      * </pre>
1146      *
1147      * Protobuf type {@code google.cloud.orgpolicy.v1.Policy.ListPolicy}
1148      */
1149     public static final class Builder
1150         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
1151         implements
1152         // @@protoc_insertion_point(builder_implements:google.cloud.orgpolicy.v1.Policy.ListPolicy)
1153         com.google.cloud.orgpolicy.v1.Policy.ListPolicyOrBuilder {
getDescriptor()1154       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
1155         return com.google.cloud.orgpolicy.v1.OrgPolicyProto
1156             .internal_static_google_cloud_orgpolicy_v1_Policy_ListPolicy_descriptor;
1157       }
1158 
1159       @java.lang.Override
1160       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()1161           internalGetFieldAccessorTable() {
1162         return com.google.cloud.orgpolicy.v1.OrgPolicyProto
1163             .internal_static_google_cloud_orgpolicy_v1_Policy_ListPolicy_fieldAccessorTable
1164             .ensureFieldAccessorsInitialized(
1165                 com.google.cloud.orgpolicy.v1.Policy.ListPolicy.class,
1166                 com.google.cloud.orgpolicy.v1.Policy.ListPolicy.Builder.class);
1167       }
1168 
1169       // Construct using com.google.cloud.orgpolicy.v1.Policy.ListPolicy.newBuilder()
Builder()1170       private Builder() {}
1171 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1172       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1173         super(parent);
1174       }
1175 
1176       @java.lang.Override
clear()1177       public Builder clear() {
1178         super.clear();
1179         bitField0_ = 0;
1180         allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1181         bitField0_ = (bitField0_ & ~0x00000001);
1182         deniedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1183         bitField0_ = (bitField0_ & ~0x00000002);
1184         allValues_ = 0;
1185         suggestedValue_ = "";
1186         inheritFromParent_ = false;
1187         return this;
1188       }
1189 
1190       @java.lang.Override
getDescriptorForType()1191       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
1192         return com.google.cloud.orgpolicy.v1.OrgPolicyProto
1193             .internal_static_google_cloud_orgpolicy_v1_Policy_ListPolicy_descriptor;
1194       }
1195 
1196       @java.lang.Override
getDefaultInstanceForType()1197       public com.google.cloud.orgpolicy.v1.Policy.ListPolicy getDefaultInstanceForType() {
1198         return com.google.cloud.orgpolicy.v1.Policy.ListPolicy.getDefaultInstance();
1199       }
1200 
1201       @java.lang.Override
build()1202       public com.google.cloud.orgpolicy.v1.Policy.ListPolicy build() {
1203         com.google.cloud.orgpolicy.v1.Policy.ListPolicy result = buildPartial();
1204         if (!result.isInitialized()) {
1205           throw newUninitializedMessageException(result);
1206         }
1207         return result;
1208       }
1209 
1210       @java.lang.Override
buildPartial()1211       public com.google.cloud.orgpolicy.v1.Policy.ListPolicy buildPartial() {
1212         com.google.cloud.orgpolicy.v1.Policy.ListPolicy result =
1213             new com.google.cloud.orgpolicy.v1.Policy.ListPolicy(this);
1214         buildPartialRepeatedFields(result);
1215         if (bitField0_ != 0) {
1216           buildPartial0(result);
1217         }
1218         onBuilt();
1219         return result;
1220       }
1221 
buildPartialRepeatedFields( com.google.cloud.orgpolicy.v1.Policy.ListPolicy result)1222       private void buildPartialRepeatedFields(
1223           com.google.cloud.orgpolicy.v1.Policy.ListPolicy result) {
1224         if (((bitField0_ & 0x00000001) != 0)) {
1225           allowedValues_ = allowedValues_.getUnmodifiableView();
1226           bitField0_ = (bitField0_ & ~0x00000001);
1227         }
1228         result.allowedValues_ = allowedValues_;
1229         if (((bitField0_ & 0x00000002) != 0)) {
1230           deniedValues_ = deniedValues_.getUnmodifiableView();
1231           bitField0_ = (bitField0_ & ~0x00000002);
1232         }
1233         result.deniedValues_ = deniedValues_;
1234       }
1235 
buildPartial0(com.google.cloud.orgpolicy.v1.Policy.ListPolicy result)1236       private void buildPartial0(com.google.cloud.orgpolicy.v1.Policy.ListPolicy result) {
1237         int from_bitField0_ = bitField0_;
1238         if (((from_bitField0_ & 0x00000004) != 0)) {
1239           result.allValues_ = allValues_;
1240         }
1241         if (((from_bitField0_ & 0x00000008) != 0)) {
1242           result.suggestedValue_ = suggestedValue_;
1243         }
1244         if (((from_bitField0_ & 0x00000010) != 0)) {
1245           result.inheritFromParent_ = inheritFromParent_;
1246         }
1247       }
1248 
1249       @java.lang.Override
clone()1250       public Builder clone() {
1251         return super.clone();
1252       }
1253 
1254       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1255       public Builder setField(
1256           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1257         return super.setField(field, value);
1258       }
1259 
1260       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1261       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
1262         return super.clearField(field);
1263       }
1264 
1265       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1266       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
1267         return super.clearOneof(oneof);
1268       }
1269 
1270       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1271       public Builder setRepeatedField(
1272           com.google.protobuf.Descriptors.FieldDescriptor field,
1273           int index,
1274           java.lang.Object value) {
1275         return super.setRepeatedField(field, index, value);
1276       }
1277 
1278       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1279       public Builder addRepeatedField(
1280           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1281         return super.addRepeatedField(field, value);
1282       }
1283 
1284       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)1285       public Builder mergeFrom(com.google.protobuf.Message other) {
1286         if (other instanceof com.google.cloud.orgpolicy.v1.Policy.ListPolicy) {
1287           return mergeFrom((com.google.cloud.orgpolicy.v1.Policy.ListPolicy) other);
1288         } else {
1289           super.mergeFrom(other);
1290           return this;
1291         }
1292       }
1293 
mergeFrom(com.google.cloud.orgpolicy.v1.Policy.ListPolicy other)1294       public Builder mergeFrom(com.google.cloud.orgpolicy.v1.Policy.ListPolicy other) {
1295         if (other == com.google.cloud.orgpolicy.v1.Policy.ListPolicy.getDefaultInstance())
1296           return this;
1297         if (!other.allowedValues_.isEmpty()) {
1298           if (allowedValues_.isEmpty()) {
1299             allowedValues_ = other.allowedValues_;
1300             bitField0_ = (bitField0_ & ~0x00000001);
1301           } else {
1302             ensureAllowedValuesIsMutable();
1303             allowedValues_.addAll(other.allowedValues_);
1304           }
1305           onChanged();
1306         }
1307         if (!other.deniedValues_.isEmpty()) {
1308           if (deniedValues_.isEmpty()) {
1309             deniedValues_ = other.deniedValues_;
1310             bitField0_ = (bitField0_ & ~0x00000002);
1311           } else {
1312             ensureDeniedValuesIsMutable();
1313             deniedValues_.addAll(other.deniedValues_);
1314           }
1315           onChanged();
1316         }
1317         if (other.allValues_ != 0) {
1318           setAllValuesValue(other.getAllValuesValue());
1319         }
1320         if (!other.getSuggestedValue().isEmpty()) {
1321           suggestedValue_ = other.suggestedValue_;
1322           bitField0_ |= 0x00000008;
1323           onChanged();
1324         }
1325         if (other.getInheritFromParent() != false) {
1326           setInheritFromParent(other.getInheritFromParent());
1327         }
1328         this.mergeUnknownFields(other.getUnknownFields());
1329         onChanged();
1330         return this;
1331       }
1332 
1333       @java.lang.Override
isInitialized()1334       public final boolean isInitialized() {
1335         return true;
1336       }
1337 
1338       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1339       public Builder mergeFrom(
1340           com.google.protobuf.CodedInputStream input,
1341           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1342           throws java.io.IOException {
1343         if (extensionRegistry == null) {
1344           throw new java.lang.NullPointerException();
1345         }
1346         try {
1347           boolean done = false;
1348           while (!done) {
1349             int tag = input.readTag();
1350             switch (tag) {
1351               case 0:
1352                 done = true;
1353                 break;
1354               case 10:
1355                 {
1356                   java.lang.String s = input.readStringRequireUtf8();
1357                   ensureAllowedValuesIsMutable();
1358                   allowedValues_.add(s);
1359                   break;
1360                 } // case 10
1361               case 18:
1362                 {
1363                   java.lang.String s = input.readStringRequireUtf8();
1364                   ensureDeniedValuesIsMutable();
1365                   deniedValues_.add(s);
1366                   break;
1367                 } // case 18
1368               case 24:
1369                 {
1370                   allValues_ = input.readEnum();
1371                   bitField0_ |= 0x00000004;
1372                   break;
1373                 } // case 24
1374               case 34:
1375                 {
1376                   suggestedValue_ = input.readStringRequireUtf8();
1377                   bitField0_ |= 0x00000008;
1378                   break;
1379                 } // case 34
1380               case 40:
1381                 {
1382                   inheritFromParent_ = input.readBool();
1383                   bitField0_ |= 0x00000010;
1384                   break;
1385                 } // case 40
1386               default:
1387                 {
1388                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
1389                     done = true; // was an endgroup tag
1390                   }
1391                   break;
1392                 } // default:
1393             } // switch (tag)
1394           } // while (!done)
1395         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1396           throw e.unwrapIOException();
1397         } finally {
1398           onChanged();
1399         } // finally
1400         return this;
1401       }
1402 
1403       private int bitField0_;
1404 
1405       private com.google.protobuf.LazyStringList allowedValues_ =
1406           com.google.protobuf.LazyStringArrayList.EMPTY;
1407 
ensureAllowedValuesIsMutable()1408       private void ensureAllowedValuesIsMutable() {
1409         if (!((bitField0_ & 0x00000001) != 0)) {
1410           allowedValues_ = new com.google.protobuf.LazyStringArrayList(allowedValues_);
1411           bitField0_ |= 0x00000001;
1412         }
1413       }
1414       /**
1415        *
1416        *
1417        * <pre>
1418        * List of values allowed  at this resource. Can only be set if `all_values`
1419        * is set to `ALL_VALUES_UNSPECIFIED`.
1420        * </pre>
1421        *
1422        * <code>repeated string allowed_values = 1;</code>
1423        *
1424        * @return A list containing the allowedValues.
1425        */
getAllowedValuesList()1426       public com.google.protobuf.ProtocolStringList getAllowedValuesList() {
1427         return allowedValues_.getUnmodifiableView();
1428       }
1429       /**
1430        *
1431        *
1432        * <pre>
1433        * List of values allowed  at this resource. Can only be set if `all_values`
1434        * is set to `ALL_VALUES_UNSPECIFIED`.
1435        * </pre>
1436        *
1437        * <code>repeated string allowed_values = 1;</code>
1438        *
1439        * @return The count of allowedValues.
1440        */
getAllowedValuesCount()1441       public int getAllowedValuesCount() {
1442         return allowedValues_.size();
1443       }
1444       /**
1445        *
1446        *
1447        * <pre>
1448        * List of values allowed  at this resource. Can only be set if `all_values`
1449        * is set to `ALL_VALUES_UNSPECIFIED`.
1450        * </pre>
1451        *
1452        * <code>repeated string allowed_values = 1;</code>
1453        *
1454        * @param index The index of the element to return.
1455        * @return The allowedValues at the given index.
1456        */
getAllowedValues(int index)1457       public java.lang.String getAllowedValues(int index) {
1458         return allowedValues_.get(index);
1459       }
1460       /**
1461        *
1462        *
1463        * <pre>
1464        * List of values allowed  at this resource. Can only be set if `all_values`
1465        * is set to `ALL_VALUES_UNSPECIFIED`.
1466        * </pre>
1467        *
1468        * <code>repeated string allowed_values = 1;</code>
1469        *
1470        * @param index The index of the value to return.
1471        * @return The bytes of the allowedValues at the given index.
1472        */
getAllowedValuesBytes(int index)1473       public com.google.protobuf.ByteString getAllowedValuesBytes(int index) {
1474         return allowedValues_.getByteString(index);
1475       }
1476       /**
1477        *
1478        *
1479        * <pre>
1480        * List of values allowed  at this resource. Can only be set if `all_values`
1481        * is set to `ALL_VALUES_UNSPECIFIED`.
1482        * </pre>
1483        *
1484        * <code>repeated string allowed_values = 1;</code>
1485        *
1486        * @param index The index to set the value at.
1487        * @param value The allowedValues to set.
1488        * @return This builder for chaining.
1489        */
setAllowedValues(int index, java.lang.String value)1490       public Builder setAllowedValues(int index, java.lang.String value) {
1491         if (value == null) {
1492           throw new NullPointerException();
1493         }
1494         ensureAllowedValuesIsMutable();
1495         allowedValues_.set(index, value);
1496         onChanged();
1497         return this;
1498       }
1499       /**
1500        *
1501        *
1502        * <pre>
1503        * List of values allowed  at this resource. Can only be set if `all_values`
1504        * is set to `ALL_VALUES_UNSPECIFIED`.
1505        * </pre>
1506        *
1507        * <code>repeated string allowed_values = 1;</code>
1508        *
1509        * @param value The allowedValues to add.
1510        * @return This builder for chaining.
1511        */
addAllowedValues(java.lang.String value)1512       public Builder addAllowedValues(java.lang.String value) {
1513         if (value == null) {
1514           throw new NullPointerException();
1515         }
1516         ensureAllowedValuesIsMutable();
1517         allowedValues_.add(value);
1518         onChanged();
1519         return this;
1520       }
1521       /**
1522        *
1523        *
1524        * <pre>
1525        * List of values allowed  at this resource. Can only be set if `all_values`
1526        * is set to `ALL_VALUES_UNSPECIFIED`.
1527        * </pre>
1528        *
1529        * <code>repeated string allowed_values = 1;</code>
1530        *
1531        * @param values The allowedValues to add.
1532        * @return This builder for chaining.
1533        */
addAllAllowedValues(java.lang.Iterable<java.lang.String> values)1534       public Builder addAllAllowedValues(java.lang.Iterable<java.lang.String> values) {
1535         ensureAllowedValuesIsMutable();
1536         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedValues_);
1537         onChanged();
1538         return this;
1539       }
1540       /**
1541        *
1542        *
1543        * <pre>
1544        * List of values allowed  at this resource. Can only be set if `all_values`
1545        * is set to `ALL_VALUES_UNSPECIFIED`.
1546        * </pre>
1547        *
1548        * <code>repeated string allowed_values = 1;</code>
1549        *
1550        * @return This builder for chaining.
1551        */
clearAllowedValues()1552       public Builder clearAllowedValues() {
1553         allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1554         bitField0_ = (bitField0_ & ~0x00000001);
1555         onChanged();
1556         return this;
1557       }
1558       /**
1559        *
1560        *
1561        * <pre>
1562        * List of values allowed  at this resource. Can only be set if `all_values`
1563        * is set to `ALL_VALUES_UNSPECIFIED`.
1564        * </pre>
1565        *
1566        * <code>repeated string allowed_values = 1;</code>
1567        *
1568        * @param value The bytes of the allowedValues to add.
1569        * @return This builder for chaining.
1570        */
addAllowedValuesBytes(com.google.protobuf.ByteString value)1571       public Builder addAllowedValuesBytes(com.google.protobuf.ByteString value) {
1572         if (value == null) {
1573           throw new NullPointerException();
1574         }
1575         checkByteStringIsUtf8(value);
1576         ensureAllowedValuesIsMutable();
1577         allowedValues_.add(value);
1578         onChanged();
1579         return this;
1580       }
1581 
1582       private com.google.protobuf.LazyStringList deniedValues_ =
1583           com.google.protobuf.LazyStringArrayList.EMPTY;
1584 
ensureDeniedValuesIsMutable()1585       private void ensureDeniedValuesIsMutable() {
1586         if (!((bitField0_ & 0x00000002) != 0)) {
1587           deniedValues_ = new com.google.protobuf.LazyStringArrayList(deniedValues_);
1588           bitField0_ |= 0x00000002;
1589         }
1590       }
1591       /**
1592        *
1593        *
1594        * <pre>
1595        * List of values denied at this resource. Can only be set if `all_values`
1596        * is set to `ALL_VALUES_UNSPECIFIED`.
1597        * </pre>
1598        *
1599        * <code>repeated string denied_values = 2;</code>
1600        *
1601        * @return A list containing the deniedValues.
1602        */
getDeniedValuesList()1603       public com.google.protobuf.ProtocolStringList getDeniedValuesList() {
1604         return deniedValues_.getUnmodifiableView();
1605       }
1606       /**
1607        *
1608        *
1609        * <pre>
1610        * List of values denied at this resource. Can only be set if `all_values`
1611        * is set to `ALL_VALUES_UNSPECIFIED`.
1612        * </pre>
1613        *
1614        * <code>repeated string denied_values = 2;</code>
1615        *
1616        * @return The count of deniedValues.
1617        */
getDeniedValuesCount()1618       public int getDeniedValuesCount() {
1619         return deniedValues_.size();
1620       }
1621       /**
1622        *
1623        *
1624        * <pre>
1625        * List of values denied at this resource. Can only be set if `all_values`
1626        * is set to `ALL_VALUES_UNSPECIFIED`.
1627        * </pre>
1628        *
1629        * <code>repeated string denied_values = 2;</code>
1630        *
1631        * @param index The index of the element to return.
1632        * @return The deniedValues at the given index.
1633        */
getDeniedValues(int index)1634       public java.lang.String getDeniedValues(int index) {
1635         return deniedValues_.get(index);
1636       }
1637       /**
1638        *
1639        *
1640        * <pre>
1641        * List of values denied at this resource. Can only be set if `all_values`
1642        * is set to `ALL_VALUES_UNSPECIFIED`.
1643        * </pre>
1644        *
1645        * <code>repeated string denied_values = 2;</code>
1646        *
1647        * @param index The index of the value to return.
1648        * @return The bytes of the deniedValues at the given index.
1649        */
getDeniedValuesBytes(int index)1650       public com.google.protobuf.ByteString getDeniedValuesBytes(int index) {
1651         return deniedValues_.getByteString(index);
1652       }
1653       /**
1654        *
1655        *
1656        * <pre>
1657        * List of values denied at this resource. Can only be set if `all_values`
1658        * is set to `ALL_VALUES_UNSPECIFIED`.
1659        * </pre>
1660        *
1661        * <code>repeated string denied_values = 2;</code>
1662        *
1663        * @param index The index to set the value at.
1664        * @param value The deniedValues to set.
1665        * @return This builder for chaining.
1666        */
setDeniedValues(int index, java.lang.String value)1667       public Builder setDeniedValues(int index, java.lang.String value) {
1668         if (value == null) {
1669           throw new NullPointerException();
1670         }
1671         ensureDeniedValuesIsMutable();
1672         deniedValues_.set(index, value);
1673         onChanged();
1674         return this;
1675       }
1676       /**
1677        *
1678        *
1679        * <pre>
1680        * List of values denied at this resource. Can only be set if `all_values`
1681        * is set to `ALL_VALUES_UNSPECIFIED`.
1682        * </pre>
1683        *
1684        * <code>repeated string denied_values = 2;</code>
1685        *
1686        * @param value The deniedValues to add.
1687        * @return This builder for chaining.
1688        */
addDeniedValues(java.lang.String value)1689       public Builder addDeniedValues(java.lang.String value) {
1690         if (value == null) {
1691           throw new NullPointerException();
1692         }
1693         ensureDeniedValuesIsMutable();
1694         deniedValues_.add(value);
1695         onChanged();
1696         return this;
1697       }
1698       /**
1699        *
1700        *
1701        * <pre>
1702        * List of values denied at this resource. Can only be set if `all_values`
1703        * is set to `ALL_VALUES_UNSPECIFIED`.
1704        * </pre>
1705        *
1706        * <code>repeated string denied_values = 2;</code>
1707        *
1708        * @param values The deniedValues to add.
1709        * @return This builder for chaining.
1710        */
addAllDeniedValues(java.lang.Iterable<java.lang.String> values)1711       public Builder addAllDeniedValues(java.lang.Iterable<java.lang.String> values) {
1712         ensureDeniedValuesIsMutable();
1713         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deniedValues_);
1714         onChanged();
1715         return this;
1716       }
1717       /**
1718        *
1719        *
1720        * <pre>
1721        * List of values denied at this resource. Can only be set if `all_values`
1722        * is set to `ALL_VALUES_UNSPECIFIED`.
1723        * </pre>
1724        *
1725        * <code>repeated string denied_values = 2;</code>
1726        *
1727        * @return This builder for chaining.
1728        */
clearDeniedValues()1729       public Builder clearDeniedValues() {
1730         deniedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1731         bitField0_ = (bitField0_ & ~0x00000002);
1732         onChanged();
1733         return this;
1734       }
1735       /**
1736        *
1737        *
1738        * <pre>
1739        * List of values denied at this resource. Can only be set if `all_values`
1740        * is set to `ALL_VALUES_UNSPECIFIED`.
1741        * </pre>
1742        *
1743        * <code>repeated string denied_values = 2;</code>
1744        *
1745        * @param value The bytes of the deniedValues to add.
1746        * @return This builder for chaining.
1747        */
addDeniedValuesBytes(com.google.protobuf.ByteString value)1748       public Builder addDeniedValuesBytes(com.google.protobuf.ByteString value) {
1749         if (value == null) {
1750           throw new NullPointerException();
1751         }
1752         checkByteStringIsUtf8(value);
1753         ensureDeniedValuesIsMutable();
1754         deniedValues_.add(value);
1755         onChanged();
1756         return this;
1757       }
1758 
1759       private int allValues_ = 0;
1760       /**
1761        *
1762        *
1763        * <pre>
1764        * The policy all_values state.
1765        * </pre>
1766        *
1767        * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues all_values = 3;</code>
1768        *
1769        * @return The enum numeric value on the wire for allValues.
1770        */
1771       @java.lang.Override
getAllValuesValue()1772       public int getAllValuesValue() {
1773         return allValues_;
1774       }
1775       /**
1776        *
1777        *
1778        * <pre>
1779        * The policy all_values state.
1780        * </pre>
1781        *
1782        * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues all_values = 3;</code>
1783        *
1784        * @param value The enum numeric value on the wire for allValues to set.
1785        * @return This builder for chaining.
1786        */
setAllValuesValue(int value)1787       public Builder setAllValuesValue(int value) {
1788         allValues_ = value;
1789         bitField0_ |= 0x00000004;
1790         onChanged();
1791         return this;
1792       }
1793       /**
1794        *
1795        *
1796        * <pre>
1797        * The policy all_values state.
1798        * </pre>
1799        *
1800        * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues all_values = 3;</code>
1801        *
1802        * @return The allValues.
1803        */
1804       @java.lang.Override
getAllValues()1805       public com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues getAllValues() {
1806         com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues result =
1807             com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues.forNumber(allValues_);
1808         return result == null
1809             ? com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues.UNRECOGNIZED
1810             : result;
1811       }
1812       /**
1813        *
1814        *
1815        * <pre>
1816        * The policy all_values state.
1817        * </pre>
1818        *
1819        * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues all_values = 3;</code>
1820        *
1821        * @param value The allValues to set.
1822        * @return This builder for chaining.
1823        */
setAllValues(com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues value)1824       public Builder setAllValues(com.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues value) {
1825         if (value == null) {
1826           throw new NullPointerException();
1827         }
1828         bitField0_ |= 0x00000004;
1829         allValues_ = value.getNumber();
1830         onChanged();
1831         return this;
1832       }
1833       /**
1834        *
1835        *
1836        * <pre>
1837        * The policy all_values state.
1838        * </pre>
1839        *
1840        * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues all_values = 3;</code>
1841        *
1842        * @return This builder for chaining.
1843        */
clearAllValues()1844       public Builder clearAllValues() {
1845         bitField0_ = (bitField0_ & ~0x00000004);
1846         allValues_ = 0;
1847         onChanged();
1848         return this;
1849       }
1850 
1851       private java.lang.Object suggestedValue_ = "";
1852       /**
1853        *
1854        *
1855        * <pre>
1856        * Optional. The Google Cloud Console will try to default to a configuration
1857        * that matches the value specified in this `Policy`. If `suggested_value`
1858        * is not set, it will inherit the value specified higher in the hierarchy,
1859        * unless `inherit_from_parent` is `false`.
1860        * </pre>
1861        *
1862        * <code>string suggested_value = 4;</code>
1863        *
1864        * @return The suggestedValue.
1865        */
getSuggestedValue()1866       public java.lang.String getSuggestedValue() {
1867         java.lang.Object ref = suggestedValue_;
1868         if (!(ref instanceof java.lang.String)) {
1869           com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1870           java.lang.String s = bs.toStringUtf8();
1871           suggestedValue_ = s;
1872           return s;
1873         } else {
1874           return (java.lang.String) ref;
1875         }
1876       }
1877       /**
1878        *
1879        *
1880        * <pre>
1881        * Optional. The Google Cloud Console will try to default to a configuration
1882        * that matches the value specified in this `Policy`. If `suggested_value`
1883        * is not set, it will inherit the value specified higher in the hierarchy,
1884        * unless `inherit_from_parent` is `false`.
1885        * </pre>
1886        *
1887        * <code>string suggested_value = 4;</code>
1888        *
1889        * @return The bytes for suggestedValue.
1890        */
getSuggestedValueBytes()1891       public com.google.protobuf.ByteString getSuggestedValueBytes() {
1892         java.lang.Object ref = suggestedValue_;
1893         if (ref instanceof String) {
1894           com.google.protobuf.ByteString b =
1895               com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1896           suggestedValue_ = b;
1897           return b;
1898         } else {
1899           return (com.google.protobuf.ByteString) ref;
1900         }
1901       }
1902       /**
1903        *
1904        *
1905        * <pre>
1906        * Optional. The Google Cloud Console will try to default to a configuration
1907        * that matches the value specified in this `Policy`. If `suggested_value`
1908        * is not set, it will inherit the value specified higher in the hierarchy,
1909        * unless `inherit_from_parent` is `false`.
1910        * </pre>
1911        *
1912        * <code>string suggested_value = 4;</code>
1913        *
1914        * @param value The suggestedValue to set.
1915        * @return This builder for chaining.
1916        */
setSuggestedValue(java.lang.String value)1917       public Builder setSuggestedValue(java.lang.String value) {
1918         if (value == null) {
1919           throw new NullPointerException();
1920         }
1921         suggestedValue_ = value;
1922         bitField0_ |= 0x00000008;
1923         onChanged();
1924         return this;
1925       }
1926       /**
1927        *
1928        *
1929        * <pre>
1930        * Optional. The Google Cloud Console will try to default to a configuration
1931        * that matches the value specified in this `Policy`. If `suggested_value`
1932        * is not set, it will inherit the value specified higher in the hierarchy,
1933        * unless `inherit_from_parent` is `false`.
1934        * </pre>
1935        *
1936        * <code>string suggested_value = 4;</code>
1937        *
1938        * @return This builder for chaining.
1939        */
clearSuggestedValue()1940       public Builder clearSuggestedValue() {
1941         suggestedValue_ = getDefaultInstance().getSuggestedValue();
1942         bitField0_ = (bitField0_ & ~0x00000008);
1943         onChanged();
1944         return this;
1945       }
1946       /**
1947        *
1948        *
1949        * <pre>
1950        * Optional. The Google Cloud Console will try to default to a configuration
1951        * that matches the value specified in this `Policy`. If `suggested_value`
1952        * is not set, it will inherit the value specified higher in the hierarchy,
1953        * unless `inherit_from_parent` is `false`.
1954        * </pre>
1955        *
1956        * <code>string suggested_value = 4;</code>
1957        *
1958        * @param value The bytes for suggestedValue to set.
1959        * @return This builder for chaining.
1960        */
setSuggestedValueBytes(com.google.protobuf.ByteString value)1961       public Builder setSuggestedValueBytes(com.google.protobuf.ByteString value) {
1962         if (value == null) {
1963           throw new NullPointerException();
1964         }
1965         checkByteStringIsUtf8(value);
1966         suggestedValue_ = value;
1967         bitField0_ |= 0x00000008;
1968         onChanged();
1969         return this;
1970       }
1971 
1972       private boolean inheritFromParent_;
1973       /**
1974        *
1975        *
1976        * <pre>
1977        * Determines the inheritance behavior for this `Policy`.
1978        * By default, a `ListPolicy` set at a resource supercedes any `Policy` set
1979        * anywhere up the resource hierarchy. However, if `inherit_from_parent` is
1980        * set to `true`, then the values from the effective `Policy` of the parent
1981        * resource are inherited, meaning the values set in this `Policy` are
1982        * added to the values inherited up the hierarchy.
1983        * Setting `Policy` hierarchies that inherit both allowed values and denied
1984        * values isn't recommended in most circumstances to keep the configuration
1985        * simple and understandable. However, it is possible to set a `Policy` with
1986        * `allowed_values` set that inherits a `Policy` with `denied_values` set.
1987        * In this case, the values that are allowed must be in `allowed_values` and
1988        * not present in `denied_values`.
1989        * For example, suppose you have a `Constraint`
1990        * `constraints/serviceuser.services`, which has a `constraint_type` of
1991        * `list_constraint`, and with `constraint_default` set to `ALLOW`.
1992        * Suppose that at the Organization level, a `Policy` is applied that
1993        * restricts the allowed API activations to {`E1`, `E2`}. Then, if a
1994        * `Policy` is applied to a project below the Organization that has
1995        * `inherit_from_parent` set to `false` and field all_values set to DENY,
1996        * then an attempt to activate any API will be denied.
1997        * The following examples demonstrate different possible layerings for
1998        * `projects/bar` parented by `organizations/foo`:
1999        * Example 1 (no inherited values):
2000        *   `organizations/foo` has a `Policy` with values:
2001        *     {allowed_values: "E1" allowed_values:"E2"}
2002        *   `projects/bar` has `inherit_from_parent` `false` and values:
2003        *     {allowed_values: "E3" allowed_values: "E4"}
2004        * The accepted values at `organizations/foo` are `E1`, `E2`.
2005        * The accepted values at `projects/bar` are `E3`, and `E4`.
2006        * Example 2 (inherited values):
2007        *   `organizations/foo` has a `Policy` with values:
2008        *     {allowed_values: "E1" allowed_values:"E2"}
2009        *   `projects/bar` has a `Policy` with values:
2010        *     {value: "E3" value: "E4" inherit_from_parent: true}
2011        * The accepted values at `organizations/foo` are `E1`, `E2`.
2012        * The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`.
2013        * Example 3 (inheriting both allowed and denied values):
2014        *   `organizations/foo` has a `Policy` with values:
2015        *     {allowed_values: "E1" allowed_values: "E2"}
2016        *   `projects/bar` has a `Policy` with:
2017        *     {denied_values: "E1"}
2018        * The accepted values at `organizations/foo` are `E1`, `E2`.
2019        * The value accepted at `projects/bar` is `E2`.
2020        * Example 4 (RestoreDefault):
2021        *   `organizations/foo` has a `Policy` with values:
2022        *     {allowed_values: "E1" allowed_values:"E2"}
2023        *   `projects/bar` has a `Policy` with values:
2024        *     {RestoreDefault: {}}
2025        * The accepted values at `organizations/foo` are `E1`, `E2`.
2026        * The accepted values at `projects/bar` are either all or none depending on
2027        * the value of `constraint_default` (if `ALLOW`, all; if
2028        * `DENY`, none).
2029        * Example 5 (no policy inherits parent policy):
2030        *   `organizations/foo` has no `Policy` set.
2031        *   `projects/bar` has no `Policy` set.
2032        * The accepted values at both levels are either all or none depending on
2033        * the value of `constraint_default` (if `ALLOW`, all; if
2034        * `DENY`, none).
2035        * Example 6 (ListConstraint allowing all):
2036        *   `organizations/foo` has a `Policy` with values:
2037        *     {allowed_values: "E1" allowed_values: "E2"}
2038        *   `projects/bar` has a `Policy` with:
2039        *     {all: ALLOW}
2040        * The accepted values at `organizations/foo` are `E1`, E2`.
2041        * Any value is accepted at `projects/bar`.
2042        * Example 7 (ListConstraint allowing none):
2043        *   `organizations/foo` has a `Policy` with values:
2044        *     {allowed_values: "E1" allowed_values: "E2"}
2045        *   `projects/bar` has a `Policy` with:
2046        *     {all: DENY}
2047        * The accepted values at `organizations/foo` are `E1`, E2`.
2048        * No value is accepted at `projects/bar`.
2049        * Example 10 (allowed and denied subtrees of Resource Manager hierarchy):
2050        * Given the following resource hierarchy
2051        *   O1-&gt;{F1, F2}; F1-&gt;{P1}; F2-&gt;{P2, P3},
2052        *   `organizations/foo` has a `Policy` with values:
2053        *     {allowed_values: "under:organizations/O1"}
2054        *   `projects/bar` has a `Policy` with:
2055        *     {allowed_values: "under:projects/P3"}
2056        *     {denied_values: "under:folders/F2"}
2057        * The accepted values at `organizations/foo` are `organizations/O1`,
2058        *   `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`,
2059        *   `projects/P3`.
2060        * The accepted values at `projects/bar` are `organizations/O1`,
2061        *   `folders/F1`, `projects/P1`.
2062        * </pre>
2063        *
2064        * <code>bool inherit_from_parent = 5;</code>
2065        *
2066        * @return The inheritFromParent.
2067        */
2068       @java.lang.Override
getInheritFromParent()2069       public boolean getInheritFromParent() {
2070         return inheritFromParent_;
2071       }
2072       /**
2073        *
2074        *
2075        * <pre>
2076        * Determines the inheritance behavior for this `Policy`.
2077        * By default, a `ListPolicy` set at a resource supercedes any `Policy` set
2078        * anywhere up the resource hierarchy. However, if `inherit_from_parent` is
2079        * set to `true`, then the values from the effective `Policy` of the parent
2080        * resource are inherited, meaning the values set in this `Policy` are
2081        * added to the values inherited up the hierarchy.
2082        * Setting `Policy` hierarchies that inherit both allowed values and denied
2083        * values isn't recommended in most circumstances to keep the configuration
2084        * simple and understandable. However, it is possible to set a `Policy` with
2085        * `allowed_values` set that inherits a `Policy` with `denied_values` set.
2086        * In this case, the values that are allowed must be in `allowed_values` and
2087        * not present in `denied_values`.
2088        * For example, suppose you have a `Constraint`
2089        * `constraints/serviceuser.services`, which has a `constraint_type` of
2090        * `list_constraint`, and with `constraint_default` set to `ALLOW`.
2091        * Suppose that at the Organization level, a `Policy` is applied that
2092        * restricts the allowed API activations to {`E1`, `E2`}. Then, if a
2093        * `Policy` is applied to a project below the Organization that has
2094        * `inherit_from_parent` set to `false` and field all_values set to DENY,
2095        * then an attempt to activate any API will be denied.
2096        * The following examples demonstrate different possible layerings for
2097        * `projects/bar` parented by `organizations/foo`:
2098        * Example 1 (no inherited values):
2099        *   `organizations/foo` has a `Policy` with values:
2100        *     {allowed_values: "E1" allowed_values:"E2"}
2101        *   `projects/bar` has `inherit_from_parent` `false` and values:
2102        *     {allowed_values: "E3" allowed_values: "E4"}
2103        * The accepted values at `organizations/foo` are `E1`, `E2`.
2104        * The accepted values at `projects/bar` are `E3`, and `E4`.
2105        * Example 2 (inherited values):
2106        *   `organizations/foo` has a `Policy` with values:
2107        *     {allowed_values: "E1" allowed_values:"E2"}
2108        *   `projects/bar` has a `Policy` with values:
2109        *     {value: "E3" value: "E4" inherit_from_parent: true}
2110        * The accepted values at `organizations/foo` are `E1`, `E2`.
2111        * The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`.
2112        * Example 3 (inheriting both allowed and denied values):
2113        *   `organizations/foo` has a `Policy` with values:
2114        *     {allowed_values: "E1" allowed_values: "E2"}
2115        *   `projects/bar` has a `Policy` with:
2116        *     {denied_values: "E1"}
2117        * The accepted values at `organizations/foo` are `E1`, `E2`.
2118        * The value accepted at `projects/bar` is `E2`.
2119        * Example 4 (RestoreDefault):
2120        *   `organizations/foo` has a `Policy` with values:
2121        *     {allowed_values: "E1" allowed_values:"E2"}
2122        *   `projects/bar` has a `Policy` with values:
2123        *     {RestoreDefault: {}}
2124        * The accepted values at `organizations/foo` are `E1`, `E2`.
2125        * The accepted values at `projects/bar` are either all or none depending on
2126        * the value of `constraint_default` (if `ALLOW`, all; if
2127        * `DENY`, none).
2128        * Example 5 (no policy inherits parent policy):
2129        *   `organizations/foo` has no `Policy` set.
2130        *   `projects/bar` has no `Policy` set.
2131        * The accepted values at both levels are either all or none depending on
2132        * the value of `constraint_default` (if `ALLOW`, all; if
2133        * `DENY`, none).
2134        * Example 6 (ListConstraint allowing all):
2135        *   `organizations/foo` has a `Policy` with values:
2136        *     {allowed_values: "E1" allowed_values: "E2"}
2137        *   `projects/bar` has a `Policy` with:
2138        *     {all: ALLOW}
2139        * The accepted values at `organizations/foo` are `E1`, E2`.
2140        * Any value is accepted at `projects/bar`.
2141        * Example 7 (ListConstraint allowing none):
2142        *   `organizations/foo` has a `Policy` with values:
2143        *     {allowed_values: "E1" allowed_values: "E2"}
2144        *   `projects/bar` has a `Policy` with:
2145        *     {all: DENY}
2146        * The accepted values at `organizations/foo` are `E1`, E2`.
2147        * No value is accepted at `projects/bar`.
2148        * Example 10 (allowed and denied subtrees of Resource Manager hierarchy):
2149        * Given the following resource hierarchy
2150        *   O1-&gt;{F1, F2}; F1-&gt;{P1}; F2-&gt;{P2, P3},
2151        *   `organizations/foo` has a `Policy` with values:
2152        *     {allowed_values: "under:organizations/O1"}
2153        *   `projects/bar` has a `Policy` with:
2154        *     {allowed_values: "under:projects/P3"}
2155        *     {denied_values: "under:folders/F2"}
2156        * The accepted values at `organizations/foo` are `organizations/O1`,
2157        *   `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`,
2158        *   `projects/P3`.
2159        * The accepted values at `projects/bar` are `organizations/O1`,
2160        *   `folders/F1`, `projects/P1`.
2161        * </pre>
2162        *
2163        * <code>bool inherit_from_parent = 5;</code>
2164        *
2165        * @param value The inheritFromParent to set.
2166        * @return This builder for chaining.
2167        */
setInheritFromParent(boolean value)2168       public Builder setInheritFromParent(boolean value) {
2169 
2170         inheritFromParent_ = value;
2171         bitField0_ |= 0x00000010;
2172         onChanged();
2173         return this;
2174       }
2175       /**
2176        *
2177        *
2178        * <pre>
2179        * Determines the inheritance behavior for this `Policy`.
2180        * By default, a `ListPolicy` set at a resource supercedes any `Policy` set
2181        * anywhere up the resource hierarchy. However, if `inherit_from_parent` is
2182        * set to `true`, then the values from the effective `Policy` of the parent
2183        * resource are inherited, meaning the values set in this `Policy` are
2184        * added to the values inherited up the hierarchy.
2185        * Setting `Policy` hierarchies that inherit both allowed values and denied
2186        * values isn't recommended in most circumstances to keep the configuration
2187        * simple and understandable. However, it is possible to set a `Policy` with
2188        * `allowed_values` set that inherits a `Policy` with `denied_values` set.
2189        * In this case, the values that are allowed must be in `allowed_values` and
2190        * not present in `denied_values`.
2191        * For example, suppose you have a `Constraint`
2192        * `constraints/serviceuser.services`, which has a `constraint_type` of
2193        * `list_constraint`, and with `constraint_default` set to `ALLOW`.
2194        * Suppose that at the Organization level, a `Policy` is applied that
2195        * restricts the allowed API activations to {`E1`, `E2`}. Then, if a
2196        * `Policy` is applied to a project below the Organization that has
2197        * `inherit_from_parent` set to `false` and field all_values set to DENY,
2198        * then an attempt to activate any API will be denied.
2199        * The following examples demonstrate different possible layerings for
2200        * `projects/bar` parented by `organizations/foo`:
2201        * Example 1 (no inherited values):
2202        *   `organizations/foo` has a `Policy` with values:
2203        *     {allowed_values: "E1" allowed_values:"E2"}
2204        *   `projects/bar` has `inherit_from_parent` `false` and values:
2205        *     {allowed_values: "E3" allowed_values: "E4"}
2206        * The accepted values at `organizations/foo` are `E1`, `E2`.
2207        * The accepted values at `projects/bar` are `E3`, and `E4`.
2208        * Example 2 (inherited values):
2209        *   `organizations/foo` has a `Policy` with values:
2210        *     {allowed_values: "E1" allowed_values:"E2"}
2211        *   `projects/bar` has a `Policy` with values:
2212        *     {value: "E3" value: "E4" inherit_from_parent: true}
2213        * The accepted values at `organizations/foo` are `E1`, `E2`.
2214        * The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`.
2215        * Example 3 (inheriting both allowed and denied values):
2216        *   `organizations/foo` has a `Policy` with values:
2217        *     {allowed_values: "E1" allowed_values: "E2"}
2218        *   `projects/bar` has a `Policy` with:
2219        *     {denied_values: "E1"}
2220        * The accepted values at `organizations/foo` are `E1`, `E2`.
2221        * The value accepted at `projects/bar` is `E2`.
2222        * Example 4 (RestoreDefault):
2223        *   `organizations/foo` has a `Policy` with values:
2224        *     {allowed_values: "E1" allowed_values:"E2"}
2225        *   `projects/bar` has a `Policy` with values:
2226        *     {RestoreDefault: {}}
2227        * The accepted values at `organizations/foo` are `E1`, `E2`.
2228        * The accepted values at `projects/bar` are either all or none depending on
2229        * the value of `constraint_default` (if `ALLOW`, all; if
2230        * `DENY`, none).
2231        * Example 5 (no policy inherits parent policy):
2232        *   `organizations/foo` has no `Policy` set.
2233        *   `projects/bar` has no `Policy` set.
2234        * The accepted values at both levels are either all or none depending on
2235        * the value of `constraint_default` (if `ALLOW`, all; if
2236        * `DENY`, none).
2237        * Example 6 (ListConstraint allowing all):
2238        *   `organizations/foo` has a `Policy` with values:
2239        *     {allowed_values: "E1" allowed_values: "E2"}
2240        *   `projects/bar` has a `Policy` with:
2241        *     {all: ALLOW}
2242        * The accepted values at `organizations/foo` are `E1`, E2`.
2243        * Any value is accepted at `projects/bar`.
2244        * Example 7 (ListConstraint allowing none):
2245        *   `organizations/foo` has a `Policy` with values:
2246        *     {allowed_values: "E1" allowed_values: "E2"}
2247        *   `projects/bar` has a `Policy` with:
2248        *     {all: DENY}
2249        * The accepted values at `organizations/foo` are `E1`, E2`.
2250        * No value is accepted at `projects/bar`.
2251        * Example 10 (allowed and denied subtrees of Resource Manager hierarchy):
2252        * Given the following resource hierarchy
2253        *   O1-&gt;{F1, F2}; F1-&gt;{P1}; F2-&gt;{P2, P3},
2254        *   `organizations/foo` has a `Policy` with values:
2255        *     {allowed_values: "under:organizations/O1"}
2256        *   `projects/bar` has a `Policy` with:
2257        *     {allowed_values: "under:projects/P3"}
2258        *     {denied_values: "under:folders/F2"}
2259        * The accepted values at `organizations/foo` are `organizations/O1`,
2260        *   `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`,
2261        *   `projects/P3`.
2262        * The accepted values at `projects/bar` are `organizations/O1`,
2263        *   `folders/F1`, `projects/P1`.
2264        * </pre>
2265        *
2266        * <code>bool inherit_from_parent = 5;</code>
2267        *
2268        * @return This builder for chaining.
2269        */
clearInheritFromParent()2270       public Builder clearInheritFromParent() {
2271         bitField0_ = (bitField0_ & ~0x00000010);
2272         inheritFromParent_ = false;
2273         onChanged();
2274         return this;
2275       }
2276 
2277       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2278       public final Builder setUnknownFields(
2279           final com.google.protobuf.UnknownFieldSet unknownFields) {
2280         return super.setUnknownFields(unknownFields);
2281       }
2282 
2283       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2284       public final Builder mergeUnknownFields(
2285           final com.google.protobuf.UnknownFieldSet unknownFields) {
2286         return super.mergeUnknownFields(unknownFields);
2287       }
2288 
2289       // @@protoc_insertion_point(builder_scope:google.cloud.orgpolicy.v1.Policy.ListPolicy)
2290     }
2291 
2292     // @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v1.Policy.ListPolicy)
2293     private static final com.google.cloud.orgpolicy.v1.Policy.ListPolicy DEFAULT_INSTANCE;
2294 
2295     static {
2296       DEFAULT_INSTANCE = new com.google.cloud.orgpolicy.v1.Policy.ListPolicy();
2297     }
2298 
getDefaultInstance()2299     public static com.google.cloud.orgpolicy.v1.Policy.ListPolicy getDefaultInstance() {
2300       return DEFAULT_INSTANCE;
2301     }
2302 
2303     private static final com.google.protobuf.Parser<ListPolicy> PARSER =
2304         new com.google.protobuf.AbstractParser<ListPolicy>() {
2305           @java.lang.Override
2306           public ListPolicy parsePartialFrom(
2307               com.google.protobuf.CodedInputStream input,
2308               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2309               throws com.google.protobuf.InvalidProtocolBufferException {
2310             Builder builder = newBuilder();
2311             try {
2312               builder.mergeFrom(input, extensionRegistry);
2313             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
2314               throw e.setUnfinishedMessage(builder.buildPartial());
2315             } catch (com.google.protobuf.UninitializedMessageException e) {
2316               throw e.asInvalidProtocolBufferException()
2317                   .setUnfinishedMessage(builder.buildPartial());
2318             } catch (java.io.IOException e) {
2319               throw new com.google.protobuf.InvalidProtocolBufferException(e)
2320                   .setUnfinishedMessage(builder.buildPartial());
2321             }
2322             return builder.buildPartial();
2323           }
2324         };
2325 
parser()2326     public static com.google.protobuf.Parser<ListPolicy> parser() {
2327       return PARSER;
2328     }
2329 
2330     @java.lang.Override
getParserForType()2331     public com.google.protobuf.Parser<ListPolicy> getParserForType() {
2332       return PARSER;
2333     }
2334 
2335     @java.lang.Override
getDefaultInstanceForType()2336     public com.google.cloud.orgpolicy.v1.Policy.ListPolicy getDefaultInstanceForType() {
2337       return DEFAULT_INSTANCE;
2338     }
2339   }
2340 
2341   public interface BooleanPolicyOrBuilder
2342       extends
2343       // @@protoc_insertion_point(interface_extends:google.cloud.orgpolicy.v1.Policy.BooleanPolicy)
2344       com.google.protobuf.MessageOrBuilder {
2345 
2346     /**
2347      *
2348      *
2349      * <pre>
2350      * If `true`, then the `Policy` is enforced. If `false`, then any
2351      * configuration is acceptable.
2352      * Suppose you have a `Constraint`
2353      * `constraints/compute.disableSerialPortAccess` with `constraint_default`
2354      * set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following
2355      * behavior:
2356      *   - If the `Policy` at this resource has enforced set to `false`, serial
2357      *     port connection attempts will be allowed.
2358      *   - If the `Policy` at this resource has enforced set to `true`, serial
2359      *     port connection attempts will be refused.
2360      *   - If the `Policy` at this resource is `RestoreDefault`, serial port
2361      *     connection attempts will be allowed.
2362      *   - If no `Policy` is set at this resource or anywhere higher in the
2363      *     resource hierarchy, serial port connection attempts will be allowed.
2364      *   - If no `Policy` is set at this resource, but one exists higher in the
2365      *     resource hierarchy, the behavior is as if the`Policy` were set at
2366      *     this resource.
2367      * The following examples demonstrate the different possible layerings:
2368      * Example 1 (nearest `Constraint` wins):
2369      *   `organizations/foo` has a `Policy` with:
2370      *     {enforced: false}
2371      *   `projects/bar` has no `Policy` set.
2372      * The constraint at `projects/bar` and `organizations/foo` will not be
2373      * enforced.
2374      * Example 2 (enforcement gets replaced):
2375      *   `organizations/foo` has a `Policy` with:
2376      *     {enforced: false}
2377      *   `projects/bar` has a `Policy` with:
2378      *     {enforced: true}
2379      * The constraint at `organizations/foo` is not enforced.
2380      * The constraint at `projects/bar` is enforced.
2381      * Example 3 (RestoreDefault):
2382      *   `organizations/foo` has a `Policy` with:
2383      *     {enforced: true}
2384      *   `projects/bar` has a `Policy` with:
2385      *     {RestoreDefault: {}}
2386      * The constraint at `organizations/foo` is enforced.
2387      * The constraint at `projects/bar` is not enforced, because
2388      * `constraint_default` for the `Constraint` is `ALLOW`.
2389      * </pre>
2390      *
2391      * <code>bool enforced = 1;</code>
2392      *
2393      * @return The enforced.
2394      */
getEnforced()2395     boolean getEnforced();
2396   }
2397   /**
2398    *
2399    *
2400    * <pre>
2401    * Used in `policy_type` to specify how `boolean_policy` will behave at this
2402    * resource.
2403    * </pre>
2404    *
2405    * Protobuf type {@code google.cloud.orgpolicy.v1.Policy.BooleanPolicy}
2406    */
2407   public static final class BooleanPolicy extends com.google.protobuf.GeneratedMessageV3
2408       implements
2409       // @@protoc_insertion_point(message_implements:google.cloud.orgpolicy.v1.Policy.BooleanPolicy)
2410       BooleanPolicyOrBuilder {
2411     private static final long serialVersionUID = 0L;
2412     // Use BooleanPolicy.newBuilder() to construct.
BooleanPolicy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)2413     private BooleanPolicy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
2414       super(builder);
2415     }
2416 
BooleanPolicy()2417     private BooleanPolicy() {}
2418 
2419     @java.lang.Override
2420     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)2421     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
2422       return new BooleanPolicy();
2423     }
2424 
2425     @java.lang.Override
getUnknownFields()2426     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
2427       return this.unknownFields;
2428     }
2429 
getDescriptor()2430     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
2431       return com.google.cloud.orgpolicy.v1.OrgPolicyProto
2432           .internal_static_google_cloud_orgpolicy_v1_Policy_BooleanPolicy_descriptor;
2433     }
2434 
2435     @java.lang.Override
2436     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()2437         internalGetFieldAccessorTable() {
2438       return com.google.cloud.orgpolicy.v1.OrgPolicyProto
2439           .internal_static_google_cloud_orgpolicy_v1_Policy_BooleanPolicy_fieldAccessorTable
2440           .ensureFieldAccessorsInitialized(
2441               com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.class,
2442               com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.Builder.class);
2443     }
2444 
2445     public static final int ENFORCED_FIELD_NUMBER = 1;
2446     private boolean enforced_ = false;
2447     /**
2448      *
2449      *
2450      * <pre>
2451      * If `true`, then the `Policy` is enforced. If `false`, then any
2452      * configuration is acceptable.
2453      * Suppose you have a `Constraint`
2454      * `constraints/compute.disableSerialPortAccess` with `constraint_default`
2455      * set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following
2456      * behavior:
2457      *   - If the `Policy` at this resource has enforced set to `false`, serial
2458      *     port connection attempts will be allowed.
2459      *   - If the `Policy` at this resource has enforced set to `true`, serial
2460      *     port connection attempts will be refused.
2461      *   - If the `Policy` at this resource is `RestoreDefault`, serial port
2462      *     connection attempts will be allowed.
2463      *   - If no `Policy` is set at this resource or anywhere higher in the
2464      *     resource hierarchy, serial port connection attempts will be allowed.
2465      *   - If no `Policy` is set at this resource, but one exists higher in the
2466      *     resource hierarchy, the behavior is as if the`Policy` were set at
2467      *     this resource.
2468      * The following examples demonstrate the different possible layerings:
2469      * Example 1 (nearest `Constraint` wins):
2470      *   `organizations/foo` has a `Policy` with:
2471      *     {enforced: false}
2472      *   `projects/bar` has no `Policy` set.
2473      * The constraint at `projects/bar` and `organizations/foo` will not be
2474      * enforced.
2475      * Example 2 (enforcement gets replaced):
2476      *   `organizations/foo` has a `Policy` with:
2477      *     {enforced: false}
2478      *   `projects/bar` has a `Policy` with:
2479      *     {enforced: true}
2480      * The constraint at `organizations/foo` is not enforced.
2481      * The constraint at `projects/bar` is enforced.
2482      * Example 3 (RestoreDefault):
2483      *   `organizations/foo` has a `Policy` with:
2484      *     {enforced: true}
2485      *   `projects/bar` has a `Policy` with:
2486      *     {RestoreDefault: {}}
2487      * The constraint at `organizations/foo` is enforced.
2488      * The constraint at `projects/bar` is not enforced, because
2489      * `constraint_default` for the `Constraint` is `ALLOW`.
2490      * </pre>
2491      *
2492      * <code>bool enforced = 1;</code>
2493      *
2494      * @return The enforced.
2495      */
2496     @java.lang.Override
getEnforced()2497     public boolean getEnforced() {
2498       return enforced_;
2499     }
2500 
2501     private byte memoizedIsInitialized = -1;
2502 
2503     @java.lang.Override
isInitialized()2504     public final boolean isInitialized() {
2505       byte isInitialized = memoizedIsInitialized;
2506       if (isInitialized == 1) return true;
2507       if (isInitialized == 0) return false;
2508 
2509       memoizedIsInitialized = 1;
2510       return true;
2511     }
2512 
2513     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)2514     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
2515       if (enforced_ != false) {
2516         output.writeBool(1, enforced_);
2517       }
2518       getUnknownFields().writeTo(output);
2519     }
2520 
2521     @java.lang.Override
getSerializedSize()2522     public int getSerializedSize() {
2523       int size = memoizedSize;
2524       if (size != -1) return size;
2525 
2526       size = 0;
2527       if (enforced_ != false) {
2528         size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enforced_);
2529       }
2530       size += getUnknownFields().getSerializedSize();
2531       memoizedSize = size;
2532       return size;
2533     }
2534 
2535     @java.lang.Override
equals(final java.lang.Object obj)2536     public boolean equals(final java.lang.Object obj) {
2537       if (obj == this) {
2538         return true;
2539       }
2540       if (!(obj instanceof com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy)) {
2541         return super.equals(obj);
2542       }
2543       com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy other =
2544           (com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) obj;
2545 
2546       if (getEnforced() != other.getEnforced()) return false;
2547       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
2548       return true;
2549     }
2550 
2551     @java.lang.Override
hashCode()2552     public int hashCode() {
2553       if (memoizedHashCode != 0) {
2554         return memoizedHashCode;
2555       }
2556       int hash = 41;
2557       hash = (19 * hash) + getDescriptor().hashCode();
2558       hash = (37 * hash) + ENFORCED_FIELD_NUMBER;
2559       hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnforced());
2560       hash = (29 * hash) + getUnknownFields().hashCode();
2561       memoizedHashCode = hash;
2562       return hash;
2563     }
2564 
parseFrom( java.nio.ByteBuffer data)2565     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseFrom(
2566         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
2567       return PARSER.parseFrom(data);
2568     }
2569 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2570     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseFrom(
2571         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2572         throws com.google.protobuf.InvalidProtocolBufferException {
2573       return PARSER.parseFrom(data, extensionRegistry);
2574     }
2575 
parseFrom( com.google.protobuf.ByteString data)2576     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseFrom(
2577         com.google.protobuf.ByteString data)
2578         throws com.google.protobuf.InvalidProtocolBufferException {
2579       return PARSER.parseFrom(data);
2580     }
2581 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2582     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseFrom(
2583         com.google.protobuf.ByteString data,
2584         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2585         throws com.google.protobuf.InvalidProtocolBufferException {
2586       return PARSER.parseFrom(data, extensionRegistry);
2587     }
2588 
parseFrom(byte[] data)2589     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseFrom(byte[] data)
2590         throws com.google.protobuf.InvalidProtocolBufferException {
2591       return PARSER.parseFrom(data);
2592     }
2593 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2594     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseFrom(
2595         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2596         throws com.google.protobuf.InvalidProtocolBufferException {
2597       return PARSER.parseFrom(data, extensionRegistry);
2598     }
2599 
parseFrom( java.io.InputStream input)2600     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseFrom(
2601         java.io.InputStream input) throws java.io.IOException {
2602       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
2603     }
2604 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2605     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseFrom(
2606         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2607         throws java.io.IOException {
2608       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
2609           PARSER, input, extensionRegistry);
2610     }
2611 
parseDelimitedFrom( java.io.InputStream input)2612     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseDelimitedFrom(
2613         java.io.InputStream input) throws java.io.IOException {
2614       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
2615     }
2616 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2617     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseDelimitedFrom(
2618         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2619         throws java.io.IOException {
2620       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
2621           PARSER, input, extensionRegistry);
2622     }
2623 
parseFrom( com.google.protobuf.CodedInputStream input)2624     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseFrom(
2625         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
2626       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
2627     }
2628 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2629     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy parseFrom(
2630         com.google.protobuf.CodedInputStream input,
2631         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2632         throws java.io.IOException {
2633       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
2634           PARSER, input, extensionRegistry);
2635     }
2636 
2637     @java.lang.Override
newBuilderForType()2638     public Builder newBuilderForType() {
2639       return newBuilder();
2640     }
2641 
newBuilder()2642     public static Builder newBuilder() {
2643       return DEFAULT_INSTANCE.toBuilder();
2644     }
2645 
newBuilder(com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy prototype)2646     public static Builder newBuilder(com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy prototype) {
2647       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
2648     }
2649 
2650     @java.lang.Override
toBuilder()2651     public Builder toBuilder() {
2652       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
2653     }
2654 
2655     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2656     protected Builder newBuilderForType(
2657         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
2658       Builder builder = new Builder(parent);
2659       return builder;
2660     }
2661     /**
2662      *
2663      *
2664      * <pre>
2665      * Used in `policy_type` to specify how `boolean_policy` will behave at this
2666      * resource.
2667      * </pre>
2668      *
2669      * Protobuf type {@code google.cloud.orgpolicy.v1.Policy.BooleanPolicy}
2670      */
2671     public static final class Builder
2672         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
2673         implements
2674         // @@protoc_insertion_point(builder_implements:google.cloud.orgpolicy.v1.Policy.BooleanPolicy)
2675         com.google.cloud.orgpolicy.v1.Policy.BooleanPolicyOrBuilder {
getDescriptor()2676       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
2677         return com.google.cloud.orgpolicy.v1.OrgPolicyProto
2678             .internal_static_google_cloud_orgpolicy_v1_Policy_BooleanPolicy_descriptor;
2679       }
2680 
2681       @java.lang.Override
2682       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()2683           internalGetFieldAccessorTable() {
2684         return com.google.cloud.orgpolicy.v1.OrgPolicyProto
2685             .internal_static_google_cloud_orgpolicy_v1_Policy_BooleanPolicy_fieldAccessorTable
2686             .ensureFieldAccessorsInitialized(
2687                 com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.class,
2688                 com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.Builder.class);
2689       }
2690 
2691       // Construct using com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.newBuilder()
Builder()2692       private Builder() {}
2693 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2694       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
2695         super(parent);
2696       }
2697 
2698       @java.lang.Override
clear()2699       public Builder clear() {
2700         super.clear();
2701         bitField0_ = 0;
2702         enforced_ = false;
2703         return this;
2704       }
2705 
2706       @java.lang.Override
getDescriptorForType()2707       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
2708         return com.google.cloud.orgpolicy.v1.OrgPolicyProto
2709             .internal_static_google_cloud_orgpolicy_v1_Policy_BooleanPolicy_descriptor;
2710       }
2711 
2712       @java.lang.Override
getDefaultInstanceForType()2713       public com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy getDefaultInstanceForType() {
2714         return com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.getDefaultInstance();
2715       }
2716 
2717       @java.lang.Override
build()2718       public com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy build() {
2719         com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy result = buildPartial();
2720         if (!result.isInitialized()) {
2721           throw newUninitializedMessageException(result);
2722         }
2723         return result;
2724       }
2725 
2726       @java.lang.Override
buildPartial()2727       public com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy buildPartial() {
2728         com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy result =
2729             new com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy(this);
2730         if (bitField0_ != 0) {
2731           buildPartial0(result);
2732         }
2733         onBuilt();
2734         return result;
2735       }
2736 
buildPartial0(com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy result)2737       private void buildPartial0(com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy result) {
2738         int from_bitField0_ = bitField0_;
2739         if (((from_bitField0_ & 0x00000001) != 0)) {
2740           result.enforced_ = enforced_;
2741         }
2742       }
2743 
2744       @java.lang.Override
clone()2745       public Builder clone() {
2746         return super.clone();
2747       }
2748 
2749       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2750       public Builder setField(
2751           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
2752         return super.setField(field, value);
2753       }
2754 
2755       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)2756       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
2757         return super.clearField(field);
2758       }
2759 
2760       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)2761       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
2762         return super.clearOneof(oneof);
2763       }
2764 
2765       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)2766       public Builder setRepeatedField(
2767           com.google.protobuf.Descriptors.FieldDescriptor field,
2768           int index,
2769           java.lang.Object value) {
2770         return super.setRepeatedField(field, index, value);
2771       }
2772 
2773       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2774       public Builder addRepeatedField(
2775           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
2776         return super.addRepeatedField(field, value);
2777       }
2778 
2779       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)2780       public Builder mergeFrom(com.google.protobuf.Message other) {
2781         if (other instanceof com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) {
2782           return mergeFrom((com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) other);
2783         } else {
2784           super.mergeFrom(other);
2785           return this;
2786         }
2787       }
2788 
mergeFrom(com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy other)2789       public Builder mergeFrom(com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy other) {
2790         if (other == com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.getDefaultInstance())
2791           return this;
2792         if (other.getEnforced() != false) {
2793           setEnforced(other.getEnforced());
2794         }
2795         this.mergeUnknownFields(other.getUnknownFields());
2796         onChanged();
2797         return this;
2798       }
2799 
2800       @java.lang.Override
isInitialized()2801       public final boolean isInitialized() {
2802         return true;
2803       }
2804 
2805       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2806       public Builder mergeFrom(
2807           com.google.protobuf.CodedInputStream input,
2808           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2809           throws java.io.IOException {
2810         if (extensionRegistry == null) {
2811           throw new java.lang.NullPointerException();
2812         }
2813         try {
2814           boolean done = false;
2815           while (!done) {
2816             int tag = input.readTag();
2817             switch (tag) {
2818               case 0:
2819                 done = true;
2820                 break;
2821               case 8:
2822                 {
2823                   enforced_ = input.readBool();
2824                   bitField0_ |= 0x00000001;
2825                   break;
2826                 } // case 8
2827               default:
2828                 {
2829                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
2830                     done = true; // was an endgroup tag
2831                   }
2832                   break;
2833                 } // default:
2834             } // switch (tag)
2835           } // while (!done)
2836         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
2837           throw e.unwrapIOException();
2838         } finally {
2839           onChanged();
2840         } // finally
2841         return this;
2842       }
2843 
2844       private int bitField0_;
2845 
2846       private boolean enforced_;
2847       /**
2848        *
2849        *
2850        * <pre>
2851        * If `true`, then the `Policy` is enforced. If `false`, then any
2852        * configuration is acceptable.
2853        * Suppose you have a `Constraint`
2854        * `constraints/compute.disableSerialPortAccess` with `constraint_default`
2855        * set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following
2856        * behavior:
2857        *   - If the `Policy` at this resource has enforced set to `false`, serial
2858        *     port connection attempts will be allowed.
2859        *   - If the `Policy` at this resource has enforced set to `true`, serial
2860        *     port connection attempts will be refused.
2861        *   - If the `Policy` at this resource is `RestoreDefault`, serial port
2862        *     connection attempts will be allowed.
2863        *   - If no `Policy` is set at this resource or anywhere higher in the
2864        *     resource hierarchy, serial port connection attempts will be allowed.
2865        *   - If no `Policy` is set at this resource, but one exists higher in the
2866        *     resource hierarchy, the behavior is as if the`Policy` were set at
2867        *     this resource.
2868        * The following examples demonstrate the different possible layerings:
2869        * Example 1 (nearest `Constraint` wins):
2870        *   `organizations/foo` has a `Policy` with:
2871        *     {enforced: false}
2872        *   `projects/bar` has no `Policy` set.
2873        * The constraint at `projects/bar` and `organizations/foo` will not be
2874        * enforced.
2875        * Example 2 (enforcement gets replaced):
2876        *   `organizations/foo` has a `Policy` with:
2877        *     {enforced: false}
2878        *   `projects/bar` has a `Policy` with:
2879        *     {enforced: true}
2880        * The constraint at `organizations/foo` is not enforced.
2881        * The constraint at `projects/bar` is enforced.
2882        * Example 3 (RestoreDefault):
2883        *   `organizations/foo` has a `Policy` with:
2884        *     {enforced: true}
2885        *   `projects/bar` has a `Policy` with:
2886        *     {RestoreDefault: {}}
2887        * The constraint at `organizations/foo` is enforced.
2888        * The constraint at `projects/bar` is not enforced, because
2889        * `constraint_default` for the `Constraint` is `ALLOW`.
2890        * </pre>
2891        *
2892        * <code>bool enforced = 1;</code>
2893        *
2894        * @return The enforced.
2895        */
2896       @java.lang.Override
getEnforced()2897       public boolean getEnforced() {
2898         return enforced_;
2899       }
2900       /**
2901        *
2902        *
2903        * <pre>
2904        * If `true`, then the `Policy` is enforced. If `false`, then any
2905        * configuration is acceptable.
2906        * Suppose you have a `Constraint`
2907        * `constraints/compute.disableSerialPortAccess` with `constraint_default`
2908        * set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following
2909        * behavior:
2910        *   - If the `Policy` at this resource has enforced set to `false`, serial
2911        *     port connection attempts will be allowed.
2912        *   - If the `Policy` at this resource has enforced set to `true`, serial
2913        *     port connection attempts will be refused.
2914        *   - If the `Policy` at this resource is `RestoreDefault`, serial port
2915        *     connection attempts will be allowed.
2916        *   - If no `Policy` is set at this resource or anywhere higher in the
2917        *     resource hierarchy, serial port connection attempts will be allowed.
2918        *   - If no `Policy` is set at this resource, but one exists higher in the
2919        *     resource hierarchy, the behavior is as if the`Policy` were set at
2920        *     this resource.
2921        * The following examples demonstrate the different possible layerings:
2922        * Example 1 (nearest `Constraint` wins):
2923        *   `organizations/foo` has a `Policy` with:
2924        *     {enforced: false}
2925        *   `projects/bar` has no `Policy` set.
2926        * The constraint at `projects/bar` and `organizations/foo` will not be
2927        * enforced.
2928        * Example 2 (enforcement gets replaced):
2929        *   `organizations/foo` has a `Policy` with:
2930        *     {enforced: false}
2931        *   `projects/bar` has a `Policy` with:
2932        *     {enforced: true}
2933        * The constraint at `organizations/foo` is not enforced.
2934        * The constraint at `projects/bar` is enforced.
2935        * Example 3 (RestoreDefault):
2936        *   `organizations/foo` has a `Policy` with:
2937        *     {enforced: true}
2938        *   `projects/bar` has a `Policy` with:
2939        *     {RestoreDefault: {}}
2940        * The constraint at `organizations/foo` is enforced.
2941        * The constraint at `projects/bar` is not enforced, because
2942        * `constraint_default` for the `Constraint` is `ALLOW`.
2943        * </pre>
2944        *
2945        * <code>bool enforced = 1;</code>
2946        *
2947        * @param value The enforced to set.
2948        * @return This builder for chaining.
2949        */
setEnforced(boolean value)2950       public Builder setEnforced(boolean value) {
2951 
2952         enforced_ = value;
2953         bitField0_ |= 0x00000001;
2954         onChanged();
2955         return this;
2956       }
2957       /**
2958        *
2959        *
2960        * <pre>
2961        * If `true`, then the `Policy` is enforced. If `false`, then any
2962        * configuration is acceptable.
2963        * Suppose you have a `Constraint`
2964        * `constraints/compute.disableSerialPortAccess` with `constraint_default`
2965        * set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following
2966        * behavior:
2967        *   - If the `Policy` at this resource has enforced set to `false`, serial
2968        *     port connection attempts will be allowed.
2969        *   - If the `Policy` at this resource has enforced set to `true`, serial
2970        *     port connection attempts will be refused.
2971        *   - If the `Policy` at this resource is `RestoreDefault`, serial port
2972        *     connection attempts will be allowed.
2973        *   - If no `Policy` is set at this resource or anywhere higher in the
2974        *     resource hierarchy, serial port connection attempts will be allowed.
2975        *   - If no `Policy` is set at this resource, but one exists higher in the
2976        *     resource hierarchy, the behavior is as if the`Policy` were set at
2977        *     this resource.
2978        * The following examples demonstrate the different possible layerings:
2979        * Example 1 (nearest `Constraint` wins):
2980        *   `organizations/foo` has a `Policy` with:
2981        *     {enforced: false}
2982        *   `projects/bar` has no `Policy` set.
2983        * The constraint at `projects/bar` and `organizations/foo` will not be
2984        * enforced.
2985        * Example 2 (enforcement gets replaced):
2986        *   `organizations/foo` has a `Policy` with:
2987        *     {enforced: false}
2988        *   `projects/bar` has a `Policy` with:
2989        *     {enforced: true}
2990        * The constraint at `organizations/foo` is not enforced.
2991        * The constraint at `projects/bar` is enforced.
2992        * Example 3 (RestoreDefault):
2993        *   `organizations/foo` has a `Policy` with:
2994        *     {enforced: true}
2995        *   `projects/bar` has a `Policy` with:
2996        *     {RestoreDefault: {}}
2997        * The constraint at `organizations/foo` is enforced.
2998        * The constraint at `projects/bar` is not enforced, because
2999        * `constraint_default` for the `Constraint` is `ALLOW`.
3000        * </pre>
3001        *
3002        * <code>bool enforced = 1;</code>
3003        *
3004        * @return This builder for chaining.
3005        */
clearEnforced()3006       public Builder clearEnforced() {
3007         bitField0_ = (bitField0_ & ~0x00000001);
3008         enforced_ = false;
3009         onChanged();
3010         return this;
3011       }
3012 
3013       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3014       public final Builder setUnknownFields(
3015           final com.google.protobuf.UnknownFieldSet unknownFields) {
3016         return super.setUnknownFields(unknownFields);
3017       }
3018 
3019       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3020       public final Builder mergeUnknownFields(
3021           final com.google.protobuf.UnknownFieldSet unknownFields) {
3022         return super.mergeUnknownFields(unknownFields);
3023       }
3024 
3025       // @@protoc_insertion_point(builder_scope:google.cloud.orgpolicy.v1.Policy.BooleanPolicy)
3026     }
3027 
3028     // @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v1.Policy.BooleanPolicy)
3029     private static final com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy DEFAULT_INSTANCE;
3030 
3031     static {
3032       DEFAULT_INSTANCE = new com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy();
3033     }
3034 
getDefaultInstance()3035     public static com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy getDefaultInstance() {
3036       return DEFAULT_INSTANCE;
3037     }
3038 
3039     private static final com.google.protobuf.Parser<BooleanPolicy> PARSER =
3040         new com.google.protobuf.AbstractParser<BooleanPolicy>() {
3041           @java.lang.Override
3042           public BooleanPolicy parsePartialFrom(
3043               com.google.protobuf.CodedInputStream input,
3044               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3045               throws com.google.protobuf.InvalidProtocolBufferException {
3046             Builder builder = newBuilder();
3047             try {
3048               builder.mergeFrom(input, extensionRegistry);
3049             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
3050               throw e.setUnfinishedMessage(builder.buildPartial());
3051             } catch (com.google.protobuf.UninitializedMessageException e) {
3052               throw e.asInvalidProtocolBufferException()
3053                   .setUnfinishedMessage(builder.buildPartial());
3054             } catch (java.io.IOException e) {
3055               throw new com.google.protobuf.InvalidProtocolBufferException(e)
3056                   .setUnfinishedMessage(builder.buildPartial());
3057             }
3058             return builder.buildPartial();
3059           }
3060         };
3061 
parser()3062     public static com.google.protobuf.Parser<BooleanPolicy> parser() {
3063       return PARSER;
3064     }
3065 
3066     @java.lang.Override
getParserForType()3067     public com.google.protobuf.Parser<BooleanPolicy> getParserForType() {
3068       return PARSER;
3069     }
3070 
3071     @java.lang.Override
getDefaultInstanceForType()3072     public com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy getDefaultInstanceForType() {
3073       return DEFAULT_INSTANCE;
3074     }
3075   }
3076 
3077   public interface RestoreDefaultOrBuilder
3078       extends
3079       // @@protoc_insertion_point(interface_extends:google.cloud.orgpolicy.v1.Policy.RestoreDefault)
3080       com.google.protobuf.MessageOrBuilder {}
3081   /**
3082    *
3083    *
3084    * <pre>
3085    * Ignores policies set above this resource and restores the
3086    * `constraint_default` enforcement behavior of the specific `Constraint` at
3087    * this resource.
3088    * Suppose that `constraint_default` is set to `ALLOW` for the
3089    * `Constraint` `constraints/serviceuser.services`. Suppose that organization
3090    * foo.com sets a `Policy` at their Organization resource node that restricts
3091    * the allowed service activations to deny all service activations. They
3092    * could then set a `Policy` with the `policy_type` `restore_default` on
3093    * several experimental projects, restoring the `constraint_default`
3094    * enforcement of the `Constraint` for only those projects, allowing those
3095    * projects to have all services activated.
3096    * </pre>
3097    *
3098    * Protobuf type {@code google.cloud.orgpolicy.v1.Policy.RestoreDefault}
3099    */
3100   public static final class RestoreDefault extends com.google.protobuf.GeneratedMessageV3
3101       implements
3102       // @@protoc_insertion_point(message_implements:google.cloud.orgpolicy.v1.Policy.RestoreDefault)
3103       RestoreDefaultOrBuilder {
3104     private static final long serialVersionUID = 0L;
3105     // Use RestoreDefault.newBuilder() to construct.
RestoreDefault(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)3106     private RestoreDefault(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
3107       super(builder);
3108     }
3109 
RestoreDefault()3110     private RestoreDefault() {}
3111 
3112     @java.lang.Override
3113     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)3114     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
3115       return new RestoreDefault();
3116     }
3117 
3118     @java.lang.Override
getUnknownFields()3119     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
3120       return this.unknownFields;
3121     }
3122 
getDescriptor()3123     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
3124       return com.google.cloud.orgpolicy.v1.OrgPolicyProto
3125           .internal_static_google_cloud_orgpolicy_v1_Policy_RestoreDefault_descriptor;
3126     }
3127 
3128     @java.lang.Override
3129     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()3130         internalGetFieldAccessorTable() {
3131       return com.google.cloud.orgpolicy.v1.OrgPolicyProto
3132           .internal_static_google_cloud_orgpolicy_v1_Policy_RestoreDefault_fieldAccessorTable
3133           .ensureFieldAccessorsInitialized(
3134               com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.class,
3135               com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.Builder.class);
3136     }
3137 
3138     private byte memoizedIsInitialized = -1;
3139 
3140     @java.lang.Override
isInitialized()3141     public final boolean isInitialized() {
3142       byte isInitialized = memoizedIsInitialized;
3143       if (isInitialized == 1) return true;
3144       if (isInitialized == 0) return false;
3145 
3146       memoizedIsInitialized = 1;
3147       return true;
3148     }
3149 
3150     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)3151     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
3152       getUnknownFields().writeTo(output);
3153     }
3154 
3155     @java.lang.Override
getSerializedSize()3156     public int getSerializedSize() {
3157       int size = memoizedSize;
3158       if (size != -1) return size;
3159 
3160       size = 0;
3161       size += getUnknownFields().getSerializedSize();
3162       memoizedSize = size;
3163       return size;
3164     }
3165 
3166     @java.lang.Override
equals(final java.lang.Object obj)3167     public boolean equals(final java.lang.Object obj) {
3168       if (obj == this) {
3169         return true;
3170       }
3171       if (!(obj instanceof com.google.cloud.orgpolicy.v1.Policy.RestoreDefault)) {
3172         return super.equals(obj);
3173       }
3174       com.google.cloud.orgpolicy.v1.Policy.RestoreDefault other =
3175           (com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) obj;
3176 
3177       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
3178       return true;
3179     }
3180 
3181     @java.lang.Override
hashCode()3182     public int hashCode() {
3183       if (memoizedHashCode != 0) {
3184         return memoizedHashCode;
3185       }
3186       int hash = 41;
3187       hash = (19 * hash) + getDescriptor().hashCode();
3188       hash = (29 * hash) + getUnknownFields().hashCode();
3189       memoizedHashCode = hash;
3190       return hash;
3191     }
3192 
parseFrom( java.nio.ByteBuffer data)3193     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseFrom(
3194         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
3195       return PARSER.parseFrom(data);
3196     }
3197 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3198     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseFrom(
3199         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3200         throws com.google.protobuf.InvalidProtocolBufferException {
3201       return PARSER.parseFrom(data, extensionRegistry);
3202     }
3203 
parseFrom( com.google.protobuf.ByteString data)3204     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseFrom(
3205         com.google.protobuf.ByteString data)
3206         throws com.google.protobuf.InvalidProtocolBufferException {
3207       return PARSER.parseFrom(data);
3208     }
3209 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3210     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseFrom(
3211         com.google.protobuf.ByteString data,
3212         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3213         throws com.google.protobuf.InvalidProtocolBufferException {
3214       return PARSER.parseFrom(data, extensionRegistry);
3215     }
3216 
parseFrom(byte[] data)3217     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseFrom(byte[] data)
3218         throws com.google.protobuf.InvalidProtocolBufferException {
3219       return PARSER.parseFrom(data);
3220     }
3221 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3222     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseFrom(
3223         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3224         throws com.google.protobuf.InvalidProtocolBufferException {
3225       return PARSER.parseFrom(data, extensionRegistry);
3226     }
3227 
parseFrom( java.io.InputStream input)3228     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseFrom(
3229         java.io.InputStream input) throws java.io.IOException {
3230       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
3231     }
3232 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3233     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseFrom(
3234         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3235         throws java.io.IOException {
3236       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
3237           PARSER, input, extensionRegistry);
3238     }
3239 
parseDelimitedFrom( java.io.InputStream input)3240     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseDelimitedFrom(
3241         java.io.InputStream input) throws java.io.IOException {
3242       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
3243     }
3244 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3245     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseDelimitedFrom(
3246         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3247         throws java.io.IOException {
3248       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
3249           PARSER, input, extensionRegistry);
3250     }
3251 
parseFrom( com.google.protobuf.CodedInputStream input)3252     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseFrom(
3253         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
3254       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
3255     }
3256 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3257     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault parseFrom(
3258         com.google.protobuf.CodedInputStream input,
3259         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3260         throws java.io.IOException {
3261       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
3262           PARSER, input, extensionRegistry);
3263     }
3264 
3265     @java.lang.Override
newBuilderForType()3266     public Builder newBuilderForType() {
3267       return newBuilder();
3268     }
3269 
newBuilder()3270     public static Builder newBuilder() {
3271       return DEFAULT_INSTANCE.toBuilder();
3272     }
3273 
newBuilder( com.google.cloud.orgpolicy.v1.Policy.RestoreDefault prototype)3274     public static Builder newBuilder(
3275         com.google.cloud.orgpolicy.v1.Policy.RestoreDefault prototype) {
3276       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
3277     }
3278 
3279     @java.lang.Override
toBuilder()3280     public Builder toBuilder() {
3281       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
3282     }
3283 
3284     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)3285     protected Builder newBuilderForType(
3286         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
3287       Builder builder = new Builder(parent);
3288       return builder;
3289     }
3290     /**
3291      *
3292      *
3293      * <pre>
3294      * Ignores policies set above this resource and restores the
3295      * `constraint_default` enforcement behavior of the specific `Constraint` at
3296      * this resource.
3297      * Suppose that `constraint_default` is set to `ALLOW` for the
3298      * `Constraint` `constraints/serviceuser.services`. Suppose that organization
3299      * foo.com sets a `Policy` at their Organization resource node that restricts
3300      * the allowed service activations to deny all service activations. They
3301      * could then set a `Policy` with the `policy_type` `restore_default` on
3302      * several experimental projects, restoring the `constraint_default`
3303      * enforcement of the `Constraint` for only those projects, allowing those
3304      * projects to have all services activated.
3305      * </pre>
3306      *
3307      * Protobuf type {@code google.cloud.orgpolicy.v1.Policy.RestoreDefault}
3308      */
3309     public static final class Builder
3310         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
3311         implements
3312         // @@protoc_insertion_point(builder_implements:google.cloud.orgpolicy.v1.Policy.RestoreDefault)
3313         com.google.cloud.orgpolicy.v1.Policy.RestoreDefaultOrBuilder {
getDescriptor()3314       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
3315         return com.google.cloud.orgpolicy.v1.OrgPolicyProto
3316             .internal_static_google_cloud_orgpolicy_v1_Policy_RestoreDefault_descriptor;
3317       }
3318 
3319       @java.lang.Override
3320       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()3321           internalGetFieldAccessorTable() {
3322         return com.google.cloud.orgpolicy.v1.OrgPolicyProto
3323             .internal_static_google_cloud_orgpolicy_v1_Policy_RestoreDefault_fieldAccessorTable
3324             .ensureFieldAccessorsInitialized(
3325                 com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.class,
3326                 com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.Builder.class);
3327       }
3328 
3329       // Construct using com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.newBuilder()
Builder()3330       private Builder() {}
3331 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)3332       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
3333         super(parent);
3334       }
3335 
3336       @java.lang.Override
clear()3337       public Builder clear() {
3338         super.clear();
3339         return this;
3340       }
3341 
3342       @java.lang.Override
getDescriptorForType()3343       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
3344         return com.google.cloud.orgpolicy.v1.OrgPolicyProto
3345             .internal_static_google_cloud_orgpolicy_v1_Policy_RestoreDefault_descriptor;
3346       }
3347 
3348       @java.lang.Override
getDefaultInstanceForType()3349       public com.google.cloud.orgpolicy.v1.Policy.RestoreDefault getDefaultInstanceForType() {
3350         return com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.getDefaultInstance();
3351       }
3352 
3353       @java.lang.Override
build()3354       public com.google.cloud.orgpolicy.v1.Policy.RestoreDefault build() {
3355         com.google.cloud.orgpolicy.v1.Policy.RestoreDefault result = buildPartial();
3356         if (!result.isInitialized()) {
3357           throw newUninitializedMessageException(result);
3358         }
3359         return result;
3360       }
3361 
3362       @java.lang.Override
buildPartial()3363       public com.google.cloud.orgpolicy.v1.Policy.RestoreDefault buildPartial() {
3364         com.google.cloud.orgpolicy.v1.Policy.RestoreDefault result =
3365             new com.google.cloud.orgpolicy.v1.Policy.RestoreDefault(this);
3366         onBuilt();
3367         return result;
3368       }
3369 
3370       @java.lang.Override
clone()3371       public Builder clone() {
3372         return super.clone();
3373       }
3374 
3375       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)3376       public Builder setField(
3377           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
3378         return super.setField(field, value);
3379       }
3380 
3381       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)3382       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
3383         return super.clearField(field);
3384       }
3385 
3386       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)3387       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
3388         return super.clearOneof(oneof);
3389       }
3390 
3391       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)3392       public Builder setRepeatedField(
3393           com.google.protobuf.Descriptors.FieldDescriptor field,
3394           int index,
3395           java.lang.Object value) {
3396         return super.setRepeatedField(field, index, value);
3397       }
3398 
3399       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)3400       public Builder addRepeatedField(
3401           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
3402         return super.addRepeatedField(field, value);
3403       }
3404 
3405       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)3406       public Builder mergeFrom(com.google.protobuf.Message other) {
3407         if (other instanceof com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) {
3408           return mergeFrom((com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) other);
3409         } else {
3410           super.mergeFrom(other);
3411           return this;
3412         }
3413       }
3414 
mergeFrom(com.google.cloud.orgpolicy.v1.Policy.RestoreDefault other)3415       public Builder mergeFrom(com.google.cloud.orgpolicy.v1.Policy.RestoreDefault other) {
3416         if (other == com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.getDefaultInstance())
3417           return this;
3418         this.mergeUnknownFields(other.getUnknownFields());
3419         onChanged();
3420         return this;
3421       }
3422 
3423       @java.lang.Override
isInitialized()3424       public final boolean isInitialized() {
3425         return true;
3426       }
3427 
3428       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3429       public Builder mergeFrom(
3430           com.google.protobuf.CodedInputStream input,
3431           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3432           throws java.io.IOException {
3433         if (extensionRegistry == null) {
3434           throw new java.lang.NullPointerException();
3435         }
3436         try {
3437           boolean done = false;
3438           while (!done) {
3439             int tag = input.readTag();
3440             switch (tag) {
3441               case 0:
3442                 done = true;
3443                 break;
3444               default:
3445                 {
3446                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
3447                     done = true; // was an endgroup tag
3448                   }
3449                   break;
3450                 } // default:
3451             } // switch (tag)
3452           } // while (!done)
3453         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
3454           throw e.unwrapIOException();
3455         } finally {
3456           onChanged();
3457         } // finally
3458         return this;
3459       }
3460 
3461       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3462       public final Builder setUnknownFields(
3463           final com.google.protobuf.UnknownFieldSet unknownFields) {
3464         return super.setUnknownFields(unknownFields);
3465       }
3466 
3467       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3468       public final Builder mergeUnknownFields(
3469           final com.google.protobuf.UnknownFieldSet unknownFields) {
3470         return super.mergeUnknownFields(unknownFields);
3471       }
3472 
3473       // @@protoc_insertion_point(builder_scope:google.cloud.orgpolicy.v1.Policy.RestoreDefault)
3474     }
3475 
3476     // @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v1.Policy.RestoreDefault)
3477     private static final com.google.cloud.orgpolicy.v1.Policy.RestoreDefault DEFAULT_INSTANCE;
3478 
3479     static {
3480       DEFAULT_INSTANCE = new com.google.cloud.orgpolicy.v1.Policy.RestoreDefault();
3481     }
3482 
getDefaultInstance()3483     public static com.google.cloud.orgpolicy.v1.Policy.RestoreDefault getDefaultInstance() {
3484       return DEFAULT_INSTANCE;
3485     }
3486 
3487     private static final com.google.protobuf.Parser<RestoreDefault> PARSER =
3488         new com.google.protobuf.AbstractParser<RestoreDefault>() {
3489           @java.lang.Override
3490           public RestoreDefault parsePartialFrom(
3491               com.google.protobuf.CodedInputStream input,
3492               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3493               throws com.google.protobuf.InvalidProtocolBufferException {
3494             Builder builder = newBuilder();
3495             try {
3496               builder.mergeFrom(input, extensionRegistry);
3497             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
3498               throw e.setUnfinishedMessage(builder.buildPartial());
3499             } catch (com.google.protobuf.UninitializedMessageException e) {
3500               throw e.asInvalidProtocolBufferException()
3501                   .setUnfinishedMessage(builder.buildPartial());
3502             } catch (java.io.IOException e) {
3503               throw new com.google.protobuf.InvalidProtocolBufferException(e)
3504                   .setUnfinishedMessage(builder.buildPartial());
3505             }
3506             return builder.buildPartial();
3507           }
3508         };
3509 
parser()3510     public static com.google.protobuf.Parser<RestoreDefault> parser() {
3511       return PARSER;
3512     }
3513 
3514     @java.lang.Override
getParserForType()3515     public com.google.protobuf.Parser<RestoreDefault> getParserForType() {
3516       return PARSER;
3517     }
3518 
3519     @java.lang.Override
getDefaultInstanceForType()3520     public com.google.cloud.orgpolicy.v1.Policy.RestoreDefault getDefaultInstanceForType() {
3521       return DEFAULT_INSTANCE;
3522     }
3523   }
3524 
3525   private int policyTypeCase_ = 0;
3526   private java.lang.Object policyType_;
3527 
3528   public enum PolicyTypeCase
3529       implements
3530           com.google.protobuf.Internal.EnumLite,
3531           com.google.protobuf.AbstractMessage.InternalOneOfEnum {
3532     LIST_POLICY(5),
3533     BOOLEAN_POLICY(6),
3534     RESTORE_DEFAULT(7),
3535     POLICYTYPE_NOT_SET(0);
3536     private final int value;
3537 
PolicyTypeCase(int value)3538     private PolicyTypeCase(int value) {
3539       this.value = value;
3540     }
3541     /**
3542      * @param value The number of the enum to look for.
3543      * @return The enum associated with the given number.
3544      * @deprecated Use {@link #forNumber(int)} instead.
3545      */
3546     @java.lang.Deprecated
valueOf(int value)3547     public static PolicyTypeCase valueOf(int value) {
3548       return forNumber(value);
3549     }
3550 
forNumber(int value)3551     public static PolicyTypeCase forNumber(int value) {
3552       switch (value) {
3553         case 5:
3554           return LIST_POLICY;
3555         case 6:
3556           return BOOLEAN_POLICY;
3557         case 7:
3558           return RESTORE_DEFAULT;
3559         case 0:
3560           return POLICYTYPE_NOT_SET;
3561         default:
3562           return null;
3563       }
3564     }
3565 
getNumber()3566     public int getNumber() {
3567       return this.value;
3568     }
3569   };
3570 
getPolicyTypeCase()3571   public PolicyTypeCase getPolicyTypeCase() {
3572     return PolicyTypeCase.forNumber(policyTypeCase_);
3573   }
3574 
3575   public static final int VERSION_FIELD_NUMBER = 1;
3576   private int version_ = 0;
3577   /**
3578    *
3579    *
3580    * <pre>
3581    * Version of the `Policy`. Default version is 0;
3582    * </pre>
3583    *
3584    * <code>int32 version = 1;</code>
3585    *
3586    * @return The version.
3587    */
3588   @java.lang.Override
getVersion()3589   public int getVersion() {
3590     return version_;
3591   }
3592 
3593   public static final int CONSTRAINT_FIELD_NUMBER = 2;
3594 
3595   @SuppressWarnings("serial")
3596   private volatile java.lang.Object constraint_ = "";
3597   /**
3598    *
3599    *
3600    * <pre>
3601    * The name of the `Constraint` the `Policy` is configuring, for example,
3602    * `constraints/serviceuser.services`.
3603    * Immutable after creation.
3604    * </pre>
3605    *
3606    * <code>string constraint = 2;</code>
3607    *
3608    * @return The constraint.
3609    */
3610   @java.lang.Override
getConstraint()3611   public java.lang.String getConstraint() {
3612     java.lang.Object ref = constraint_;
3613     if (ref instanceof java.lang.String) {
3614       return (java.lang.String) ref;
3615     } else {
3616       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
3617       java.lang.String s = bs.toStringUtf8();
3618       constraint_ = s;
3619       return s;
3620     }
3621   }
3622   /**
3623    *
3624    *
3625    * <pre>
3626    * The name of the `Constraint` the `Policy` is configuring, for example,
3627    * `constraints/serviceuser.services`.
3628    * Immutable after creation.
3629    * </pre>
3630    *
3631    * <code>string constraint = 2;</code>
3632    *
3633    * @return The bytes for constraint.
3634    */
3635   @java.lang.Override
getConstraintBytes()3636   public com.google.protobuf.ByteString getConstraintBytes() {
3637     java.lang.Object ref = constraint_;
3638     if (ref instanceof java.lang.String) {
3639       com.google.protobuf.ByteString b =
3640           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
3641       constraint_ = b;
3642       return b;
3643     } else {
3644       return (com.google.protobuf.ByteString) ref;
3645     }
3646   }
3647 
3648   public static final int ETAG_FIELD_NUMBER = 3;
3649   private com.google.protobuf.ByteString etag_ = com.google.protobuf.ByteString.EMPTY;
3650   /**
3651    *
3652    *
3653    * <pre>
3654    * An opaque tag indicating the current version of the `Policy`, used for
3655    * concurrency control.
3656    * When the `Policy` is returned from either a `GetPolicy` or a
3657    * `ListOrgPolicy` request, this `etag` indicates the version of the current
3658    * `Policy` to use when executing a read-modify-write loop.
3659    * When the `Policy` is returned from a `GetEffectivePolicy` request, the
3660    * `etag` will be unset.
3661    * When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value
3662    * that was returned from a `GetOrgPolicy` request as part of a
3663    * read-modify-write loop for concurrency control. Not setting the `etag`in a
3664    * `SetOrgPolicy` request will result in an unconditional write of the
3665    * `Policy`.
3666    * </pre>
3667    *
3668    * <code>bytes etag = 3;</code>
3669    *
3670    * @return The etag.
3671    */
3672   @java.lang.Override
getEtag()3673   public com.google.protobuf.ByteString getEtag() {
3674     return etag_;
3675   }
3676 
3677   public static final int UPDATE_TIME_FIELD_NUMBER = 4;
3678   private com.google.protobuf.Timestamp updateTime_;
3679   /**
3680    *
3681    *
3682    * <pre>
3683    * The time stamp the `Policy` was previously updated. This is set by the
3684    * server, not specified by the caller, and represents the last time a call to
3685    * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
3686    * be ignored.
3687    * </pre>
3688    *
3689    * <code>.google.protobuf.Timestamp update_time = 4;</code>
3690    *
3691    * @return Whether the updateTime field is set.
3692    */
3693   @java.lang.Override
hasUpdateTime()3694   public boolean hasUpdateTime() {
3695     return updateTime_ != null;
3696   }
3697   /**
3698    *
3699    *
3700    * <pre>
3701    * The time stamp the `Policy` was previously updated. This is set by the
3702    * server, not specified by the caller, and represents the last time a call to
3703    * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
3704    * be ignored.
3705    * </pre>
3706    *
3707    * <code>.google.protobuf.Timestamp update_time = 4;</code>
3708    *
3709    * @return The updateTime.
3710    */
3711   @java.lang.Override
getUpdateTime()3712   public com.google.protobuf.Timestamp getUpdateTime() {
3713     return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
3714   }
3715   /**
3716    *
3717    *
3718    * <pre>
3719    * The time stamp the `Policy` was previously updated. This is set by the
3720    * server, not specified by the caller, and represents the last time a call to
3721    * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
3722    * be ignored.
3723    * </pre>
3724    *
3725    * <code>.google.protobuf.Timestamp update_time = 4;</code>
3726    */
3727   @java.lang.Override
getUpdateTimeOrBuilder()3728   public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
3729     return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
3730   }
3731 
3732   public static final int LIST_POLICY_FIELD_NUMBER = 5;
3733   /**
3734    *
3735    *
3736    * <pre>
3737    * List of values either allowed or disallowed.
3738    * </pre>
3739    *
3740    * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
3741    *
3742    * @return Whether the listPolicy field is set.
3743    */
3744   @java.lang.Override
hasListPolicy()3745   public boolean hasListPolicy() {
3746     return policyTypeCase_ == 5;
3747   }
3748   /**
3749    *
3750    *
3751    * <pre>
3752    * List of values either allowed or disallowed.
3753    * </pre>
3754    *
3755    * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
3756    *
3757    * @return The listPolicy.
3758    */
3759   @java.lang.Override
getListPolicy()3760   public com.google.cloud.orgpolicy.v1.Policy.ListPolicy getListPolicy() {
3761     if (policyTypeCase_ == 5) {
3762       return (com.google.cloud.orgpolicy.v1.Policy.ListPolicy) policyType_;
3763     }
3764     return com.google.cloud.orgpolicy.v1.Policy.ListPolicy.getDefaultInstance();
3765   }
3766   /**
3767    *
3768    *
3769    * <pre>
3770    * List of values either allowed or disallowed.
3771    * </pre>
3772    *
3773    * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
3774    */
3775   @java.lang.Override
getListPolicyOrBuilder()3776   public com.google.cloud.orgpolicy.v1.Policy.ListPolicyOrBuilder getListPolicyOrBuilder() {
3777     if (policyTypeCase_ == 5) {
3778       return (com.google.cloud.orgpolicy.v1.Policy.ListPolicy) policyType_;
3779     }
3780     return com.google.cloud.orgpolicy.v1.Policy.ListPolicy.getDefaultInstance();
3781   }
3782 
3783   public static final int BOOLEAN_POLICY_FIELD_NUMBER = 6;
3784   /**
3785    *
3786    *
3787    * <pre>
3788    * For boolean `Constraints`, whether to enforce the `Constraint` or not.
3789    * </pre>
3790    *
3791    * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
3792    *
3793    * @return Whether the booleanPolicy field is set.
3794    */
3795   @java.lang.Override
hasBooleanPolicy()3796   public boolean hasBooleanPolicy() {
3797     return policyTypeCase_ == 6;
3798   }
3799   /**
3800    *
3801    *
3802    * <pre>
3803    * For boolean `Constraints`, whether to enforce the `Constraint` or not.
3804    * </pre>
3805    *
3806    * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
3807    *
3808    * @return The booleanPolicy.
3809    */
3810   @java.lang.Override
getBooleanPolicy()3811   public com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy getBooleanPolicy() {
3812     if (policyTypeCase_ == 6) {
3813       return (com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) policyType_;
3814     }
3815     return com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.getDefaultInstance();
3816   }
3817   /**
3818    *
3819    *
3820    * <pre>
3821    * For boolean `Constraints`, whether to enforce the `Constraint` or not.
3822    * </pre>
3823    *
3824    * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
3825    */
3826   @java.lang.Override
getBooleanPolicyOrBuilder()3827   public com.google.cloud.orgpolicy.v1.Policy.BooleanPolicyOrBuilder getBooleanPolicyOrBuilder() {
3828     if (policyTypeCase_ == 6) {
3829       return (com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) policyType_;
3830     }
3831     return com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.getDefaultInstance();
3832   }
3833 
3834   public static final int RESTORE_DEFAULT_FIELD_NUMBER = 7;
3835   /**
3836    *
3837    *
3838    * <pre>
3839    * Restores the default behavior of the constraint; independent of
3840    * `Constraint` type.
3841    * </pre>
3842    *
3843    * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
3844    *
3845    * @return Whether the restoreDefault field is set.
3846    */
3847   @java.lang.Override
hasRestoreDefault()3848   public boolean hasRestoreDefault() {
3849     return policyTypeCase_ == 7;
3850   }
3851   /**
3852    *
3853    *
3854    * <pre>
3855    * Restores the default behavior of the constraint; independent of
3856    * `Constraint` type.
3857    * </pre>
3858    *
3859    * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
3860    *
3861    * @return The restoreDefault.
3862    */
3863   @java.lang.Override
getRestoreDefault()3864   public com.google.cloud.orgpolicy.v1.Policy.RestoreDefault getRestoreDefault() {
3865     if (policyTypeCase_ == 7) {
3866       return (com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) policyType_;
3867     }
3868     return com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.getDefaultInstance();
3869   }
3870   /**
3871    *
3872    *
3873    * <pre>
3874    * Restores the default behavior of the constraint; independent of
3875    * `Constraint` type.
3876    * </pre>
3877    *
3878    * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
3879    */
3880   @java.lang.Override
getRestoreDefaultOrBuilder()3881   public com.google.cloud.orgpolicy.v1.Policy.RestoreDefaultOrBuilder getRestoreDefaultOrBuilder() {
3882     if (policyTypeCase_ == 7) {
3883       return (com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) policyType_;
3884     }
3885     return com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.getDefaultInstance();
3886   }
3887 
3888   private byte memoizedIsInitialized = -1;
3889 
3890   @java.lang.Override
isInitialized()3891   public final boolean isInitialized() {
3892     byte isInitialized = memoizedIsInitialized;
3893     if (isInitialized == 1) return true;
3894     if (isInitialized == 0) return false;
3895 
3896     memoizedIsInitialized = 1;
3897     return true;
3898   }
3899 
3900   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)3901   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
3902     if (version_ != 0) {
3903       output.writeInt32(1, version_);
3904     }
3905     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(constraint_)) {
3906       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, constraint_);
3907     }
3908     if (!etag_.isEmpty()) {
3909       output.writeBytes(3, etag_);
3910     }
3911     if (updateTime_ != null) {
3912       output.writeMessage(4, getUpdateTime());
3913     }
3914     if (policyTypeCase_ == 5) {
3915       output.writeMessage(5, (com.google.cloud.orgpolicy.v1.Policy.ListPolicy) policyType_);
3916     }
3917     if (policyTypeCase_ == 6) {
3918       output.writeMessage(6, (com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) policyType_);
3919     }
3920     if (policyTypeCase_ == 7) {
3921       output.writeMessage(7, (com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) policyType_);
3922     }
3923     getUnknownFields().writeTo(output);
3924   }
3925 
3926   @java.lang.Override
getSerializedSize()3927   public int getSerializedSize() {
3928     int size = memoizedSize;
3929     if (size != -1) return size;
3930 
3931     size = 0;
3932     if (version_ != 0) {
3933       size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, version_);
3934     }
3935     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(constraint_)) {
3936       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, constraint_);
3937     }
3938     if (!etag_.isEmpty()) {
3939       size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, etag_);
3940     }
3941     if (updateTime_ != null) {
3942       size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime());
3943     }
3944     if (policyTypeCase_ == 5) {
3945       size +=
3946           com.google.protobuf.CodedOutputStream.computeMessageSize(
3947               5, (com.google.cloud.orgpolicy.v1.Policy.ListPolicy) policyType_);
3948     }
3949     if (policyTypeCase_ == 6) {
3950       size +=
3951           com.google.protobuf.CodedOutputStream.computeMessageSize(
3952               6, (com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) policyType_);
3953     }
3954     if (policyTypeCase_ == 7) {
3955       size +=
3956           com.google.protobuf.CodedOutputStream.computeMessageSize(
3957               7, (com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) policyType_);
3958     }
3959     size += getUnknownFields().getSerializedSize();
3960     memoizedSize = size;
3961     return size;
3962   }
3963 
3964   @java.lang.Override
equals(final java.lang.Object obj)3965   public boolean equals(final java.lang.Object obj) {
3966     if (obj == this) {
3967       return true;
3968     }
3969     if (!(obj instanceof com.google.cloud.orgpolicy.v1.Policy)) {
3970       return super.equals(obj);
3971     }
3972     com.google.cloud.orgpolicy.v1.Policy other = (com.google.cloud.orgpolicy.v1.Policy) obj;
3973 
3974     if (getVersion() != other.getVersion()) return false;
3975     if (!getConstraint().equals(other.getConstraint())) return false;
3976     if (!getEtag().equals(other.getEtag())) return false;
3977     if (hasUpdateTime() != other.hasUpdateTime()) return false;
3978     if (hasUpdateTime()) {
3979       if (!getUpdateTime().equals(other.getUpdateTime())) return false;
3980     }
3981     if (!getPolicyTypeCase().equals(other.getPolicyTypeCase())) return false;
3982     switch (policyTypeCase_) {
3983       case 5:
3984         if (!getListPolicy().equals(other.getListPolicy())) return false;
3985         break;
3986       case 6:
3987         if (!getBooleanPolicy().equals(other.getBooleanPolicy())) return false;
3988         break;
3989       case 7:
3990         if (!getRestoreDefault().equals(other.getRestoreDefault())) return false;
3991         break;
3992       case 0:
3993       default:
3994     }
3995     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
3996     return true;
3997   }
3998 
3999   @java.lang.Override
hashCode()4000   public int hashCode() {
4001     if (memoizedHashCode != 0) {
4002       return memoizedHashCode;
4003     }
4004     int hash = 41;
4005     hash = (19 * hash) + getDescriptor().hashCode();
4006     hash = (37 * hash) + VERSION_FIELD_NUMBER;
4007     hash = (53 * hash) + getVersion();
4008     hash = (37 * hash) + CONSTRAINT_FIELD_NUMBER;
4009     hash = (53 * hash) + getConstraint().hashCode();
4010     hash = (37 * hash) + ETAG_FIELD_NUMBER;
4011     hash = (53 * hash) + getEtag().hashCode();
4012     if (hasUpdateTime()) {
4013       hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER;
4014       hash = (53 * hash) + getUpdateTime().hashCode();
4015     }
4016     switch (policyTypeCase_) {
4017       case 5:
4018         hash = (37 * hash) + LIST_POLICY_FIELD_NUMBER;
4019         hash = (53 * hash) + getListPolicy().hashCode();
4020         break;
4021       case 6:
4022         hash = (37 * hash) + BOOLEAN_POLICY_FIELD_NUMBER;
4023         hash = (53 * hash) + getBooleanPolicy().hashCode();
4024         break;
4025       case 7:
4026         hash = (37 * hash) + RESTORE_DEFAULT_FIELD_NUMBER;
4027         hash = (53 * hash) + getRestoreDefault().hashCode();
4028         break;
4029       case 0:
4030       default:
4031     }
4032     hash = (29 * hash) + getUnknownFields().hashCode();
4033     memoizedHashCode = hash;
4034     return hash;
4035   }
4036 
parseFrom(java.nio.ByteBuffer data)4037   public static com.google.cloud.orgpolicy.v1.Policy parseFrom(java.nio.ByteBuffer data)
4038       throws com.google.protobuf.InvalidProtocolBufferException {
4039     return PARSER.parseFrom(data);
4040   }
4041 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)4042   public static com.google.cloud.orgpolicy.v1.Policy parseFrom(
4043       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4044       throws com.google.protobuf.InvalidProtocolBufferException {
4045     return PARSER.parseFrom(data, extensionRegistry);
4046   }
4047 
parseFrom(com.google.protobuf.ByteString data)4048   public static com.google.cloud.orgpolicy.v1.Policy parseFrom(com.google.protobuf.ByteString data)
4049       throws com.google.protobuf.InvalidProtocolBufferException {
4050     return PARSER.parseFrom(data);
4051   }
4052 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)4053   public static com.google.cloud.orgpolicy.v1.Policy parseFrom(
4054       com.google.protobuf.ByteString data,
4055       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4056       throws com.google.protobuf.InvalidProtocolBufferException {
4057     return PARSER.parseFrom(data, extensionRegistry);
4058   }
4059 
parseFrom(byte[] data)4060   public static com.google.cloud.orgpolicy.v1.Policy parseFrom(byte[] data)
4061       throws com.google.protobuf.InvalidProtocolBufferException {
4062     return PARSER.parseFrom(data);
4063   }
4064 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)4065   public static com.google.cloud.orgpolicy.v1.Policy parseFrom(
4066       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4067       throws com.google.protobuf.InvalidProtocolBufferException {
4068     return PARSER.parseFrom(data, extensionRegistry);
4069   }
4070 
parseFrom(java.io.InputStream input)4071   public static com.google.cloud.orgpolicy.v1.Policy parseFrom(java.io.InputStream input)
4072       throws java.io.IOException {
4073     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
4074   }
4075 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)4076   public static com.google.cloud.orgpolicy.v1.Policy parseFrom(
4077       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4078       throws java.io.IOException {
4079     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
4080         PARSER, input, extensionRegistry);
4081   }
4082 
parseDelimitedFrom(java.io.InputStream input)4083   public static com.google.cloud.orgpolicy.v1.Policy parseDelimitedFrom(java.io.InputStream input)
4084       throws java.io.IOException {
4085     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
4086   }
4087 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)4088   public static com.google.cloud.orgpolicy.v1.Policy parseDelimitedFrom(
4089       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4090       throws java.io.IOException {
4091     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
4092         PARSER, input, extensionRegistry);
4093   }
4094 
parseFrom( com.google.protobuf.CodedInputStream input)4095   public static com.google.cloud.orgpolicy.v1.Policy parseFrom(
4096       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
4097     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
4098   }
4099 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)4100   public static com.google.cloud.orgpolicy.v1.Policy parseFrom(
4101       com.google.protobuf.CodedInputStream input,
4102       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4103       throws java.io.IOException {
4104     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
4105         PARSER, input, extensionRegistry);
4106   }
4107 
4108   @java.lang.Override
newBuilderForType()4109   public Builder newBuilderForType() {
4110     return newBuilder();
4111   }
4112 
newBuilder()4113   public static Builder newBuilder() {
4114     return DEFAULT_INSTANCE.toBuilder();
4115   }
4116 
newBuilder(com.google.cloud.orgpolicy.v1.Policy prototype)4117   public static Builder newBuilder(com.google.cloud.orgpolicy.v1.Policy prototype) {
4118     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
4119   }
4120 
4121   @java.lang.Override
toBuilder()4122   public Builder toBuilder() {
4123     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
4124   }
4125 
4126   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)4127   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
4128     Builder builder = new Builder(parent);
4129     return builder;
4130   }
4131   /**
4132    *
4133    *
4134    * <pre>
4135    * Defines a Cloud Organization `Policy` which is used to specify `Constraints`
4136    * for configurations of Cloud Platform resources.
4137    * </pre>
4138    *
4139    * Protobuf type {@code google.cloud.orgpolicy.v1.Policy}
4140    */
4141   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
4142       implements
4143       // @@protoc_insertion_point(builder_implements:google.cloud.orgpolicy.v1.Policy)
4144       com.google.cloud.orgpolicy.v1.PolicyOrBuilder {
getDescriptor()4145     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
4146       return com.google.cloud.orgpolicy.v1.OrgPolicyProto
4147           .internal_static_google_cloud_orgpolicy_v1_Policy_descriptor;
4148     }
4149 
4150     @java.lang.Override
4151     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()4152         internalGetFieldAccessorTable() {
4153       return com.google.cloud.orgpolicy.v1.OrgPolicyProto
4154           .internal_static_google_cloud_orgpolicy_v1_Policy_fieldAccessorTable
4155           .ensureFieldAccessorsInitialized(
4156               com.google.cloud.orgpolicy.v1.Policy.class,
4157               com.google.cloud.orgpolicy.v1.Policy.Builder.class);
4158     }
4159 
4160     // Construct using com.google.cloud.orgpolicy.v1.Policy.newBuilder()
Builder()4161     private Builder() {}
4162 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)4163     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
4164       super(parent);
4165     }
4166 
4167     @java.lang.Override
clear()4168     public Builder clear() {
4169       super.clear();
4170       bitField0_ = 0;
4171       version_ = 0;
4172       constraint_ = "";
4173       etag_ = com.google.protobuf.ByteString.EMPTY;
4174       updateTime_ = null;
4175       if (updateTimeBuilder_ != null) {
4176         updateTimeBuilder_.dispose();
4177         updateTimeBuilder_ = null;
4178       }
4179       if (listPolicyBuilder_ != null) {
4180         listPolicyBuilder_.clear();
4181       }
4182       if (booleanPolicyBuilder_ != null) {
4183         booleanPolicyBuilder_.clear();
4184       }
4185       if (restoreDefaultBuilder_ != null) {
4186         restoreDefaultBuilder_.clear();
4187       }
4188       policyTypeCase_ = 0;
4189       policyType_ = null;
4190       return this;
4191     }
4192 
4193     @java.lang.Override
getDescriptorForType()4194     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
4195       return com.google.cloud.orgpolicy.v1.OrgPolicyProto
4196           .internal_static_google_cloud_orgpolicy_v1_Policy_descriptor;
4197     }
4198 
4199     @java.lang.Override
getDefaultInstanceForType()4200     public com.google.cloud.orgpolicy.v1.Policy getDefaultInstanceForType() {
4201       return com.google.cloud.orgpolicy.v1.Policy.getDefaultInstance();
4202     }
4203 
4204     @java.lang.Override
build()4205     public com.google.cloud.orgpolicy.v1.Policy build() {
4206       com.google.cloud.orgpolicy.v1.Policy result = buildPartial();
4207       if (!result.isInitialized()) {
4208         throw newUninitializedMessageException(result);
4209       }
4210       return result;
4211     }
4212 
4213     @java.lang.Override
buildPartial()4214     public com.google.cloud.orgpolicy.v1.Policy buildPartial() {
4215       com.google.cloud.orgpolicy.v1.Policy result = new com.google.cloud.orgpolicy.v1.Policy(this);
4216       if (bitField0_ != 0) {
4217         buildPartial0(result);
4218       }
4219       buildPartialOneofs(result);
4220       onBuilt();
4221       return result;
4222     }
4223 
buildPartial0(com.google.cloud.orgpolicy.v1.Policy result)4224     private void buildPartial0(com.google.cloud.orgpolicy.v1.Policy result) {
4225       int from_bitField0_ = bitField0_;
4226       if (((from_bitField0_ & 0x00000001) != 0)) {
4227         result.version_ = version_;
4228       }
4229       if (((from_bitField0_ & 0x00000002) != 0)) {
4230         result.constraint_ = constraint_;
4231       }
4232       if (((from_bitField0_ & 0x00000004) != 0)) {
4233         result.etag_ = etag_;
4234       }
4235       if (((from_bitField0_ & 0x00000008) != 0)) {
4236         result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build();
4237       }
4238     }
4239 
buildPartialOneofs(com.google.cloud.orgpolicy.v1.Policy result)4240     private void buildPartialOneofs(com.google.cloud.orgpolicy.v1.Policy result) {
4241       result.policyTypeCase_ = policyTypeCase_;
4242       result.policyType_ = this.policyType_;
4243       if (policyTypeCase_ == 5 && listPolicyBuilder_ != null) {
4244         result.policyType_ = listPolicyBuilder_.build();
4245       }
4246       if (policyTypeCase_ == 6 && booleanPolicyBuilder_ != null) {
4247         result.policyType_ = booleanPolicyBuilder_.build();
4248       }
4249       if (policyTypeCase_ == 7 && restoreDefaultBuilder_ != null) {
4250         result.policyType_ = restoreDefaultBuilder_.build();
4251       }
4252     }
4253 
4254     @java.lang.Override
clone()4255     public Builder clone() {
4256       return super.clone();
4257     }
4258 
4259     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)4260     public Builder setField(
4261         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
4262       return super.setField(field, value);
4263     }
4264 
4265     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)4266     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
4267       return super.clearField(field);
4268     }
4269 
4270     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)4271     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
4272       return super.clearOneof(oneof);
4273     }
4274 
4275     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)4276     public Builder setRepeatedField(
4277         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
4278       return super.setRepeatedField(field, index, value);
4279     }
4280 
4281     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)4282     public Builder addRepeatedField(
4283         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
4284       return super.addRepeatedField(field, value);
4285     }
4286 
4287     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)4288     public Builder mergeFrom(com.google.protobuf.Message other) {
4289       if (other instanceof com.google.cloud.orgpolicy.v1.Policy) {
4290         return mergeFrom((com.google.cloud.orgpolicy.v1.Policy) other);
4291       } else {
4292         super.mergeFrom(other);
4293         return this;
4294       }
4295     }
4296 
mergeFrom(com.google.cloud.orgpolicy.v1.Policy other)4297     public Builder mergeFrom(com.google.cloud.orgpolicy.v1.Policy other) {
4298       if (other == com.google.cloud.orgpolicy.v1.Policy.getDefaultInstance()) return this;
4299       if (other.getVersion() != 0) {
4300         setVersion(other.getVersion());
4301       }
4302       if (!other.getConstraint().isEmpty()) {
4303         constraint_ = other.constraint_;
4304         bitField0_ |= 0x00000002;
4305         onChanged();
4306       }
4307       if (other.getEtag() != com.google.protobuf.ByteString.EMPTY) {
4308         setEtag(other.getEtag());
4309       }
4310       if (other.hasUpdateTime()) {
4311         mergeUpdateTime(other.getUpdateTime());
4312       }
4313       switch (other.getPolicyTypeCase()) {
4314         case LIST_POLICY:
4315           {
4316             mergeListPolicy(other.getListPolicy());
4317             break;
4318           }
4319         case BOOLEAN_POLICY:
4320           {
4321             mergeBooleanPolicy(other.getBooleanPolicy());
4322             break;
4323           }
4324         case RESTORE_DEFAULT:
4325           {
4326             mergeRestoreDefault(other.getRestoreDefault());
4327             break;
4328           }
4329         case POLICYTYPE_NOT_SET:
4330           {
4331             break;
4332           }
4333       }
4334       this.mergeUnknownFields(other.getUnknownFields());
4335       onChanged();
4336       return this;
4337     }
4338 
4339     @java.lang.Override
isInitialized()4340     public final boolean isInitialized() {
4341       return true;
4342     }
4343 
4344     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)4345     public Builder mergeFrom(
4346         com.google.protobuf.CodedInputStream input,
4347         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4348         throws java.io.IOException {
4349       if (extensionRegistry == null) {
4350         throw new java.lang.NullPointerException();
4351       }
4352       try {
4353         boolean done = false;
4354         while (!done) {
4355           int tag = input.readTag();
4356           switch (tag) {
4357             case 0:
4358               done = true;
4359               break;
4360             case 8:
4361               {
4362                 version_ = input.readInt32();
4363                 bitField0_ |= 0x00000001;
4364                 break;
4365               } // case 8
4366             case 18:
4367               {
4368                 constraint_ = input.readStringRequireUtf8();
4369                 bitField0_ |= 0x00000002;
4370                 break;
4371               } // case 18
4372             case 26:
4373               {
4374                 etag_ = input.readBytes();
4375                 bitField0_ |= 0x00000004;
4376                 break;
4377               } // case 26
4378             case 34:
4379               {
4380                 input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry);
4381                 bitField0_ |= 0x00000008;
4382                 break;
4383               } // case 34
4384             case 42:
4385               {
4386                 input.readMessage(getListPolicyFieldBuilder().getBuilder(), extensionRegistry);
4387                 policyTypeCase_ = 5;
4388                 break;
4389               } // case 42
4390             case 50:
4391               {
4392                 input.readMessage(getBooleanPolicyFieldBuilder().getBuilder(), extensionRegistry);
4393                 policyTypeCase_ = 6;
4394                 break;
4395               } // case 50
4396             case 58:
4397               {
4398                 input.readMessage(getRestoreDefaultFieldBuilder().getBuilder(), extensionRegistry);
4399                 policyTypeCase_ = 7;
4400                 break;
4401               } // case 58
4402             default:
4403               {
4404                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
4405                   done = true; // was an endgroup tag
4406                 }
4407                 break;
4408               } // default:
4409           } // switch (tag)
4410         } // while (!done)
4411       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
4412         throw e.unwrapIOException();
4413       } finally {
4414         onChanged();
4415       } // finally
4416       return this;
4417     }
4418 
4419     private int policyTypeCase_ = 0;
4420     private java.lang.Object policyType_;
4421 
getPolicyTypeCase()4422     public PolicyTypeCase getPolicyTypeCase() {
4423       return PolicyTypeCase.forNumber(policyTypeCase_);
4424     }
4425 
clearPolicyType()4426     public Builder clearPolicyType() {
4427       policyTypeCase_ = 0;
4428       policyType_ = null;
4429       onChanged();
4430       return this;
4431     }
4432 
4433     private int bitField0_;
4434 
4435     private int version_;
4436     /**
4437      *
4438      *
4439      * <pre>
4440      * Version of the `Policy`. Default version is 0;
4441      * </pre>
4442      *
4443      * <code>int32 version = 1;</code>
4444      *
4445      * @return The version.
4446      */
4447     @java.lang.Override
getVersion()4448     public int getVersion() {
4449       return version_;
4450     }
4451     /**
4452      *
4453      *
4454      * <pre>
4455      * Version of the `Policy`. Default version is 0;
4456      * </pre>
4457      *
4458      * <code>int32 version = 1;</code>
4459      *
4460      * @param value The version to set.
4461      * @return This builder for chaining.
4462      */
setVersion(int value)4463     public Builder setVersion(int value) {
4464 
4465       version_ = value;
4466       bitField0_ |= 0x00000001;
4467       onChanged();
4468       return this;
4469     }
4470     /**
4471      *
4472      *
4473      * <pre>
4474      * Version of the `Policy`. Default version is 0;
4475      * </pre>
4476      *
4477      * <code>int32 version = 1;</code>
4478      *
4479      * @return This builder for chaining.
4480      */
clearVersion()4481     public Builder clearVersion() {
4482       bitField0_ = (bitField0_ & ~0x00000001);
4483       version_ = 0;
4484       onChanged();
4485       return this;
4486     }
4487 
4488     private java.lang.Object constraint_ = "";
4489     /**
4490      *
4491      *
4492      * <pre>
4493      * The name of the `Constraint` the `Policy` is configuring, for example,
4494      * `constraints/serviceuser.services`.
4495      * Immutable after creation.
4496      * </pre>
4497      *
4498      * <code>string constraint = 2;</code>
4499      *
4500      * @return The constraint.
4501      */
getConstraint()4502     public java.lang.String getConstraint() {
4503       java.lang.Object ref = constraint_;
4504       if (!(ref instanceof java.lang.String)) {
4505         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
4506         java.lang.String s = bs.toStringUtf8();
4507         constraint_ = s;
4508         return s;
4509       } else {
4510         return (java.lang.String) ref;
4511       }
4512     }
4513     /**
4514      *
4515      *
4516      * <pre>
4517      * The name of the `Constraint` the `Policy` is configuring, for example,
4518      * `constraints/serviceuser.services`.
4519      * Immutable after creation.
4520      * </pre>
4521      *
4522      * <code>string constraint = 2;</code>
4523      *
4524      * @return The bytes for constraint.
4525      */
getConstraintBytes()4526     public com.google.protobuf.ByteString getConstraintBytes() {
4527       java.lang.Object ref = constraint_;
4528       if (ref instanceof String) {
4529         com.google.protobuf.ByteString b =
4530             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
4531         constraint_ = b;
4532         return b;
4533       } else {
4534         return (com.google.protobuf.ByteString) ref;
4535       }
4536     }
4537     /**
4538      *
4539      *
4540      * <pre>
4541      * The name of the `Constraint` the `Policy` is configuring, for example,
4542      * `constraints/serviceuser.services`.
4543      * Immutable after creation.
4544      * </pre>
4545      *
4546      * <code>string constraint = 2;</code>
4547      *
4548      * @param value The constraint to set.
4549      * @return This builder for chaining.
4550      */
setConstraint(java.lang.String value)4551     public Builder setConstraint(java.lang.String value) {
4552       if (value == null) {
4553         throw new NullPointerException();
4554       }
4555       constraint_ = value;
4556       bitField0_ |= 0x00000002;
4557       onChanged();
4558       return this;
4559     }
4560     /**
4561      *
4562      *
4563      * <pre>
4564      * The name of the `Constraint` the `Policy` is configuring, for example,
4565      * `constraints/serviceuser.services`.
4566      * Immutable after creation.
4567      * </pre>
4568      *
4569      * <code>string constraint = 2;</code>
4570      *
4571      * @return This builder for chaining.
4572      */
clearConstraint()4573     public Builder clearConstraint() {
4574       constraint_ = getDefaultInstance().getConstraint();
4575       bitField0_ = (bitField0_ & ~0x00000002);
4576       onChanged();
4577       return this;
4578     }
4579     /**
4580      *
4581      *
4582      * <pre>
4583      * The name of the `Constraint` the `Policy` is configuring, for example,
4584      * `constraints/serviceuser.services`.
4585      * Immutable after creation.
4586      * </pre>
4587      *
4588      * <code>string constraint = 2;</code>
4589      *
4590      * @param value The bytes for constraint to set.
4591      * @return This builder for chaining.
4592      */
setConstraintBytes(com.google.protobuf.ByteString value)4593     public Builder setConstraintBytes(com.google.protobuf.ByteString value) {
4594       if (value == null) {
4595         throw new NullPointerException();
4596       }
4597       checkByteStringIsUtf8(value);
4598       constraint_ = value;
4599       bitField0_ |= 0x00000002;
4600       onChanged();
4601       return this;
4602     }
4603 
4604     private com.google.protobuf.ByteString etag_ = com.google.protobuf.ByteString.EMPTY;
4605     /**
4606      *
4607      *
4608      * <pre>
4609      * An opaque tag indicating the current version of the `Policy`, used for
4610      * concurrency control.
4611      * When the `Policy` is returned from either a `GetPolicy` or a
4612      * `ListOrgPolicy` request, this `etag` indicates the version of the current
4613      * `Policy` to use when executing a read-modify-write loop.
4614      * When the `Policy` is returned from a `GetEffectivePolicy` request, the
4615      * `etag` will be unset.
4616      * When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value
4617      * that was returned from a `GetOrgPolicy` request as part of a
4618      * read-modify-write loop for concurrency control. Not setting the `etag`in a
4619      * `SetOrgPolicy` request will result in an unconditional write of the
4620      * `Policy`.
4621      * </pre>
4622      *
4623      * <code>bytes etag = 3;</code>
4624      *
4625      * @return The etag.
4626      */
4627     @java.lang.Override
getEtag()4628     public com.google.protobuf.ByteString getEtag() {
4629       return etag_;
4630     }
4631     /**
4632      *
4633      *
4634      * <pre>
4635      * An opaque tag indicating the current version of the `Policy`, used for
4636      * concurrency control.
4637      * When the `Policy` is returned from either a `GetPolicy` or a
4638      * `ListOrgPolicy` request, this `etag` indicates the version of the current
4639      * `Policy` to use when executing a read-modify-write loop.
4640      * When the `Policy` is returned from a `GetEffectivePolicy` request, the
4641      * `etag` will be unset.
4642      * When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value
4643      * that was returned from a `GetOrgPolicy` request as part of a
4644      * read-modify-write loop for concurrency control. Not setting the `etag`in a
4645      * `SetOrgPolicy` request will result in an unconditional write of the
4646      * `Policy`.
4647      * </pre>
4648      *
4649      * <code>bytes etag = 3;</code>
4650      *
4651      * @param value The etag to set.
4652      * @return This builder for chaining.
4653      */
setEtag(com.google.protobuf.ByteString value)4654     public Builder setEtag(com.google.protobuf.ByteString value) {
4655       if (value == null) {
4656         throw new NullPointerException();
4657       }
4658       etag_ = value;
4659       bitField0_ |= 0x00000004;
4660       onChanged();
4661       return this;
4662     }
4663     /**
4664      *
4665      *
4666      * <pre>
4667      * An opaque tag indicating the current version of the `Policy`, used for
4668      * concurrency control.
4669      * When the `Policy` is returned from either a `GetPolicy` or a
4670      * `ListOrgPolicy` request, this `etag` indicates the version of the current
4671      * `Policy` to use when executing a read-modify-write loop.
4672      * When the `Policy` is returned from a `GetEffectivePolicy` request, the
4673      * `etag` will be unset.
4674      * When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value
4675      * that was returned from a `GetOrgPolicy` request as part of a
4676      * read-modify-write loop for concurrency control. Not setting the `etag`in a
4677      * `SetOrgPolicy` request will result in an unconditional write of the
4678      * `Policy`.
4679      * </pre>
4680      *
4681      * <code>bytes etag = 3;</code>
4682      *
4683      * @return This builder for chaining.
4684      */
clearEtag()4685     public Builder clearEtag() {
4686       bitField0_ = (bitField0_ & ~0x00000004);
4687       etag_ = getDefaultInstance().getEtag();
4688       onChanged();
4689       return this;
4690     }
4691 
4692     private com.google.protobuf.Timestamp updateTime_;
4693     private com.google.protobuf.SingleFieldBuilderV3<
4694             com.google.protobuf.Timestamp,
4695             com.google.protobuf.Timestamp.Builder,
4696             com.google.protobuf.TimestampOrBuilder>
4697         updateTimeBuilder_;
4698     /**
4699      *
4700      *
4701      * <pre>
4702      * The time stamp the `Policy` was previously updated. This is set by the
4703      * server, not specified by the caller, and represents the last time a call to
4704      * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
4705      * be ignored.
4706      * </pre>
4707      *
4708      * <code>.google.protobuf.Timestamp update_time = 4;</code>
4709      *
4710      * @return Whether the updateTime field is set.
4711      */
hasUpdateTime()4712     public boolean hasUpdateTime() {
4713       return ((bitField0_ & 0x00000008) != 0);
4714     }
4715     /**
4716      *
4717      *
4718      * <pre>
4719      * The time stamp the `Policy` was previously updated. This is set by the
4720      * server, not specified by the caller, and represents the last time a call to
4721      * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
4722      * be ignored.
4723      * </pre>
4724      *
4725      * <code>.google.protobuf.Timestamp update_time = 4;</code>
4726      *
4727      * @return The updateTime.
4728      */
getUpdateTime()4729     public com.google.protobuf.Timestamp getUpdateTime() {
4730       if (updateTimeBuilder_ == null) {
4731         return updateTime_ == null
4732             ? com.google.protobuf.Timestamp.getDefaultInstance()
4733             : updateTime_;
4734       } else {
4735         return updateTimeBuilder_.getMessage();
4736       }
4737     }
4738     /**
4739      *
4740      *
4741      * <pre>
4742      * The time stamp the `Policy` was previously updated. This is set by the
4743      * server, not specified by the caller, and represents the last time a call to
4744      * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
4745      * be ignored.
4746      * </pre>
4747      *
4748      * <code>.google.protobuf.Timestamp update_time = 4;</code>
4749      */
setUpdateTime(com.google.protobuf.Timestamp value)4750     public Builder setUpdateTime(com.google.protobuf.Timestamp value) {
4751       if (updateTimeBuilder_ == null) {
4752         if (value == null) {
4753           throw new NullPointerException();
4754         }
4755         updateTime_ = value;
4756       } else {
4757         updateTimeBuilder_.setMessage(value);
4758       }
4759       bitField0_ |= 0x00000008;
4760       onChanged();
4761       return this;
4762     }
4763     /**
4764      *
4765      *
4766      * <pre>
4767      * The time stamp the `Policy` was previously updated. This is set by the
4768      * server, not specified by the caller, and represents the last time a call to
4769      * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
4770      * be ignored.
4771      * </pre>
4772      *
4773      * <code>.google.protobuf.Timestamp update_time = 4;</code>
4774      */
setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue)4775     public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
4776       if (updateTimeBuilder_ == null) {
4777         updateTime_ = builderForValue.build();
4778       } else {
4779         updateTimeBuilder_.setMessage(builderForValue.build());
4780       }
4781       bitField0_ |= 0x00000008;
4782       onChanged();
4783       return this;
4784     }
4785     /**
4786      *
4787      *
4788      * <pre>
4789      * The time stamp the `Policy` was previously updated. This is set by the
4790      * server, not specified by the caller, and represents the last time a call to
4791      * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
4792      * be ignored.
4793      * </pre>
4794      *
4795      * <code>.google.protobuf.Timestamp update_time = 4;</code>
4796      */
mergeUpdateTime(com.google.protobuf.Timestamp value)4797     public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) {
4798       if (updateTimeBuilder_ == null) {
4799         if (((bitField0_ & 0x00000008) != 0)
4800             && updateTime_ != null
4801             && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
4802           getUpdateTimeBuilder().mergeFrom(value);
4803         } else {
4804           updateTime_ = value;
4805         }
4806       } else {
4807         updateTimeBuilder_.mergeFrom(value);
4808       }
4809       bitField0_ |= 0x00000008;
4810       onChanged();
4811       return this;
4812     }
4813     /**
4814      *
4815      *
4816      * <pre>
4817      * The time stamp the `Policy` was previously updated. This is set by the
4818      * server, not specified by the caller, and represents the last time a call to
4819      * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
4820      * be ignored.
4821      * </pre>
4822      *
4823      * <code>.google.protobuf.Timestamp update_time = 4;</code>
4824      */
clearUpdateTime()4825     public Builder clearUpdateTime() {
4826       bitField0_ = (bitField0_ & ~0x00000008);
4827       updateTime_ = null;
4828       if (updateTimeBuilder_ != null) {
4829         updateTimeBuilder_.dispose();
4830         updateTimeBuilder_ = null;
4831       }
4832       onChanged();
4833       return this;
4834     }
4835     /**
4836      *
4837      *
4838      * <pre>
4839      * The time stamp the `Policy` was previously updated. This is set by the
4840      * server, not specified by the caller, and represents the last time a call to
4841      * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
4842      * be ignored.
4843      * </pre>
4844      *
4845      * <code>.google.protobuf.Timestamp update_time = 4;</code>
4846      */
getUpdateTimeBuilder()4847     public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() {
4848       bitField0_ |= 0x00000008;
4849       onChanged();
4850       return getUpdateTimeFieldBuilder().getBuilder();
4851     }
4852     /**
4853      *
4854      *
4855      * <pre>
4856      * The time stamp the `Policy` was previously updated. This is set by the
4857      * server, not specified by the caller, and represents the last time a call to
4858      * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
4859      * be ignored.
4860      * </pre>
4861      *
4862      * <code>.google.protobuf.Timestamp update_time = 4;</code>
4863      */
getUpdateTimeOrBuilder()4864     public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
4865       if (updateTimeBuilder_ != null) {
4866         return updateTimeBuilder_.getMessageOrBuilder();
4867       } else {
4868         return updateTime_ == null
4869             ? com.google.protobuf.Timestamp.getDefaultInstance()
4870             : updateTime_;
4871       }
4872     }
4873     /**
4874      *
4875      *
4876      * <pre>
4877      * The time stamp the `Policy` was previously updated. This is set by the
4878      * server, not specified by the caller, and represents the last time a call to
4879      * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
4880      * be ignored.
4881      * </pre>
4882      *
4883      * <code>.google.protobuf.Timestamp update_time = 4;</code>
4884      */
4885     private com.google.protobuf.SingleFieldBuilderV3<
4886             com.google.protobuf.Timestamp,
4887             com.google.protobuf.Timestamp.Builder,
4888             com.google.protobuf.TimestampOrBuilder>
getUpdateTimeFieldBuilder()4889         getUpdateTimeFieldBuilder() {
4890       if (updateTimeBuilder_ == null) {
4891         updateTimeBuilder_ =
4892             new com.google.protobuf.SingleFieldBuilderV3<
4893                 com.google.protobuf.Timestamp,
4894                 com.google.protobuf.Timestamp.Builder,
4895                 com.google.protobuf.TimestampOrBuilder>(
4896                 getUpdateTime(), getParentForChildren(), isClean());
4897         updateTime_ = null;
4898       }
4899       return updateTimeBuilder_;
4900     }
4901 
4902     private com.google.protobuf.SingleFieldBuilderV3<
4903             com.google.cloud.orgpolicy.v1.Policy.ListPolicy,
4904             com.google.cloud.orgpolicy.v1.Policy.ListPolicy.Builder,
4905             com.google.cloud.orgpolicy.v1.Policy.ListPolicyOrBuilder>
4906         listPolicyBuilder_;
4907     /**
4908      *
4909      *
4910      * <pre>
4911      * List of values either allowed or disallowed.
4912      * </pre>
4913      *
4914      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
4915      *
4916      * @return Whether the listPolicy field is set.
4917      */
4918     @java.lang.Override
hasListPolicy()4919     public boolean hasListPolicy() {
4920       return policyTypeCase_ == 5;
4921     }
4922     /**
4923      *
4924      *
4925      * <pre>
4926      * List of values either allowed or disallowed.
4927      * </pre>
4928      *
4929      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
4930      *
4931      * @return The listPolicy.
4932      */
4933     @java.lang.Override
getListPolicy()4934     public com.google.cloud.orgpolicy.v1.Policy.ListPolicy getListPolicy() {
4935       if (listPolicyBuilder_ == null) {
4936         if (policyTypeCase_ == 5) {
4937           return (com.google.cloud.orgpolicy.v1.Policy.ListPolicy) policyType_;
4938         }
4939         return com.google.cloud.orgpolicy.v1.Policy.ListPolicy.getDefaultInstance();
4940       } else {
4941         if (policyTypeCase_ == 5) {
4942           return listPolicyBuilder_.getMessage();
4943         }
4944         return com.google.cloud.orgpolicy.v1.Policy.ListPolicy.getDefaultInstance();
4945       }
4946     }
4947     /**
4948      *
4949      *
4950      * <pre>
4951      * List of values either allowed or disallowed.
4952      * </pre>
4953      *
4954      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
4955      */
setListPolicy(com.google.cloud.orgpolicy.v1.Policy.ListPolicy value)4956     public Builder setListPolicy(com.google.cloud.orgpolicy.v1.Policy.ListPolicy value) {
4957       if (listPolicyBuilder_ == null) {
4958         if (value == null) {
4959           throw new NullPointerException();
4960         }
4961         policyType_ = value;
4962         onChanged();
4963       } else {
4964         listPolicyBuilder_.setMessage(value);
4965       }
4966       policyTypeCase_ = 5;
4967       return this;
4968     }
4969     /**
4970      *
4971      *
4972      * <pre>
4973      * List of values either allowed or disallowed.
4974      * </pre>
4975      *
4976      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
4977      */
setListPolicy( com.google.cloud.orgpolicy.v1.Policy.ListPolicy.Builder builderForValue)4978     public Builder setListPolicy(
4979         com.google.cloud.orgpolicy.v1.Policy.ListPolicy.Builder builderForValue) {
4980       if (listPolicyBuilder_ == null) {
4981         policyType_ = builderForValue.build();
4982         onChanged();
4983       } else {
4984         listPolicyBuilder_.setMessage(builderForValue.build());
4985       }
4986       policyTypeCase_ = 5;
4987       return this;
4988     }
4989     /**
4990      *
4991      *
4992      * <pre>
4993      * List of values either allowed or disallowed.
4994      * </pre>
4995      *
4996      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
4997      */
mergeListPolicy(com.google.cloud.orgpolicy.v1.Policy.ListPolicy value)4998     public Builder mergeListPolicy(com.google.cloud.orgpolicy.v1.Policy.ListPolicy value) {
4999       if (listPolicyBuilder_ == null) {
5000         if (policyTypeCase_ == 5
5001             && policyType_
5002                 != com.google.cloud.orgpolicy.v1.Policy.ListPolicy.getDefaultInstance()) {
5003           policyType_ =
5004               com.google.cloud.orgpolicy.v1.Policy.ListPolicy.newBuilder(
5005                       (com.google.cloud.orgpolicy.v1.Policy.ListPolicy) policyType_)
5006                   .mergeFrom(value)
5007                   .buildPartial();
5008         } else {
5009           policyType_ = value;
5010         }
5011         onChanged();
5012       } else {
5013         if (policyTypeCase_ == 5) {
5014           listPolicyBuilder_.mergeFrom(value);
5015         } else {
5016           listPolicyBuilder_.setMessage(value);
5017         }
5018       }
5019       policyTypeCase_ = 5;
5020       return this;
5021     }
5022     /**
5023      *
5024      *
5025      * <pre>
5026      * List of values either allowed or disallowed.
5027      * </pre>
5028      *
5029      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
5030      */
clearListPolicy()5031     public Builder clearListPolicy() {
5032       if (listPolicyBuilder_ == null) {
5033         if (policyTypeCase_ == 5) {
5034           policyTypeCase_ = 0;
5035           policyType_ = null;
5036           onChanged();
5037         }
5038       } else {
5039         if (policyTypeCase_ == 5) {
5040           policyTypeCase_ = 0;
5041           policyType_ = null;
5042         }
5043         listPolicyBuilder_.clear();
5044       }
5045       return this;
5046     }
5047     /**
5048      *
5049      *
5050      * <pre>
5051      * List of values either allowed or disallowed.
5052      * </pre>
5053      *
5054      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
5055      */
getListPolicyBuilder()5056     public com.google.cloud.orgpolicy.v1.Policy.ListPolicy.Builder getListPolicyBuilder() {
5057       return getListPolicyFieldBuilder().getBuilder();
5058     }
5059     /**
5060      *
5061      *
5062      * <pre>
5063      * List of values either allowed or disallowed.
5064      * </pre>
5065      *
5066      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
5067      */
5068     @java.lang.Override
getListPolicyOrBuilder()5069     public com.google.cloud.orgpolicy.v1.Policy.ListPolicyOrBuilder getListPolicyOrBuilder() {
5070       if ((policyTypeCase_ == 5) && (listPolicyBuilder_ != null)) {
5071         return listPolicyBuilder_.getMessageOrBuilder();
5072       } else {
5073         if (policyTypeCase_ == 5) {
5074           return (com.google.cloud.orgpolicy.v1.Policy.ListPolicy) policyType_;
5075         }
5076         return com.google.cloud.orgpolicy.v1.Policy.ListPolicy.getDefaultInstance();
5077       }
5078     }
5079     /**
5080      *
5081      *
5082      * <pre>
5083      * List of values either allowed or disallowed.
5084      * </pre>
5085      *
5086      * <code>.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;</code>
5087      */
5088     private com.google.protobuf.SingleFieldBuilderV3<
5089             com.google.cloud.orgpolicy.v1.Policy.ListPolicy,
5090             com.google.cloud.orgpolicy.v1.Policy.ListPolicy.Builder,
5091             com.google.cloud.orgpolicy.v1.Policy.ListPolicyOrBuilder>
getListPolicyFieldBuilder()5092         getListPolicyFieldBuilder() {
5093       if (listPolicyBuilder_ == null) {
5094         if (!(policyTypeCase_ == 5)) {
5095           policyType_ = com.google.cloud.orgpolicy.v1.Policy.ListPolicy.getDefaultInstance();
5096         }
5097         listPolicyBuilder_ =
5098             new com.google.protobuf.SingleFieldBuilderV3<
5099                 com.google.cloud.orgpolicy.v1.Policy.ListPolicy,
5100                 com.google.cloud.orgpolicy.v1.Policy.ListPolicy.Builder,
5101                 com.google.cloud.orgpolicy.v1.Policy.ListPolicyOrBuilder>(
5102                 (com.google.cloud.orgpolicy.v1.Policy.ListPolicy) policyType_,
5103                 getParentForChildren(),
5104                 isClean());
5105         policyType_ = null;
5106       }
5107       policyTypeCase_ = 5;
5108       onChanged();
5109       return listPolicyBuilder_;
5110     }
5111 
5112     private com.google.protobuf.SingleFieldBuilderV3<
5113             com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy,
5114             com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.Builder,
5115             com.google.cloud.orgpolicy.v1.Policy.BooleanPolicyOrBuilder>
5116         booleanPolicyBuilder_;
5117     /**
5118      *
5119      *
5120      * <pre>
5121      * For boolean `Constraints`, whether to enforce the `Constraint` or not.
5122      * </pre>
5123      *
5124      * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
5125      *
5126      * @return Whether the booleanPolicy field is set.
5127      */
5128     @java.lang.Override
hasBooleanPolicy()5129     public boolean hasBooleanPolicy() {
5130       return policyTypeCase_ == 6;
5131     }
5132     /**
5133      *
5134      *
5135      * <pre>
5136      * For boolean `Constraints`, whether to enforce the `Constraint` or not.
5137      * </pre>
5138      *
5139      * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
5140      *
5141      * @return The booleanPolicy.
5142      */
5143     @java.lang.Override
getBooleanPolicy()5144     public com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy getBooleanPolicy() {
5145       if (booleanPolicyBuilder_ == null) {
5146         if (policyTypeCase_ == 6) {
5147           return (com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) policyType_;
5148         }
5149         return com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.getDefaultInstance();
5150       } else {
5151         if (policyTypeCase_ == 6) {
5152           return booleanPolicyBuilder_.getMessage();
5153         }
5154         return com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.getDefaultInstance();
5155       }
5156     }
5157     /**
5158      *
5159      *
5160      * <pre>
5161      * For boolean `Constraints`, whether to enforce the `Constraint` or not.
5162      * </pre>
5163      *
5164      * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
5165      */
setBooleanPolicy(com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy value)5166     public Builder setBooleanPolicy(com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy value) {
5167       if (booleanPolicyBuilder_ == null) {
5168         if (value == null) {
5169           throw new NullPointerException();
5170         }
5171         policyType_ = value;
5172         onChanged();
5173       } else {
5174         booleanPolicyBuilder_.setMessage(value);
5175       }
5176       policyTypeCase_ = 6;
5177       return this;
5178     }
5179     /**
5180      *
5181      *
5182      * <pre>
5183      * For boolean `Constraints`, whether to enforce the `Constraint` or not.
5184      * </pre>
5185      *
5186      * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
5187      */
setBooleanPolicy( com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.Builder builderForValue)5188     public Builder setBooleanPolicy(
5189         com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.Builder builderForValue) {
5190       if (booleanPolicyBuilder_ == null) {
5191         policyType_ = builderForValue.build();
5192         onChanged();
5193       } else {
5194         booleanPolicyBuilder_.setMessage(builderForValue.build());
5195       }
5196       policyTypeCase_ = 6;
5197       return this;
5198     }
5199     /**
5200      *
5201      *
5202      * <pre>
5203      * For boolean `Constraints`, whether to enforce the `Constraint` or not.
5204      * </pre>
5205      *
5206      * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
5207      */
mergeBooleanPolicy(com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy value)5208     public Builder mergeBooleanPolicy(com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy value) {
5209       if (booleanPolicyBuilder_ == null) {
5210         if (policyTypeCase_ == 6
5211             && policyType_
5212                 != com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.getDefaultInstance()) {
5213           policyType_ =
5214               com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.newBuilder(
5215                       (com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) policyType_)
5216                   .mergeFrom(value)
5217                   .buildPartial();
5218         } else {
5219           policyType_ = value;
5220         }
5221         onChanged();
5222       } else {
5223         if (policyTypeCase_ == 6) {
5224           booleanPolicyBuilder_.mergeFrom(value);
5225         } else {
5226           booleanPolicyBuilder_.setMessage(value);
5227         }
5228       }
5229       policyTypeCase_ = 6;
5230       return this;
5231     }
5232     /**
5233      *
5234      *
5235      * <pre>
5236      * For boolean `Constraints`, whether to enforce the `Constraint` or not.
5237      * </pre>
5238      *
5239      * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
5240      */
clearBooleanPolicy()5241     public Builder clearBooleanPolicy() {
5242       if (booleanPolicyBuilder_ == null) {
5243         if (policyTypeCase_ == 6) {
5244           policyTypeCase_ = 0;
5245           policyType_ = null;
5246           onChanged();
5247         }
5248       } else {
5249         if (policyTypeCase_ == 6) {
5250           policyTypeCase_ = 0;
5251           policyType_ = null;
5252         }
5253         booleanPolicyBuilder_.clear();
5254       }
5255       return this;
5256     }
5257     /**
5258      *
5259      *
5260      * <pre>
5261      * For boolean `Constraints`, whether to enforce the `Constraint` or not.
5262      * </pre>
5263      *
5264      * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
5265      */
getBooleanPolicyBuilder()5266     public com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.Builder getBooleanPolicyBuilder() {
5267       return getBooleanPolicyFieldBuilder().getBuilder();
5268     }
5269     /**
5270      *
5271      *
5272      * <pre>
5273      * For boolean `Constraints`, whether to enforce the `Constraint` or not.
5274      * </pre>
5275      *
5276      * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
5277      */
5278     @java.lang.Override
getBooleanPolicyOrBuilder()5279     public com.google.cloud.orgpolicy.v1.Policy.BooleanPolicyOrBuilder getBooleanPolicyOrBuilder() {
5280       if ((policyTypeCase_ == 6) && (booleanPolicyBuilder_ != null)) {
5281         return booleanPolicyBuilder_.getMessageOrBuilder();
5282       } else {
5283         if (policyTypeCase_ == 6) {
5284           return (com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) policyType_;
5285         }
5286         return com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.getDefaultInstance();
5287       }
5288     }
5289     /**
5290      *
5291      *
5292      * <pre>
5293      * For boolean `Constraints`, whether to enforce the `Constraint` or not.
5294      * </pre>
5295      *
5296      * <code>.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;</code>
5297      */
5298     private com.google.protobuf.SingleFieldBuilderV3<
5299             com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy,
5300             com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.Builder,
5301             com.google.cloud.orgpolicy.v1.Policy.BooleanPolicyOrBuilder>
getBooleanPolicyFieldBuilder()5302         getBooleanPolicyFieldBuilder() {
5303       if (booleanPolicyBuilder_ == null) {
5304         if (!(policyTypeCase_ == 6)) {
5305           policyType_ = com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.getDefaultInstance();
5306         }
5307         booleanPolicyBuilder_ =
5308             new com.google.protobuf.SingleFieldBuilderV3<
5309                 com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy,
5310                 com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.Builder,
5311                 com.google.cloud.orgpolicy.v1.Policy.BooleanPolicyOrBuilder>(
5312                 (com.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) policyType_,
5313                 getParentForChildren(),
5314                 isClean());
5315         policyType_ = null;
5316       }
5317       policyTypeCase_ = 6;
5318       onChanged();
5319       return booleanPolicyBuilder_;
5320     }
5321 
5322     private com.google.protobuf.SingleFieldBuilderV3<
5323             com.google.cloud.orgpolicy.v1.Policy.RestoreDefault,
5324             com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.Builder,
5325             com.google.cloud.orgpolicy.v1.Policy.RestoreDefaultOrBuilder>
5326         restoreDefaultBuilder_;
5327     /**
5328      *
5329      *
5330      * <pre>
5331      * Restores the default behavior of the constraint; independent of
5332      * `Constraint` type.
5333      * </pre>
5334      *
5335      * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
5336      *
5337      * @return Whether the restoreDefault field is set.
5338      */
5339     @java.lang.Override
hasRestoreDefault()5340     public boolean hasRestoreDefault() {
5341       return policyTypeCase_ == 7;
5342     }
5343     /**
5344      *
5345      *
5346      * <pre>
5347      * Restores the default behavior of the constraint; independent of
5348      * `Constraint` type.
5349      * </pre>
5350      *
5351      * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
5352      *
5353      * @return The restoreDefault.
5354      */
5355     @java.lang.Override
getRestoreDefault()5356     public com.google.cloud.orgpolicy.v1.Policy.RestoreDefault getRestoreDefault() {
5357       if (restoreDefaultBuilder_ == null) {
5358         if (policyTypeCase_ == 7) {
5359           return (com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) policyType_;
5360         }
5361         return com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.getDefaultInstance();
5362       } else {
5363         if (policyTypeCase_ == 7) {
5364           return restoreDefaultBuilder_.getMessage();
5365         }
5366         return com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.getDefaultInstance();
5367       }
5368     }
5369     /**
5370      *
5371      *
5372      * <pre>
5373      * Restores the default behavior of the constraint; independent of
5374      * `Constraint` type.
5375      * </pre>
5376      *
5377      * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
5378      */
setRestoreDefault(com.google.cloud.orgpolicy.v1.Policy.RestoreDefault value)5379     public Builder setRestoreDefault(com.google.cloud.orgpolicy.v1.Policy.RestoreDefault value) {
5380       if (restoreDefaultBuilder_ == null) {
5381         if (value == null) {
5382           throw new NullPointerException();
5383         }
5384         policyType_ = value;
5385         onChanged();
5386       } else {
5387         restoreDefaultBuilder_.setMessage(value);
5388       }
5389       policyTypeCase_ = 7;
5390       return this;
5391     }
5392     /**
5393      *
5394      *
5395      * <pre>
5396      * Restores the default behavior of the constraint; independent of
5397      * `Constraint` type.
5398      * </pre>
5399      *
5400      * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
5401      */
setRestoreDefault( com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.Builder builderForValue)5402     public Builder setRestoreDefault(
5403         com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.Builder builderForValue) {
5404       if (restoreDefaultBuilder_ == null) {
5405         policyType_ = builderForValue.build();
5406         onChanged();
5407       } else {
5408         restoreDefaultBuilder_.setMessage(builderForValue.build());
5409       }
5410       policyTypeCase_ = 7;
5411       return this;
5412     }
5413     /**
5414      *
5415      *
5416      * <pre>
5417      * Restores the default behavior of the constraint; independent of
5418      * `Constraint` type.
5419      * </pre>
5420      *
5421      * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
5422      */
mergeRestoreDefault(com.google.cloud.orgpolicy.v1.Policy.RestoreDefault value)5423     public Builder mergeRestoreDefault(com.google.cloud.orgpolicy.v1.Policy.RestoreDefault value) {
5424       if (restoreDefaultBuilder_ == null) {
5425         if (policyTypeCase_ == 7
5426             && policyType_
5427                 != com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.getDefaultInstance()) {
5428           policyType_ =
5429               com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.newBuilder(
5430                       (com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) policyType_)
5431                   .mergeFrom(value)
5432                   .buildPartial();
5433         } else {
5434           policyType_ = value;
5435         }
5436         onChanged();
5437       } else {
5438         if (policyTypeCase_ == 7) {
5439           restoreDefaultBuilder_.mergeFrom(value);
5440         } else {
5441           restoreDefaultBuilder_.setMessage(value);
5442         }
5443       }
5444       policyTypeCase_ = 7;
5445       return this;
5446     }
5447     /**
5448      *
5449      *
5450      * <pre>
5451      * Restores the default behavior of the constraint; independent of
5452      * `Constraint` type.
5453      * </pre>
5454      *
5455      * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
5456      */
clearRestoreDefault()5457     public Builder clearRestoreDefault() {
5458       if (restoreDefaultBuilder_ == null) {
5459         if (policyTypeCase_ == 7) {
5460           policyTypeCase_ = 0;
5461           policyType_ = null;
5462           onChanged();
5463         }
5464       } else {
5465         if (policyTypeCase_ == 7) {
5466           policyTypeCase_ = 0;
5467           policyType_ = null;
5468         }
5469         restoreDefaultBuilder_.clear();
5470       }
5471       return this;
5472     }
5473     /**
5474      *
5475      *
5476      * <pre>
5477      * Restores the default behavior of the constraint; independent of
5478      * `Constraint` type.
5479      * </pre>
5480      *
5481      * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
5482      */
getRestoreDefaultBuilder()5483     public com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.Builder getRestoreDefaultBuilder() {
5484       return getRestoreDefaultFieldBuilder().getBuilder();
5485     }
5486     /**
5487      *
5488      *
5489      * <pre>
5490      * Restores the default behavior of the constraint; independent of
5491      * `Constraint` type.
5492      * </pre>
5493      *
5494      * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
5495      */
5496     @java.lang.Override
5497     public com.google.cloud.orgpolicy.v1.Policy.RestoreDefaultOrBuilder
getRestoreDefaultOrBuilder()5498         getRestoreDefaultOrBuilder() {
5499       if ((policyTypeCase_ == 7) && (restoreDefaultBuilder_ != null)) {
5500         return restoreDefaultBuilder_.getMessageOrBuilder();
5501       } else {
5502         if (policyTypeCase_ == 7) {
5503           return (com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) policyType_;
5504         }
5505         return com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.getDefaultInstance();
5506       }
5507     }
5508     /**
5509      *
5510      *
5511      * <pre>
5512      * Restores the default behavior of the constraint; independent of
5513      * `Constraint` type.
5514      * </pre>
5515      *
5516      * <code>.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;</code>
5517      */
5518     private com.google.protobuf.SingleFieldBuilderV3<
5519             com.google.cloud.orgpolicy.v1.Policy.RestoreDefault,
5520             com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.Builder,
5521             com.google.cloud.orgpolicy.v1.Policy.RestoreDefaultOrBuilder>
getRestoreDefaultFieldBuilder()5522         getRestoreDefaultFieldBuilder() {
5523       if (restoreDefaultBuilder_ == null) {
5524         if (!(policyTypeCase_ == 7)) {
5525           policyType_ = com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.getDefaultInstance();
5526         }
5527         restoreDefaultBuilder_ =
5528             new com.google.protobuf.SingleFieldBuilderV3<
5529                 com.google.cloud.orgpolicy.v1.Policy.RestoreDefault,
5530                 com.google.cloud.orgpolicy.v1.Policy.RestoreDefault.Builder,
5531                 com.google.cloud.orgpolicy.v1.Policy.RestoreDefaultOrBuilder>(
5532                 (com.google.cloud.orgpolicy.v1.Policy.RestoreDefault) policyType_,
5533                 getParentForChildren(),
5534                 isClean());
5535         policyType_ = null;
5536       }
5537       policyTypeCase_ = 7;
5538       onChanged();
5539       return restoreDefaultBuilder_;
5540     }
5541 
5542     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)5543     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
5544       return super.setUnknownFields(unknownFields);
5545     }
5546 
5547     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)5548     public final Builder mergeUnknownFields(
5549         final com.google.protobuf.UnknownFieldSet unknownFields) {
5550       return super.mergeUnknownFields(unknownFields);
5551     }
5552 
5553     // @@protoc_insertion_point(builder_scope:google.cloud.orgpolicy.v1.Policy)
5554   }
5555 
5556   // @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v1.Policy)
5557   private static final com.google.cloud.orgpolicy.v1.Policy DEFAULT_INSTANCE;
5558 
5559   static {
5560     DEFAULT_INSTANCE = new com.google.cloud.orgpolicy.v1.Policy();
5561   }
5562 
getDefaultInstance()5563   public static com.google.cloud.orgpolicy.v1.Policy getDefaultInstance() {
5564     return DEFAULT_INSTANCE;
5565   }
5566 
5567   private static final com.google.protobuf.Parser<Policy> PARSER =
5568       new com.google.protobuf.AbstractParser<Policy>() {
5569         @java.lang.Override
5570         public Policy parsePartialFrom(
5571             com.google.protobuf.CodedInputStream input,
5572             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
5573             throws com.google.protobuf.InvalidProtocolBufferException {
5574           Builder builder = newBuilder();
5575           try {
5576             builder.mergeFrom(input, extensionRegistry);
5577           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
5578             throw e.setUnfinishedMessage(builder.buildPartial());
5579           } catch (com.google.protobuf.UninitializedMessageException e) {
5580             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
5581           } catch (java.io.IOException e) {
5582             throw new com.google.protobuf.InvalidProtocolBufferException(e)
5583                 .setUnfinishedMessage(builder.buildPartial());
5584           }
5585           return builder.buildPartial();
5586         }
5587       };
5588 
parser()5589   public static com.google.protobuf.Parser<Policy> parser() {
5590     return PARSER;
5591   }
5592 
5593   @java.lang.Override
getParserForType()5594   public com.google.protobuf.Parser<Policy> getParserForType() {
5595     return PARSER;
5596   }
5597 
5598   @java.lang.Override
getDefaultInstanceForType()5599   public com.google.cloud.orgpolicy.v1.Policy getDefaultInstanceForType() {
5600     return DEFAULT_INSTANCE;
5601   }
5602 }
5603