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