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