• 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/channel/v1/offers.proto
18 
19 package com.google.cloud.channel.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Represents constraints required to purchase the Offer for a customer.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.channel.v1.CustomerConstraints}
29  */
30 public final class CustomerConstraints extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.channel.v1.CustomerConstraints)
33     CustomerConstraintsOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use CustomerConstraints.newBuilder() to construct.
CustomerConstraints(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private CustomerConstraints(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
CustomerConstraints()40   private CustomerConstraints() {
41     allowedRegions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
42     allowedCustomerTypes_ = java.util.Collections.emptyList();
43     promotionalOrderTypes_ = java.util.Collections.emptyList();
44   }
45 
46   @java.lang.Override
47   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)48   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
49     return new CustomerConstraints();
50   }
51 
52   @java.lang.Override
getUnknownFields()53   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
54     return this.unknownFields;
55   }
56 
getDescriptor()57   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
58     return com.google.cloud.channel.v1.OffersProto
59         .internal_static_google_cloud_channel_v1_CustomerConstraints_descriptor;
60   }
61 
62   @java.lang.Override
63   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()64       internalGetFieldAccessorTable() {
65     return com.google.cloud.channel.v1.OffersProto
66         .internal_static_google_cloud_channel_v1_CustomerConstraints_fieldAccessorTable
67         .ensureFieldAccessorsInitialized(
68             com.google.cloud.channel.v1.CustomerConstraints.class,
69             com.google.cloud.channel.v1.CustomerConstraints.Builder.class);
70   }
71 
72   public static final int ALLOWED_REGIONS_FIELD_NUMBER = 1;
73 
74   @SuppressWarnings("serial")
75   private com.google.protobuf.LazyStringList allowedRegions_;
76   /**
77    *
78    *
79    * <pre>
80    * Allowed geographical regions of the customer.
81    * </pre>
82    *
83    * <code>repeated string allowed_regions = 1;</code>
84    *
85    * @return A list containing the allowedRegions.
86    */
getAllowedRegionsList()87   public com.google.protobuf.ProtocolStringList getAllowedRegionsList() {
88     return allowedRegions_;
89   }
90   /**
91    *
92    *
93    * <pre>
94    * Allowed geographical regions of the customer.
95    * </pre>
96    *
97    * <code>repeated string allowed_regions = 1;</code>
98    *
99    * @return The count of allowedRegions.
100    */
getAllowedRegionsCount()101   public int getAllowedRegionsCount() {
102     return allowedRegions_.size();
103   }
104   /**
105    *
106    *
107    * <pre>
108    * Allowed geographical regions of the customer.
109    * </pre>
110    *
111    * <code>repeated string allowed_regions = 1;</code>
112    *
113    * @param index The index of the element to return.
114    * @return The allowedRegions at the given index.
115    */
getAllowedRegions(int index)116   public java.lang.String getAllowedRegions(int index) {
117     return allowedRegions_.get(index);
118   }
119   /**
120    *
121    *
122    * <pre>
123    * Allowed geographical regions of the customer.
124    * </pre>
125    *
126    * <code>repeated string allowed_regions = 1;</code>
127    *
128    * @param index The index of the value to return.
129    * @return The bytes of the allowedRegions at the given index.
130    */
getAllowedRegionsBytes(int index)131   public com.google.protobuf.ByteString getAllowedRegionsBytes(int index) {
132     return allowedRegions_.getByteString(index);
133   }
134 
135   public static final int ALLOWED_CUSTOMER_TYPES_FIELD_NUMBER = 2;
136 
137   @SuppressWarnings("serial")
138   private java.util.List<java.lang.Integer> allowedCustomerTypes_;
139 
140   private static final com.google.protobuf.Internal.ListAdapter.Converter<
141           java.lang.Integer, com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType>
142       allowedCustomerTypes_converter_ =
143           new com.google.protobuf.Internal.ListAdapter.Converter<
144               java.lang.Integer, com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType>() {
145             public com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType convert(
146                 java.lang.Integer from) {
147               com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType result =
148                   com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType.forNumber(from);
149               return result == null
150                   ? com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType.UNRECOGNIZED
151                   : result;
152             }
153           };
154   /**
155    *
156    *
157    * <pre>
158    * Allowed Customer Type.
159    * </pre>
160    *
161    * <code>
162    * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
163    * </code>
164    *
165    * @return A list containing the allowedCustomerTypes.
166    */
167   @java.lang.Override
168   public java.util.List<com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType>
getAllowedCustomerTypesList()169       getAllowedCustomerTypesList() {
170     return new com.google.protobuf.Internal.ListAdapter<
171         java.lang.Integer, com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType>(
172         allowedCustomerTypes_, allowedCustomerTypes_converter_);
173   }
174   /**
175    *
176    *
177    * <pre>
178    * Allowed Customer Type.
179    * </pre>
180    *
181    * <code>
182    * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
183    * </code>
184    *
185    * @return The count of allowedCustomerTypes.
186    */
187   @java.lang.Override
getAllowedCustomerTypesCount()188   public int getAllowedCustomerTypesCount() {
189     return allowedCustomerTypes_.size();
190   }
191   /**
192    *
193    *
194    * <pre>
195    * Allowed Customer Type.
196    * </pre>
197    *
198    * <code>
199    * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
200    * </code>
201    *
202    * @param index The index of the element to return.
203    * @return The allowedCustomerTypes at the given index.
204    */
205   @java.lang.Override
getAllowedCustomerTypes( int index)206   public com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType getAllowedCustomerTypes(
207       int index) {
208     return allowedCustomerTypes_converter_.convert(allowedCustomerTypes_.get(index));
209   }
210   /**
211    *
212    *
213    * <pre>
214    * Allowed Customer Type.
215    * </pre>
216    *
217    * <code>
218    * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
219    * </code>
220    *
221    * @return A list containing the enum numeric values on the wire for allowedCustomerTypes.
222    */
223   @java.lang.Override
getAllowedCustomerTypesValueList()224   public java.util.List<java.lang.Integer> getAllowedCustomerTypesValueList() {
225     return allowedCustomerTypes_;
226   }
227   /**
228    *
229    *
230    * <pre>
231    * Allowed Customer Type.
232    * </pre>
233    *
234    * <code>
235    * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
236    * </code>
237    *
238    * @param index The index of the value to return.
239    * @return The enum numeric value on the wire of allowedCustomerTypes at the given index.
240    */
241   @java.lang.Override
getAllowedCustomerTypesValue(int index)242   public int getAllowedCustomerTypesValue(int index) {
243     return allowedCustomerTypes_.get(index);
244   }
245 
246   private int allowedCustomerTypesMemoizedSerializedSize;
247 
248   public static final int PROMOTIONAL_ORDER_TYPES_FIELD_NUMBER = 3;
249 
250   @SuppressWarnings("serial")
251   private java.util.List<java.lang.Integer> promotionalOrderTypes_;
252 
253   private static final com.google.protobuf.Internal.ListAdapter.Converter<
254           java.lang.Integer, com.google.cloud.channel.v1.PromotionalOrderType>
255       promotionalOrderTypes_converter_ =
256           new com.google.protobuf.Internal.ListAdapter.Converter<
257               java.lang.Integer, com.google.cloud.channel.v1.PromotionalOrderType>() {
258             public com.google.cloud.channel.v1.PromotionalOrderType convert(
259                 java.lang.Integer from) {
260               com.google.cloud.channel.v1.PromotionalOrderType result =
261                   com.google.cloud.channel.v1.PromotionalOrderType.forNumber(from);
262               return result == null
263                   ? com.google.cloud.channel.v1.PromotionalOrderType.UNRECOGNIZED
264                   : result;
265             }
266           };
267   /**
268    *
269    *
270    * <pre>
271    * Allowed Promotional Order Type. Present for Promotional offers.
272    * </pre>
273    *
274    * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
275    * </code>
276    *
277    * @return A list containing the promotionalOrderTypes.
278    */
279   @java.lang.Override
280   public java.util.List<com.google.cloud.channel.v1.PromotionalOrderType>
getPromotionalOrderTypesList()281       getPromotionalOrderTypesList() {
282     return new com.google.protobuf.Internal.ListAdapter<
283         java.lang.Integer, com.google.cloud.channel.v1.PromotionalOrderType>(
284         promotionalOrderTypes_, promotionalOrderTypes_converter_);
285   }
286   /**
287    *
288    *
289    * <pre>
290    * Allowed Promotional Order Type. Present for Promotional offers.
291    * </pre>
292    *
293    * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
294    * </code>
295    *
296    * @return The count of promotionalOrderTypes.
297    */
298   @java.lang.Override
getPromotionalOrderTypesCount()299   public int getPromotionalOrderTypesCount() {
300     return promotionalOrderTypes_.size();
301   }
302   /**
303    *
304    *
305    * <pre>
306    * Allowed Promotional Order Type. Present for Promotional offers.
307    * </pre>
308    *
309    * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
310    * </code>
311    *
312    * @param index The index of the element to return.
313    * @return The promotionalOrderTypes at the given index.
314    */
315   @java.lang.Override
getPromotionalOrderTypes(int index)316   public com.google.cloud.channel.v1.PromotionalOrderType getPromotionalOrderTypes(int index) {
317     return promotionalOrderTypes_converter_.convert(promotionalOrderTypes_.get(index));
318   }
319   /**
320    *
321    *
322    * <pre>
323    * Allowed Promotional Order Type. Present for Promotional offers.
324    * </pre>
325    *
326    * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
327    * </code>
328    *
329    * @return A list containing the enum numeric values on the wire for promotionalOrderTypes.
330    */
331   @java.lang.Override
getPromotionalOrderTypesValueList()332   public java.util.List<java.lang.Integer> getPromotionalOrderTypesValueList() {
333     return promotionalOrderTypes_;
334   }
335   /**
336    *
337    *
338    * <pre>
339    * Allowed Promotional Order Type. Present for Promotional offers.
340    * </pre>
341    *
342    * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
343    * </code>
344    *
345    * @param index The index of the value to return.
346    * @return The enum numeric value on the wire of promotionalOrderTypes at the given index.
347    */
348   @java.lang.Override
getPromotionalOrderTypesValue(int index)349   public int getPromotionalOrderTypesValue(int index) {
350     return promotionalOrderTypes_.get(index);
351   }
352 
353   private int promotionalOrderTypesMemoizedSerializedSize;
354 
355   private byte memoizedIsInitialized = -1;
356 
357   @java.lang.Override
isInitialized()358   public final boolean isInitialized() {
359     byte isInitialized = memoizedIsInitialized;
360     if (isInitialized == 1) return true;
361     if (isInitialized == 0) return false;
362 
363     memoizedIsInitialized = 1;
364     return true;
365   }
366 
367   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)368   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
369     getSerializedSize();
370     for (int i = 0; i < allowedRegions_.size(); i++) {
371       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedRegions_.getRaw(i));
372     }
373     if (getAllowedCustomerTypesList().size() > 0) {
374       output.writeUInt32NoTag(18);
375       output.writeUInt32NoTag(allowedCustomerTypesMemoizedSerializedSize);
376     }
377     for (int i = 0; i < allowedCustomerTypes_.size(); i++) {
378       output.writeEnumNoTag(allowedCustomerTypes_.get(i));
379     }
380     if (getPromotionalOrderTypesList().size() > 0) {
381       output.writeUInt32NoTag(26);
382       output.writeUInt32NoTag(promotionalOrderTypesMemoizedSerializedSize);
383     }
384     for (int i = 0; i < promotionalOrderTypes_.size(); i++) {
385       output.writeEnumNoTag(promotionalOrderTypes_.get(i));
386     }
387     getUnknownFields().writeTo(output);
388   }
389 
390   @java.lang.Override
getSerializedSize()391   public int getSerializedSize() {
392     int size = memoizedSize;
393     if (size != -1) return size;
394 
395     size = 0;
396     {
397       int dataSize = 0;
398       for (int i = 0; i < allowedRegions_.size(); i++) {
399         dataSize += computeStringSizeNoTag(allowedRegions_.getRaw(i));
400       }
401       size += dataSize;
402       size += 1 * getAllowedRegionsList().size();
403     }
404     {
405       int dataSize = 0;
406       for (int i = 0; i < allowedCustomerTypes_.size(); i++) {
407         dataSize +=
408             com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(
409                 allowedCustomerTypes_.get(i));
410       }
411       size += dataSize;
412       if (!getAllowedCustomerTypesList().isEmpty()) {
413         size += 1;
414         size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
415       }
416       allowedCustomerTypesMemoizedSerializedSize = dataSize;
417     }
418     {
419       int dataSize = 0;
420       for (int i = 0; i < promotionalOrderTypes_.size(); i++) {
421         dataSize +=
422             com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(
423                 promotionalOrderTypes_.get(i));
424       }
425       size += dataSize;
426       if (!getPromotionalOrderTypesList().isEmpty()) {
427         size += 1;
428         size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
429       }
430       promotionalOrderTypesMemoizedSerializedSize = dataSize;
431     }
432     size += getUnknownFields().getSerializedSize();
433     memoizedSize = size;
434     return size;
435   }
436 
437   @java.lang.Override
equals(final java.lang.Object obj)438   public boolean equals(final java.lang.Object obj) {
439     if (obj == this) {
440       return true;
441     }
442     if (!(obj instanceof com.google.cloud.channel.v1.CustomerConstraints)) {
443       return super.equals(obj);
444     }
445     com.google.cloud.channel.v1.CustomerConstraints other =
446         (com.google.cloud.channel.v1.CustomerConstraints) obj;
447 
448     if (!getAllowedRegionsList().equals(other.getAllowedRegionsList())) return false;
449     if (!allowedCustomerTypes_.equals(other.allowedCustomerTypes_)) return false;
450     if (!promotionalOrderTypes_.equals(other.promotionalOrderTypes_)) return false;
451     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
452     return true;
453   }
454 
455   @java.lang.Override
hashCode()456   public int hashCode() {
457     if (memoizedHashCode != 0) {
458       return memoizedHashCode;
459     }
460     int hash = 41;
461     hash = (19 * hash) + getDescriptor().hashCode();
462     if (getAllowedRegionsCount() > 0) {
463       hash = (37 * hash) + ALLOWED_REGIONS_FIELD_NUMBER;
464       hash = (53 * hash) + getAllowedRegionsList().hashCode();
465     }
466     if (getAllowedCustomerTypesCount() > 0) {
467       hash = (37 * hash) + ALLOWED_CUSTOMER_TYPES_FIELD_NUMBER;
468       hash = (53 * hash) + allowedCustomerTypes_.hashCode();
469     }
470     if (getPromotionalOrderTypesCount() > 0) {
471       hash = (37 * hash) + PROMOTIONAL_ORDER_TYPES_FIELD_NUMBER;
472       hash = (53 * hash) + promotionalOrderTypes_.hashCode();
473     }
474     hash = (29 * hash) + getUnknownFields().hashCode();
475     memoizedHashCode = hash;
476     return hash;
477   }
478 
parseFrom(java.nio.ByteBuffer data)479   public static com.google.cloud.channel.v1.CustomerConstraints parseFrom(java.nio.ByteBuffer data)
480       throws com.google.protobuf.InvalidProtocolBufferException {
481     return PARSER.parseFrom(data);
482   }
483 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)484   public static com.google.cloud.channel.v1.CustomerConstraints parseFrom(
485       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
486       throws com.google.protobuf.InvalidProtocolBufferException {
487     return PARSER.parseFrom(data, extensionRegistry);
488   }
489 
parseFrom( com.google.protobuf.ByteString data)490   public static com.google.cloud.channel.v1.CustomerConstraints parseFrom(
491       com.google.protobuf.ByteString data)
492       throws com.google.protobuf.InvalidProtocolBufferException {
493     return PARSER.parseFrom(data);
494   }
495 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)496   public static com.google.cloud.channel.v1.CustomerConstraints parseFrom(
497       com.google.protobuf.ByteString data,
498       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
499       throws com.google.protobuf.InvalidProtocolBufferException {
500     return PARSER.parseFrom(data, extensionRegistry);
501   }
502 
parseFrom(byte[] data)503   public static com.google.cloud.channel.v1.CustomerConstraints parseFrom(byte[] data)
504       throws com.google.protobuf.InvalidProtocolBufferException {
505     return PARSER.parseFrom(data);
506   }
507 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)508   public static com.google.cloud.channel.v1.CustomerConstraints parseFrom(
509       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
510       throws com.google.protobuf.InvalidProtocolBufferException {
511     return PARSER.parseFrom(data, extensionRegistry);
512   }
513 
parseFrom(java.io.InputStream input)514   public static com.google.cloud.channel.v1.CustomerConstraints parseFrom(java.io.InputStream input)
515       throws java.io.IOException {
516     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
517   }
518 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)519   public static com.google.cloud.channel.v1.CustomerConstraints parseFrom(
520       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
521       throws java.io.IOException {
522     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
523         PARSER, input, extensionRegistry);
524   }
525 
parseDelimitedFrom( java.io.InputStream input)526   public static com.google.cloud.channel.v1.CustomerConstraints parseDelimitedFrom(
527       java.io.InputStream input) throws java.io.IOException {
528     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
529   }
530 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)531   public static com.google.cloud.channel.v1.CustomerConstraints parseDelimitedFrom(
532       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
533       throws java.io.IOException {
534     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
535         PARSER, input, extensionRegistry);
536   }
537 
parseFrom( com.google.protobuf.CodedInputStream input)538   public static com.google.cloud.channel.v1.CustomerConstraints parseFrom(
539       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
540     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
541   }
542 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)543   public static com.google.cloud.channel.v1.CustomerConstraints parseFrom(
544       com.google.protobuf.CodedInputStream input,
545       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
546       throws java.io.IOException {
547     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
548         PARSER, input, extensionRegistry);
549   }
550 
551   @java.lang.Override
newBuilderForType()552   public Builder newBuilderForType() {
553     return newBuilder();
554   }
555 
newBuilder()556   public static Builder newBuilder() {
557     return DEFAULT_INSTANCE.toBuilder();
558   }
559 
newBuilder(com.google.cloud.channel.v1.CustomerConstraints prototype)560   public static Builder newBuilder(com.google.cloud.channel.v1.CustomerConstraints prototype) {
561     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
562   }
563 
564   @java.lang.Override
toBuilder()565   public Builder toBuilder() {
566     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
567   }
568 
569   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)570   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
571     Builder builder = new Builder(parent);
572     return builder;
573   }
574   /**
575    *
576    *
577    * <pre>
578    * Represents constraints required to purchase the Offer for a customer.
579    * </pre>
580    *
581    * Protobuf type {@code google.cloud.channel.v1.CustomerConstraints}
582    */
583   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
584       implements
585       // @@protoc_insertion_point(builder_implements:google.cloud.channel.v1.CustomerConstraints)
586       com.google.cloud.channel.v1.CustomerConstraintsOrBuilder {
getDescriptor()587     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
588       return com.google.cloud.channel.v1.OffersProto
589           .internal_static_google_cloud_channel_v1_CustomerConstraints_descriptor;
590     }
591 
592     @java.lang.Override
593     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()594         internalGetFieldAccessorTable() {
595       return com.google.cloud.channel.v1.OffersProto
596           .internal_static_google_cloud_channel_v1_CustomerConstraints_fieldAccessorTable
597           .ensureFieldAccessorsInitialized(
598               com.google.cloud.channel.v1.CustomerConstraints.class,
599               com.google.cloud.channel.v1.CustomerConstraints.Builder.class);
600     }
601 
602     // Construct using com.google.cloud.channel.v1.CustomerConstraints.newBuilder()
Builder()603     private Builder() {}
604 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)605     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
606       super(parent);
607     }
608 
609     @java.lang.Override
clear()610     public Builder clear() {
611       super.clear();
612       bitField0_ = 0;
613       allowedRegions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
614       bitField0_ = (bitField0_ & ~0x00000001);
615       allowedCustomerTypes_ = java.util.Collections.emptyList();
616       bitField0_ = (bitField0_ & ~0x00000002);
617       promotionalOrderTypes_ = java.util.Collections.emptyList();
618       bitField0_ = (bitField0_ & ~0x00000004);
619       return this;
620     }
621 
622     @java.lang.Override
getDescriptorForType()623     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
624       return com.google.cloud.channel.v1.OffersProto
625           .internal_static_google_cloud_channel_v1_CustomerConstraints_descriptor;
626     }
627 
628     @java.lang.Override
getDefaultInstanceForType()629     public com.google.cloud.channel.v1.CustomerConstraints getDefaultInstanceForType() {
630       return com.google.cloud.channel.v1.CustomerConstraints.getDefaultInstance();
631     }
632 
633     @java.lang.Override
build()634     public com.google.cloud.channel.v1.CustomerConstraints build() {
635       com.google.cloud.channel.v1.CustomerConstraints result = buildPartial();
636       if (!result.isInitialized()) {
637         throw newUninitializedMessageException(result);
638       }
639       return result;
640     }
641 
642     @java.lang.Override
buildPartial()643     public com.google.cloud.channel.v1.CustomerConstraints buildPartial() {
644       com.google.cloud.channel.v1.CustomerConstraints result =
645           new com.google.cloud.channel.v1.CustomerConstraints(this);
646       buildPartialRepeatedFields(result);
647       if (bitField0_ != 0) {
648         buildPartial0(result);
649       }
650       onBuilt();
651       return result;
652     }
653 
buildPartialRepeatedFields( com.google.cloud.channel.v1.CustomerConstraints result)654     private void buildPartialRepeatedFields(
655         com.google.cloud.channel.v1.CustomerConstraints result) {
656       if (((bitField0_ & 0x00000001) != 0)) {
657         allowedRegions_ = allowedRegions_.getUnmodifiableView();
658         bitField0_ = (bitField0_ & ~0x00000001);
659       }
660       result.allowedRegions_ = allowedRegions_;
661       if (((bitField0_ & 0x00000002) != 0)) {
662         allowedCustomerTypes_ = java.util.Collections.unmodifiableList(allowedCustomerTypes_);
663         bitField0_ = (bitField0_ & ~0x00000002);
664       }
665       result.allowedCustomerTypes_ = allowedCustomerTypes_;
666       if (((bitField0_ & 0x00000004) != 0)) {
667         promotionalOrderTypes_ = java.util.Collections.unmodifiableList(promotionalOrderTypes_);
668         bitField0_ = (bitField0_ & ~0x00000004);
669       }
670       result.promotionalOrderTypes_ = promotionalOrderTypes_;
671     }
672 
buildPartial0(com.google.cloud.channel.v1.CustomerConstraints result)673     private void buildPartial0(com.google.cloud.channel.v1.CustomerConstraints result) {
674       int from_bitField0_ = bitField0_;
675     }
676 
677     @java.lang.Override
clone()678     public Builder clone() {
679       return super.clone();
680     }
681 
682     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)683     public Builder setField(
684         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
685       return super.setField(field, value);
686     }
687 
688     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)689     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
690       return super.clearField(field);
691     }
692 
693     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)694     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
695       return super.clearOneof(oneof);
696     }
697 
698     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)699     public Builder setRepeatedField(
700         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
701       return super.setRepeatedField(field, index, value);
702     }
703 
704     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)705     public Builder addRepeatedField(
706         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
707       return super.addRepeatedField(field, value);
708     }
709 
710     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)711     public Builder mergeFrom(com.google.protobuf.Message other) {
712       if (other instanceof com.google.cloud.channel.v1.CustomerConstraints) {
713         return mergeFrom((com.google.cloud.channel.v1.CustomerConstraints) other);
714       } else {
715         super.mergeFrom(other);
716         return this;
717       }
718     }
719 
mergeFrom(com.google.cloud.channel.v1.CustomerConstraints other)720     public Builder mergeFrom(com.google.cloud.channel.v1.CustomerConstraints other) {
721       if (other == com.google.cloud.channel.v1.CustomerConstraints.getDefaultInstance())
722         return this;
723       if (!other.allowedRegions_.isEmpty()) {
724         if (allowedRegions_.isEmpty()) {
725           allowedRegions_ = other.allowedRegions_;
726           bitField0_ = (bitField0_ & ~0x00000001);
727         } else {
728           ensureAllowedRegionsIsMutable();
729           allowedRegions_.addAll(other.allowedRegions_);
730         }
731         onChanged();
732       }
733       if (!other.allowedCustomerTypes_.isEmpty()) {
734         if (allowedCustomerTypes_.isEmpty()) {
735           allowedCustomerTypes_ = other.allowedCustomerTypes_;
736           bitField0_ = (bitField0_ & ~0x00000002);
737         } else {
738           ensureAllowedCustomerTypesIsMutable();
739           allowedCustomerTypes_.addAll(other.allowedCustomerTypes_);
740         }
741         onChanged();
742       }
743       if (!other.promotionalOrderTypes_.isEmpty()) {
744         if (promotionalOrderTypes_.isEmpty()) {
745           promotionalOrderTypes_ = other.promotionalOrderTypes_;
746           bitField0_ = (bitField0_ & ~0x00000004);
747         } else {
748           ensurePromotionalOrderTypesIsMutable();
749           promotionalOrderTypes_.addAll(other.promotionalOrderTypes_);
750         }
751         onChanged();
752       }
753       this.mergeUnknownFields(other.getUnknownFields());
754       onChanged();
755       return this;
756     }
757 
758     @java.lang.Override
isInitialized()759     public final boolean isInitialized() {
760       return true;
761     }
762 
763     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)764     public Builder mergeFrom(
765         com.google.protobuf.CodedInputStream input,
766         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
767         throws java.io.IOException {
768       if (extensionRegistry == null) {
769         throw new java.lang.NullPointerException();
770       }
771       try {
772         boolean done = false;
773         while (!done) {
774           int tag = input.readTag();
775           switch (tag) {
776             case 0:
777               done = true;
778               break;
779             case 10:
780               {
781                 java.lang.String s = input.readStringRequireUtf8();
782                 ensureAllowedRegionsIsMutable();
783                 allowedRegions_.add(s);
784                 break;
785               } // case 10
786             case 16:
787               {
788                 int tmpRaw = input.readEnum();
789                 ensureAllowedCustomerTypesIsMutable();
790                 allowedCustomerTypes_.add(tmpRaw);
791                 break;
792               } // case 16
793             case 18:
794               {
795                 int length = input.readRawVarint32();
796                 int oldLimit = input.pushLimit(length);
797                 while (input.getBytesUntilLimit() > 0) {
798                   int tmpRaw = input.readEnum();
799                   ensureAllowedCustomerTypesIsMutable();
800                   allowedCustomerTypes_.add(tmpRaw);
801                 }
802                 input.popLimit(oldLimit);
803                 break;
804               } // case 18
805             case 24:
806               {
807                 int tmpRaw = input.readEnum();
808                 ensurePromotionalOrderTypesIsMutable();
809                 promotionalOrderTypes_.add(tmpRaw);
810                 break;
811               } // case 24
812             case 26:
813               {
814                 int length = input.readRawVarint32();
815                 int oldLimit = input.pushLimit(length);
816                 while (input.getBytesUntilLimit() > 0) {
817                   int tmpRaw = input.readEnum();
818                   ensurePromotionalOrderTypesIsMutable();
819                   promotionalOrderTypes_.add(tmpRaw);
820                 }
821                 input.popLimit(oldLimit);
822                 break;
823               } // case 26
824             default:
825               {
826                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
827                   done = true; // was an endgroup tag
828                 }
829                 break;
830               } // default:
831           } // switch (tag)
832         } // while (!done)
833       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
834         throw e.unwrapIOException();
835       } finally {
836         onChanged();
837       } // finally
838       return this;
839     }
840 
841     private int bitField0_;
842 
843     private com.google.protobuf.LazyStringList allowedRegions_ =
844         com.google.protobuf.LazyStringArrayList.EMPTY;
845 
ensureAllowedRegionsIsMutable()846     private void ensureAllowedRegionsIsMutable() {
847       if (!((bitField0_ & 0x00000001) != 0)) {
848         allowedRegions_ = new com.google.protobuf.LazyStringArrayList(allowedRegions_);
849         bitField0_ |= 0x00000001;
850       }
851     }
852     /**
853      *
854      *
855      * <pre>
856      * Allowed geographical regions of the customer.
857      * </pre>
858      *
859      * <code>repeated string allowed_regions = 1;</code>
860      *
861      * @return A list containing the allowedRegions.
862      */
getAllowedRegionsList()863     public com.google.protobuf.ProtocolStringList getAllowedRegionsList() {
864       return allowedRegions_.getUnmodifiableView();
865     }
866     /**
867      *
868      *
869      * <pre>
870      * Allowed geographical regions of the customer.
871      * </pre>
872      *
873      * <code>repeated string allowed_regions = 1;</code>
874      *
875      * @return The count of allowedRegions.
876      */
getAllowedRegionsCount()877     public int getAllowedRegionsCount() {
878       return allowedRegions_.size();
879     }
880     /**
881      *
882      *
883      * <pre>
884      * Allowed geographical regions of the customer.
885      * </pre>
886      *
887      * <code>repeated string allowed_regions = 1;</code>
888      *
889      * @param index The index of the element to return.
890      * @return The allowedRegions at the given index.
891      */
getAllowedRegions(int index)892     public java.lang.String getAllowedRegions(int index) {
893       return allowedRegions_.get(index);
894     }
895     /**
896      *
897      *
898      * <pre>
899      * Allowed geographical regions of the customer.
900      * </pre>
901      *
902      * <code>repeated string allowed_regions = 1;</code>
903      *
904      * @param index The index of the value to return.
905      * @return The bytes of the allowedRegions at the given index.
906      */
getAllowedRegionsBytes(int index)907     public com.google.protobuf.ByteString getAllowedRegionsBytes(int index) {
908       return allowedRegions_.getByteString(index);
909     }
910     /**
911      *
912      *
913      * <pre>
914      * Allowed geographical regions of the customer.
915      * </pre>
916      *
917      * <code>repeated string allowed_regions = 1;</code>
918      *
919      * @param index The index to set the value at.
920      * @param value The allowedRegions to set.
921      * @return This builder for chaining.
922      */
setAllowedRegions(int index, java.lang.String value)923     public Builder setAllowedRegions(int index, java.lang.String value) {
924       if (value == null) {
925         throw new NullPointerException();
926       }
927       ensureAllowedRegionsIsMutable();
928       allowedRegions_.set(index, value);
929       onChanged();
930       return this;
931     }
932     /**
933      *
934      *
935      * <pre>
936      * Allowed geographical regions of the customer.
937      * </pre>
938      *
939      * <code>repeated string allowed_regions = 1;</code>
940      *
941      * @param value The allowedRegions to add.
942      * @return This builder for chaining.
943      */
addAllowedRegions(java.lang.String value)944     public Builder addAllowedRegions(java.lang.String value) {
945       if (value == null) {
946         throw new NullPointerException();
947       }
948       ensureAllowedRegionsIsMutable();
949       allowedRegions_.add(value);
950       onChanged();
951       return this;
952     }
953     /**
954      *
955      *
956      * <pre>
957      * Allowed geographical regions of the customer.
958      * </pre>
959      *
960      * <code>repeated string allowed_regions = 1;</code>
961      *
962      * @param values The allowedRegions to add.
963      * @return This builder for chaining.
964      */
addAllAllowedRegions(java.lang.Iterable<java.lang.String> values)965     public Builder addAllAllowedRegions(java.lang.Iterable<java.lang.String> values) {
966       ensureAllowedRegionsIsMutable();
967       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedRegions_);
968       onChanged();
969       return this;
970     }
971     /**
972      *
973      *
974      * <pre>
975      * Allowed geographical regions of the customer.
976      * </pre>
977      *
978      * <code>repeated string allowed_regions = 1;</code>
979      *
980      * @return This builder for chaining.
981      */
clearAllowedRegions()982     public Builder clearAllowedRegions() {
983       allowedRegions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
984       bitField0_ = (bitField0_ & ~0x00000001);
985       onChanged();
986       return this;
987     }
988     /**
989      *
990      *
991      * <pre>
992      * Allowed geographical regions of the customer.
993      * </pre>
994      *
995      * <code>repeated string allowed_regions = 1;</code>
996      *
997      * @param value The bytes of the allowedRegions to add.
998      * @return This builder for chaining.
999      */
addAllowedRegionsBytes(com.google.protobuf.ByteString value)1000     public Builder addAllowedRegionsBytes(com.google.protobuf.ByteString value) {
1001       if (value == null) {
1002         throw new NullPointerException();
1003       }
1004       checkByteStringIsUtf8(value);
1005       ensureAllowedRegionsIsMutable();
1006       allowedRegions_.add(value);
1007       onChanged();
1008       return this;
1009     }
1010 
1011     private java.util.List<java.lang.Integer> allowedCustomerTypes_ =
1012         java.util.Collections.emptyList();
1013 
ensureAllowedCustomerTypesIsMutable()1014     private void ensureAllowedCustomerTypesIsMutable() {
1015       if (!((bitField0_ & 0x00000002) != 0)) {
1016         allowedCustomerTypes_ = new java.util.ArrayList<java.lang.Integer>(allowedCustomerTypes_);
1017         bitField0_ |= 0x00000002;
1018       }
1019     }
1020     /**
1021      *
1022      *
1023      * <pre>
1024      * Allowed Customer Type.
1025      * </pre>
1026      *
1027      * <code>
1028      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1029      * </code>
1030      *
1031      * @return A list containing the allowedCustomerTypes.
1032      */
1033     public java.util.List<com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType>
getAllowedCustomerTypesList()1034         getAllowedCustomerTypesList() {
1035       return new com.google.protobuf.Internal.ListAdapter<
1036           java.lang.Integer, com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType>(
1037           allowedCustomerTypes_, allowedCustomerTypes_converter_);
1038     }
1039     /**
1040      *
1041      *
1042      * <pre>
1043      * Allowed Customer Type.
1044      * </pre>
1045      *
1046      * <code>
1047      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1048      * </code>
1049      *
1050      * @return The count of allowedCustomerTypes.
1051      */
getAllowedCustomerTypesCount()1052     public int getAllowedCustomerTypesCount() {
1053       return allowedCustomerTypes_.size();
1054     }
1055     /**
1056      *
1057      *
1058      * <pre>
1059      * Allowed Customer Type.
1060      * </pre>
1061      *
1062      * <code>
1063      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1064      * </code>
1065      *
1066      * @param index The index of the element to return.
1067      * @return The allowedCustomerTypes at the given index.
1068      */
getAllowedCustomerTypes( int index)1069     public com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType getAllowedCustomerTypes(
1070         int index) {
1071       return allowedCustomerTypes_converter_.convert(allowedCustomerTypes_.get(index));
1072     }
1073     /**
1074      *
1075      *
1076      * <pre>
1077      * Allowed Customer Type.
1078      * </pre>
1079      *
1080      * <code>
1081      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1082      * </code>
1083      *
1084      * @param index The index to set the value at.
1085      * @param value The allowedCustomerTypes to set.
1086      * @return This builder for chaining.
1087      */
setAllowedCustomerTypes( int index, com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType value)1088     public Builder setAllowedCustomerTypes(
1089         int index, com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType value) {
1090       if (value == null) {
1091         throw new NullPointerException();
1092       }
1093       ensureAllowedCustomerTypesIsMutable();
1094       allowedCustomerTypes_.set(index, value.getNumber());
1095       onChanged();
1096       return this;
1097     }
1098     /**
1099      *
1100      *
1101      * <pre>
1102      * Allowed Customer Type.
1103      * </pre>
1104      *
1105      * <code>
1106      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1107      * </code>
1108      *
1109      * @param value The allowedCustomerTypes to add.
1110      * @return This builder for chaining.
1111      */
addAllowedCustomerTypes( com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType value)1112     public Builder addAllowedCustomerTypes(
1113         com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType value) {
1114       if (value == null) {
1115         throw new NullPointerException();
1116       }
1117       ensureAllowedCustomerTypesIsMutable();
1118       allowedCustomerTypes_.add(value.getNumber());
1119       onChanged();
1120       return this;
1121     }
1122     /**
1123      *
1124      *
1125      * <pre>
1126      * Allowed Customer Type.
1127      * </pre>
1128      *
1129      * <code>
1130      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1131      * </code>
1132      *
1133      * @param values The allowedCustomerTypes to add.
1134      * @return This builder for chaining.
1135      */
addAllAllowedCustomerTypes( java.lang.Iterable<? extends com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType> values)1136     public Builder addAllAllowedCustomerTypes(
1137         java.lang.Iterable<? extends com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType>
1138             values) {
1139       ensureAllowedCustomerTypesIsMutable();
1140       for (com.google.cloud.channel.v1.CloudIdentityInfo.CustomerType value : values) {
1141         allowedCustomerTypes_.add(value.getNumber());
1142       }
1143       onChanged();
1144       return this;
1145     }
1146     /**
1147      *
1148      *
1149      * <pre>
1150      * Allowed Customer Type.
1151      * </pre>
1152      *
1153      * <code>
1154      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1155      * </code>
1156      *
1157      * @return This builder for chaining.
1158      */
clearAllowedCustomerTypes()1159     public Builder clearAllowedCustomerTypes() {
1160       allowedCustomerTypes_ = java.util.Collections.emptyList();
1161       bitField0_ = (bitField0_ & ~0x00000002);
1162       onChanged();
1163       return this;
1164     }
1165     /**
1166      *
1167      *
1168      * <pre>
1169      * Allowed Customer Type.
1170      * </pre>
1171      *
1172      * <code>
1173      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1174      * </code>
1175      *
1176      * @return A list containing the enum numeric values on the wire for allowedCustomerTypes.
1177      */
getAllowedCustomerTypesValueList()1178     public java.util.List<java.lang.Integer> getAllowedCustomerTypesValueList() {
1179       return java.util.Collections.unmodifiableList(allowedCustomerTypes_);
1180     }
1181     /**
1182      *
1183      *
1184      * <pre>
1185      * Allowed Customer Type.
1186      * </pre>
1187      *
1188      * <code>
1189      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1190      * </code>
1191      *
1192      * @param index The index of the value to return.
1193      * @return The enum numeric value on the wire of allowedCustomerTypes at the given index.
1194      */
getAllowedCustomerTypesValue(int index)1195     public int getAllowedCustomerTypesValue(int index) {
1196       return allowedCustomerTypes_.get(index);
1197     }
1198     /**
1199      *
1200      *
1201      * <pre>
1202      * Allowed Customer Type.
1203      * </pre>
1204      *
1205      * <code>
1206      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1207      * </code>
1208      *
1209      * @param index The index to set the value at.
1210      * @param value The enum numeric value on the wire for allowedCustomerTypes to set.
1211      * @return This builder for chaining.
1212      */
setAllowedCustomerTypesValue(int index, int value)1213     public Builder setAllowedCustomerTypesValue(int index, int value) {
1214       ensureAllowedCustomerTypesIsMutable();
1215       allowedCustomerTypes_.set(index, value);
1216       onChanged();
1217       return this;
1218     }
1219     /**
1220      *
1221      *
1222      * <pre>
1223      * Allowed Customer Type.
1224      * </pre>
1225      *
1226      * <code>
1227      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1228      * </code>
1229      *
1230      * @param value The enum numeric value on the wire for allowedCustomerTypes to add.
1231      * @return This builder for chaining.
1232      */
addAllowedCustomerTypesValue(int value)1233     public Builder addAllowedCustomerTypesValue(int value) {
1234       ensureAllowedCustomerTypesIsMutable();
1235       allowedCustomerTypes_.add(value);
1236       onChanged();
1237       return this;
1238     }
1239     /**
1240      *
1241      *
1242      * <pre>
1243      * Allowed Customer Type.
1244      * </pre>
1245      *
1246      * <code>
1247      * repeated .google.cloud.channel.v1.CloudIdentityInfo.CustomerType allowed_customer_types = 2;
1248      * </code>
1249      *
1250      * @param values The enum numeric values on the wire for allowedCustomerTypes to add.
1251      * @return This builder for chaining.
1252      */
addAllAllowedCustomerTypesValue(java.lang.Iterable<java.lang.Integer> values)1253     public Builder addAllAllowedCustomerTypesValue(java.lang.Iterable<java.lang.Integer> values) {
1254       ensureAllowedCustomerTypesIsMutable();
1255       for (int value : values) {
1256         allowedCustomerTypes_.add(value);
1257       }
1258       onChanged();
1259       return this;
1260     }
1261 
1262     private java.util.List<java.lang.Integer> promotionalOrderTypes_ =
1263         java.util.Collections.emptyList();
1264 
ensurePromotionalOrderTypesIsMutable()1265     private void ensurePromotionalOrderTypesIsMutable() {
1266       if (!((bitField0_ & 0x00000004) != 0)) {
1267         promotionalOrderTypes_ = new java.util.ArrayList<java.lang.Integer>(promotionalOrderTypes_);
1268         bitField0_ |= 0x00000004;
1269       }
1270     }
1271     /**
1272      *
1273      *
1274      * <pre>
1275      * Allowed Promotional Order Type. Present for Promotional offers.
1276      * </pre>
1277      *
1278      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1279      * </code>
1280      *
1281      * @return A list containing the promotionalOrderTypes.
1282      */
1283     public java.util.List<com.google.cloud.channel.v1.PromotionalOrderType>
getPromotionalOrderTypesList()1284         getPromotionalOrderTypesList() {
1285       return new com.google.protobuf.Internal.ListAdapter<
1286           java.lang.Integer, com.google.cloud.channel.v1.PromotionalOrderType>(
1287           promotionalOrderTypes_, promotionalOrderTypes_converter_);
1288     }
1289     /**
1290      *
1291      *
1292      * <pre>
1293      * Allowed Promotional Order Type. Present for Promotional offers.
1294      * </pre>
1295      *
1296      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1297      * </code>
1298      *
1299      * @return The count of promotionalOrderTypes.
1300      */
getPromotionalOrderTypesCount()1301     public int getPromotionalOrderTypesCount() {
1302       return promotionalOrderTypes_.size();
1303     }
1304     /**
1305      *
1306      *
1307      * <pre>
1308      * Allowed Promotional Order Type. Present for Promotional offers.
1309      * </pre>
1310      *
1311      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1312      * </code>
1313      *
1314      * @param index The index of the element to return.
1315      * @return The promotionalOrderTypes at the given index.
1316      */
getPromotionalOrderTypes(int index)1317     public com.google.cloud.channel.v1.PromotionalOrderType getPromotionalOrderTypes(int index) {
1318       return promotionalOrderTypes_converter_.convert(promotionalOrderTypes_.get(index));
1319     }
1320     /**
1321      *
1322      *
1323      * <pre>
1324      * Allowed Promotional Order Type. Present for Promotional offers.
1325      * </pre>
1326      *
1327      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1328      * </code>
1329      *
1330      * @param index The index to set the value at.
1331      * @param value The promotionalOrderTypes to set.
1332      * @return This builder for chaining.
1333      */
setPromotionalOrderTypes( int index, com.google.cloud.channel.v1.PromotionalOrderType value)1334     public Builder setPromotionalOrderTypes(
1335         int index, com.google.cloud.channel.v1.PromotionalOrderType value) {
1336       if (value == null) {
1337         throw new NullPointerException();
1338       }
1339       ensurePromotionalOrderTypesIsMutable();
1340       promotionalOrderTypes_.set(index, value.getNumber());
1341       onChanged();
1342       return this;
1343     }
1344     /**
1345      *
1346      *
1347      * <pre>
1348      * Allowed Promotional Order Type. Present for Promotional offers.
1349      * </pre>
1350      *
1351      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1352      * </code>
1353      *
1354      * @param value The promotionalOrderTypes to add.
1355      * @return This builder for chaining.
1356      */
addPromotionalOrderTypes( com.google.cloud.channel.v1.PromotionalOrderType value)1357     public Builder addPromotionalOrderTypes(
1358         com.google.cloud.channel.v1.PromotionalOrderType value) {
1359       if (value == null) {
1360         throw new NullPointerException();
1361       }
1362       ensurePromotionalOrderTypesIsMutable();
1363       promotionalOrderTypes_.add(value.getNumber());
1364       onChanged();
1365       return this;
1366     }
1367     /**
1368      *
1369      *
1370      * <pre>
1371      * Allowed Promotional Order Type. Present for Promotional offers.
1372      * </pre>
1373      *
1374      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1375      * </code>
1376      *
1377      * @param values The promotionalOrderTypes to add.
1378      * @return This builder for chaining.
1379      */
addAllPromotionalOrderTypes( java.lang.Iterable<? extends com.google.cloud.channel.v1.PromotionalOrderType> values)1380     public Builder addAllPromotionalOrderTypes(
1381         java.lang.Iterable<? extends com.google.cloud.channel.v1.PromotionalOrderType> values) {
1382       ensurePromotionalOrderTypesIsMutable();
1383       for (com.google.cloud.channel.v1.PromotionalOrderType value : values) {
1384         promotionalOrderTypes_.add(value.getNumber());
1385       }
1386       onChanged();
1387       return this;
1388     }
1389     /**
1390      *
1391      *
1392      * <pre>
1393      * Allowed Promotional Order Type. Present for Promotional offers.
1394      * </pre>
1395      *
1396      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1397      * </code>
1398      *
1399      * @return This builder for chaining.
1400      */
clearPromotionalOrderTypes()1401     public Builder clearPromotionalOrderTypes() {
1402       promotionalOrderTypes_ = java.util.Collections.emptyList();
1403       bitField0_ = (bitField0_ & ~0x00000004);
1404       onChanged();
1405       return this;
1406     }
1407     /**
1408      *
1409      *
1410      * <pre>
1411      * Allowed Promotional Order Type. Present for Promotional offers.
1412      * </pre>
1413      *
1414      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1415      * </code>
1416      *
1417      * @return A list containing the enum numeric values on the wire for promotionalOrderTypes.
1418      */
getPromotionalOrderTypesValueList()1419     public java.util.List<java.lang.Integer> getPromotionalOrderTypesValueList() {
1420       return java.util.Collections.unmodifiableList(promotionalOrderTypes_);
1421     }
1422     /**
1423      *
1424      *
1425      * <pre>
1426      * Allowed Promotional Order Type. Present for Promotional offers.
1427      * </pre>
1428      *
1429      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1430      * </code>
1431      *
1432      * @param index The index of the value to return.
1433      * @return The enum numeric value on the wire of promotionalOrderTypes at the given index.
1434      */
getPromotionalOrderTypesValue(int index)1435     public int getPromotionalOrderTypesValue(int index) {
1436       return promotionalOrderTypes_.get(index);
1437     }
1438     /**
1439      *
1440      *
1441      * <pre>
1442      * Allowed Promotional Order Type. Present for Promotional offers.
1443      * </pre>
1444      *
1445      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1446      * </code>
1447      *
1448      * @param index The index to set the value at.
1449      * @param value The enum numeric value on the wire for promotionalOrderTypes to set.
1450      * @return This builder for chaining.
1451      */
setPromotionalOrderTypesValue(int index, int value)1452     public Builder setPromotionalOrderTypesValue(int index, int value) {
1453       ensurePromotionalOrderTypesIsMutable();
1454       promotionalOrderTypes_.set(index, value);
1455       onChanged();
1456       return this;
1457     }
1458     /**
1459      *
1460      *
1461      * <pre>
1462      * Allowed Promotional Order Type. Present for Promotional offers.
1463      * </pre>
1464      *
1465      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1466      * </code>
1467      *
1468      * @param value The enum numeric value on the wire for promotionalOrderTypes to add.
1469      * @return This builder for chaining.
1470      */
addPromotionalOrderTypesValue(int value)1471     public Builder addPromotionalOrderTypesValue(int value) {
1472       ensurePromotionalOrderTypesIsMutable();
1473       promotionalOrderTypes_.add(value);
1474       onChanged();
1475       return this;
1476     }
1477     /**
1478      *
1479      *
1480      * <pre>
1481      * Allowed Promotional Order Type. Present for Promotional offers.
1482      * </pre>
1483      *
1484      * <code>repeated .google.cloud.channel.v1.PromotionalOrderType promotional_order_types = 3;
1485      * </code>
1486      *
1487      * @param values The enum numeric values on the wire for promotionalOrderTypes to add.
1488      * @return This builder for chaining.
1489      */
addAllPromotionalOrderTypesValue(java.lang.Iterable<java.lang.Integer> values)1490     public Builder addAllPromotionalOrderTypesValue(java.lang.Iterable<java.lang.Integer> values) {
1491       ensurePromotionalOrderTypesIsMutable();
1492       for (int value : values) {
1493         promotionalOrderTypes_.add(value);
1494       }
1495       onChanged();
1496       return this;
1497     }
1498 
1499     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1500     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1501       return super.setUnknownFields(unknownFields);
1502     }
1503 
1504     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1505     public final Builder mergeUnknownFields(
1506         final com.google.protobuf.UnknownFieldSet unknownFields) {
1507       return super.mergeUnknownFields(unknownFields);
1508     }
1509 
1510     // @@protoc_insertion_point(builder_scope:google.cloud.channel.v1.CustomerConstraints)
1511   }
1512 
1513   // @@protoc_insertion_point(class_scope:google.cloud.channel.v1.CustomerConstraints)
1514   private static final com.google.cloud.channel.v1.CustomerConstraints DEFAULT_INSTANCE;
1515 
1516   static {
1517     DEFAULT_INSTANCE = new com.google.cloud.channel.v1.CustomerConstraints();
1518   }
1519 
getDefaultInstance()1520   public static com.google.cloud.channel.v1.CustomerConstraints getDefaultInstance() {
1521     return DEFAULT_INSTANCE;
1522   }
1523 
1524   private static final com.google.protobuf.Parser<CustomerConstraints> PARSER =
1525       new com.google.protobuf.AbstractParser<CustomerConstraints>() {
1526         @java.lang.Override
1527         public CustomerConstraints parsePartialFrom(
1528             com.google.protobuf.CodedInputStream input,
1529             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1530             throws com.google.protobuf.InvalidProtocolBufferException {
1531           Builder builder = newBuilder();
1532           try {
1533             builder.mergeFrom(input, extensionRegistry);
1534           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1535             throw e.setUnfinishedMessage(builder.buildPartial());
1536           } catch (com.google.protobuf.UninitializedMessageException e) {
1537             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1538           } catch (java.io.IOException e) {
1539             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1540                 .setUnfinishedMessage(builder.buildPartial());
1541           }
1542           return builder.buildPartial();
1543         }
1544       };
1545 
parser()1546   public static com.google.protobuf.Parser<CustomerConstraints> parser() {
1547     return PARSER;
1548   }
1549 
1550   @java.lang.Override
getParserForType()1551   public com.google.protobuf.Parser<CustomerConstraints> getParserForType() {
1552     return PARSER;
1553   }
1554 
1555   @java.lang.Override
getDefaultInstanceForType()1556   public com.google.cloud.channel.v1.CustomerConstraints getDefaultInstanceForType() {
1557     return DEFAULT_INSTANCE;
1558   }
1559 }
1560