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