• 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/retail/v2/search_service.proto
18 
19 package com.google.cloud.retail.v2;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Request message for
26  * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] method.
27  * </pre>
28  *
29  * Protobuf type {@code google.cloud.retail.v2.SearchRequest}
30  */
31 public final class SearchRequest extends com.google.protobuf.GeneratedMessageV3
32     implements
33     // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest)
34     SearchRequestOrBuilder {
35   private static final long serialVersionUID = 0L;
36   // Use SearchRequest.newBuilder() to construct.
SearchRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37   private SearchRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
38     super(builder);
39   }
40 
SearchRequest()41   private SearchRequest() {
42     placement_ = "";
43     branch_ = "";
44     query_ = "";
45     visitorId_ = "";
46     pageToken_ = "";
47     filter_ = "";
48     canonicalFilter_ = "";
49     orderBy_ = "";
50     facetSpecs_ = java.util.Collections.emptyList();
51     variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
52     pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY;
53     searchMode_ = 0;
54     entity_ = "";
55   }
56 
57   @java.lang.Override
58   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)59   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
60     return new SearchRequest();
61   }
62 
63   @java.lang.Override
getUnknownFields()64   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
65     return this.unknownFields;
66   }
67 
getDescriptor()68   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
69     return com.google.cloud.retail.v2.SearchServiceProto
70         .internal_static_google_cloud_retail_v2_SearchRequest_descriptor;
71   }
72 
73   @SuppressWarnings({"rawtypes"})
74   @java.lang.Override
internalGetMapField(int number)75   protected com.google.protobuf.MapField internalGetMapField(int number) {
76     switch (number) {
77       case 34:
78         return internalGetLabels();
79       default:
80         throw new RuntimeException("Invalid map field number: " + number);
81     }
82   }
83 
84   @java.lang.Override
85   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()86       internalGetFieldAccessorTable() {
87     return com.google.cloud.retail.v2.SearchServiceProto
88         .internal_static_google_cloud_retail_v2_SearchRequest_fieldAccessorTable
89         .ensureFieldAccessorsInitialized(
90             com.google.cloud.retail.v2.SearchRequest.class,
91             com.google.cloud.retail.v2.SearchRequest.Builder.class);
92   }
93 
94   /**
95    *
96    *
97    * <pre>
98    * The search mode of each search request.
99    * </pre>
100    *
101    * Protobuf enum {@code google.cloud.retail.v2.SearchRequest.SearchMode}
102    */
103   public enum SearchMode implements com.google.protobuf.ProtocolMessageEnum {
104     /**
105      *
106      *
107      * <pre>
108      * Default value. In this case both product search and faceted search will
109      * be performed. Both
110      * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult]
111      * and [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet]
112      * will be returned.
113      * </pre>
114      *
115      * <code>SEARCH_MODE_UNSPECIFIED = 0;</code>
116      */
117     SEARCH_MODE_UNSPECIFIED(0),
118     /**
119      *
120      *
121      * <pre>
122      * Only product search will be performed. The faceted search will be
123      * disabled.
124      * Only
125      * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult]
126      * will be returned.
127      * [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet] will
128      * not be returned, even if
129      * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
130      * or
131      * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2.SearchRequest.dynamic_facet_spec]
132      * is set.
133      * </pre>
134      *
135      * <code>PRODUCT_SEARCH_ONLY = 1;</code>
136      */
137     PRODUCT_SEARCH_ONLY(1),
138     /**
139      *
140      *
141      * <pre>
142      * Only faceted search will be performed. The product search will be
143      * disabled.
144      * When in this mode, one or both of
145      * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
146      * and
147      * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2.SearchRequest.dynamic_facet_spec]
148      * should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
149      * [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet] will
150      * be returned.
151      * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult]
152      * will not be returned.
153      * </pre>
154      *
155      * <code>FACETED_SEARCH_ONLY = 2;</code>
156      */
157     FACETED_SEARCH_ONLY(2),
158     UNRECOGNIZED(-1),
159     ;
160 
161     /**
162      *
163      *
164      * <pre>
165      * Default value. In this case both product search and faceted search will
166      * be performed. Both
167      * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult]
168      * and [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet]
169      * will be returned.
170      * </pre>
171      *
172      * <code>SEARCH_MODE_UNSPECIFIED = 0;</code>
173      */
174     public static final int SEARCH_MODE_UNSPECIFIED_VALUE = 0;
175     /**
176      *
177      *
178      * <pre>
179      * Only product search will be performed. The faceted search will be
180      * disabled.
181      * Only
182      * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult]
183      * will be returned.
184      * [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet] will
185      * not be returned, even if
186      * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
187      * or
188      * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2.SearchRequest.dynamic_facet_spec]
189      * is set.
190      * </pre>
191      *
192      * <code>PRODUCT_SEARCH_ONLY = 1;</code>
193      */
194     public static final int PRODUCT_SEARCH_ONLY_VALUE = 1;
195     /**
196      *
197      *
198      * <pre>
199      * Only faceted search will be performed. The product search will be
200      * disabled.
201      * When in this mode, one or both of
202      * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
203      * and
204      * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2.SearchRequest.dynamic_facet_spec]
205      * should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
206      * [SearchResponse.Facet][google.cloud.retail.v2.SearchResponse.Facet] will
207      * be returned.
208      * [SearchResponse.SearchResult][google.cloud.retail.v2.SearchResponse.SearchResult]
209      * will not be returned.
210      * </pre>
211      *
212      * <code>FACETED_SEARCH_ONLY = 2;</code>
213      */
214     public static final int FACETED_SEARCH_ONLY_VALUE = 2;
215 
getNumber()216     public final int getNumber() {
217       if (this == UNRECOGNIZED) {
218         throw new java.lang.IllegalArgumentException(
219             "Can't get the number of an unknown enum value.");
220       }
221       return value;
222     }
223 
224     /**
225      * @param value The numeric wire value of the corresponding enum entry.
226      * @return The enum associated with the given numeric wire value.
227      * @deprecated Use {@link #forNumber(int)} instead.
228      */
229     @java.lang.Deprecated
valueOf(int value)230     public static SearchMode valueOf(int value) {
231       return forNumber(value);
232     }
233 
234     /**
235      * @param value The numeric wire value of the corresponding enum entry.
236      * @return The enum associated with the given numeric wire value.
237      */
forNumber(int value)238     public static SearchMode forNumber(int value) {
239       switch (value) {
240         case 0:
241           return SEARCH_MODE_UNSPECIFIED;
242         case 1:
243           return PRODUCT_SEARCH_ONLY;
244         case 2:
245           return FACETED_SEARCH_ONLY;
246         default:
247           return null;
248       }
249     }
250 
internalGetValueMap()251     public static com.google.protobuf.Internal.EnumLiteMap<SearchMode> internalGetValueMap() {
252       return internalValueMap;
253     }
254 
255     private static final com.google.protobuf.Internal.EnumLiteMap<SearchMode> internalValueMap =
256         new com.google.protobuf.Internal.EnumLiteMap<SearchMode>() {
257           public SearchMode findValueByNumber(int number) {
258             return SearchMode.forNumber(number);
259           }
260         };
261 
getValueDescriptor()262     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
263       if (this == UNRECOGNIZED) {
264         throw new java.lang.IllegalStateException(
265             "Can't get the descriptor of an unrecognized enum value.");
266       }
267       return getDescriptor().getValues().get(ordinal());
268     }
269 
getDescriptorForType()270     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
271       return getDescriptor();
272     }
273 
getDescriptor()274     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
275       return com.google.cloud.retail.v2.SearchRequest.getDescriptor().getEnumTypes().get(0);
276     }
277 
278     private static final SearchMode[] VALUES = values();
279 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)280     public static SearchMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
281       if (desc.getType() != getDescriptor()) {
282         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
283       }
284       if (desc.getIndex() == -1) {
285         return UNRECOGNIZED;
286       }
287       return VALUES[desc.getIndex()];
288     }
289 
290     private final int value;
291 
SearchMode(int value)292     private SearchMode(int value) {
293       this.value = value;
294     }
295 
296     // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2.SearchRequest.SearchMode)
297   }
298 
299   public interface FacetSpecOrBuilder
300       extends
301       // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.FacetSpec)
302       com.google.protobuf.MessageOrBuilder {
303 
304     /**
305      *
306      *
307      * <pre>
308      * Required. The facet key specification.
309      * </pre>
310      *
311      * <code>
312      * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
313      * </code>
314      *
315      * @return Whether the facetKey field is set.
316      */
hasFacetKey()317     boolean hasFacetKey();
318     /**
319      *
320      *
321      * <pre>
322      * Required. The facet key specification.
323      * </pre>
324      *
325      * <code>
326      * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
327      * </code>
328      *
329      * @return The facetKey.
330      */
getFacetKey()331     com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey getFacetKey();
332     /**
333      *
334      *
335      * <pre>
336      * Required. The facet key specification.
337      * </pre>
338      *
339      * <code>
340      * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
341      * </code>
342      */
getFacetKeyOrBuilder()343     com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder getFacetKeyOrBuilder();
344 
345     /**
346      *
347      *
348      * <pre>
349      * Maximum of facet values that should be returned for this facet. If
350      * unspecified, defaults to 50. The maximum allowed value is 300. Values
351      * above 300 will be coerced to 300.
352      * If this field is negative, an INVALID_ARGUMENT is returned.
353      * </pre>
354      *
355      * <code>int32 limit = 2;</code>
356      *
357      * @return The limit.
358      */
getLimit()359     int getLimit();
360 
361     /**
362      *
363      *
364      * <pre>
365      * List of keys to exclude when faceting.
366      * By default,
367      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
368      * is not excluded from the filter unless it is listed in this field.
369      * Listing a facet key in this field allows its values to appear as facet
370      * results, even when they are filtered out of search results. Using this
371      * field does not affect what search results are returned.
372      * For example, suppose there are 100 products with the color facet "Red"
373      * and 200 products with the color facet "Blue". A query containing the
374      * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
375      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
376      * would by default return only "Red" products in the search results, and
377      * also return "Red" with count 100 as the only color facet. Although there
378      * are also blue products available, "Blue" would not be shown as an
379      * available facet value.
380      * If "colorFamilies" is listed in "excludedFilterKeys", then the query
381      * returns the facet values "Red" with count 100 and "Blue" with count
382      * 200, because the "colorFamilies" key is now excluded from the filter.
383      * Because this field doesn't affect search results, the search results
384      * are still correctly filtered to return only "Red" products.
385      * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
386      * is returned.
387      * </pre>
388      *
389      * <code>repeated string excluded_filter_keys = 3;</code>
390      *
391      * @return A list containing the excludedFilterKeys.
392      */
getExcludedFilterKeysList()393     java.util.List<java.lang.String> getExcludedFilterKeysList();
394     /**
395      *
396      *
397      * <pre>
398      * List of keys to exclude when faceting.
399      * By default,
400      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
401      * is not excluded from the filter unless it is listed in this field.
402      * Listing a facet key in this field allows its values to appear as facet
403      * results, even when they are filtered out of search results. Using this
404      * field does not affect what search results are returned.
405      * For example, suppose there are 100 products with the color facet "Red"
406      * and 200 products with the color facet "Blue". A query containing the
407      * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
408      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
409      * would by default return only "Red" products in the search results, and
410      * also return "Red" with count 100 as the only color facet. Although there
411      * are also blue products available, "Blue" would not be shown as an
412      * available facet value.
413      * If "colorFamilies" is listed in "excludedFilterKeys", then the query
414      * returns the facet values "Red" with count 100 and "Blue" with count
415      * 200, because the "colorFamilies" key is now excluded from the filter.
416      * Because this field doesn't affect search results, the search results
417      * are still correctly filtered to return only "Red" products.
418      * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
419      * is returned.
420      * </pre>
421      *
422      * <code>repeated string excluded_filter_keys = 3;</code>
423      *
424      * @return The count of excludedFilterKeys.
425      */
getExcludedFilterKeysCount()426     int getExcludedFilterKeysCount();
427     /**
428      *
429      *
430      * <pre>
431      * List of keys to exclude when faceting.
432      * By default,
433      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
434      * is not excluded from the filter unless it is listed in this field.
435      * Listing a facet key in this field allows its values to appear as facet
436      * results, even when they are filtered out of search results. Using this
437      * field does not affect what search results are returned.
438      * For example, suppose there are 100 products with the color facet "Red"
439      * and 200 products with the color facet "Blue". A query containing the
440      * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
441      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
442      * would by default return only "Red" products in the search results, and
443      * also return "Red" with count 100 as the only color facet. Although there
444      * are also blue products available, "Blue" would not be shown as an
445      * available facet value.
446      * If "colorFamilies" is listed in "excludedFilterKeys", then the query
447      * returns the facet values "Red" with count 100 and "Blue" with count
448      * 200, because the "colorFamilies" key is now excluded from the filter.
449      * Because this field doesn't affect search results, the search results
450      * are still correctly filtered to return only "Red" products.
451      * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
452      * is returned.
453      * </pre>
454      *
455      * <code>repeated string excluded_filter_keys = 3;</code>
456      *
457      * @param index The index of the element to return.
458      * @return The excludedFilterKeys at the given index.
459      */
getExcludedFilterKeys(int index)460     java.lang.String getExcludedFilterKeys(int index);
461     /**
462      *
463      *
464      * <pre>
465      * List of keys to exclude when faceting.
466      * By default,
467      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
468      * is not excluded from the filter unless it is listed in this field.
469      * Listing a facet key in this field allows its values to appear as facet
470      * results, even when they are filtered out of search results. Using this
471      * field does not affect what search results are returned.
472      * For example, suppose there are 100 products with the color facet "Red"
473      * and 200 products with the color facet "Blue". A query containing the
474      * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
475      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
476      * would by default return only "Red" products in the search results, and
477      * also return "Red" with count 100 as the only color facet. Although there
478      * are also blue products available, "Blue" would not be shown as an
479      * available facet value.
480      * If "colorFamilies" is listed in "excludedFilterKeys", then the query
481      * returns the facet values "Red" with count 100 and "Blue" with count
482      * 200, because the "colorFamilies" key is now excluded from the filter.
483      * Because this field doesn't affect search results, the search results
484      * are still correctly filtered to return only "Red" products.
485      * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
486      * is returned.
487      * </pre>
488      *
489      * <code>repeated string excluded_filter_keys = 3;</code>
490      *
491      * @param index The index of the value to return.
492      * @return The bytes of the excludedFilterKeys at the given index.
493      */
getExcludedFilterKeysBytes(int index)494     com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index);
495 
496     /**
497      *
498      *
499      * <pre>
500      * Enables dynamic position for this facet. If set to true, the position of
501      * this facet among all facets in the response is determined by Google
502      * Retail Search. It will be ordered together with dynamic facets if dynamic
503      * facets is enabled. If set to false, the position of this facet in the
504      * response will be the same as in the request, and it will be ranked before
505      * the facets with dynamic position enable and all dynamic facets.
506      * For example, you may always want to have rating facet returned in
507      * the response, but it's not necessarily to always display the rating facet
508      * at the top. In that case, you can set enable_dynamic_position to true so
509      * that the position of rating facet in response will be determined by
510      * Google Retail Search.
511      * Another example, assuming you have the following facets in the request:
512      * * "rating", enable_dynamic_position = true
513      * * "price", enable_dynamic_position = false
514      * * "brands", enable_dynamic_position = false
515      * And also you have a dynamic facets enable, which will generate a facet
516      * 'gender'. Then the final order of the facets in the response can be
517      * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
518      * "rating") depends on how Google Retail Search orders "gender" and
519      * "rating" facets. However, notice that "price" and "brands" will always be
520      * ranked at 1st and 2nd position since their enable_dynamic_position are
521      * false.
522      * </pre>
523      *
524      * <code>bool enable_dynamic_position = 4;</code>
525      *
526      * @return The enableDynamicPosition.
527      */
getEnableDynamicPosition()528     boolean getEnableDynamicPosition();
529   }
530   /**
531    *
532    *
533    * <pre>
534    * A facet specification to perform faceted search.
535    * </pre>
536    *
537    * Protobuf type {@code google.cloud.retail.v2.SearchRequest.FacetSpec}
538    */
539   public static final class FacetSpec extends com.google.protobuf.GeneratedMessageV3
540       implements
541       // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.FacetSpec)
542       FacetSpecOrBuilder {
543     private static final long serialVersionUID = 0L;
544     // Use FacetSpec.newBuilder() to construct.
FacetSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)545     private FacetSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
546       super(builder);
547     }
548 
FacetSpec()549     private FacetSpec() {
550       excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
551     }
552 
553     @java.lang.Override
554     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)555     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
556       return new FacetSpec();
557     }
558 
559     @java.lang.Override
getUnknownFields()560     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
561       return this.unknownFields;
562     }
563 
getDescriptor()564     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
565       return com.google.cloud.retail.v2.SearchServiceProto
566           .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_descriptor;
567     }
568 
569     @java.lang.Override
570     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()571         internalGetFieldAccessorTable() {
572       return com.google.cloud.retail.v2.SearchServiceProto
573           .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_fieldAccessorTable
574           .ensureFieldAccessorsInitialized(
575               com.google.cloud.retail.v2.SearchRequest.FacetSpec.class,
576               com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder.class);
577     }
578 
579     public interface FacetKeyOrBuilder
580         extends
581         // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey)
582         com.google.protobuf.MessageOrBuilder {
583 
584       /**
585        *
586        *
587        * <pre>
588        * Required. Supported textual and numerical facet keys in
589        * [Product][google.cloud.retail.v2.Product] object, over which the facet
590        * values are computed. Facet key is case-sensitive.
591        * Allowed facet keys when
592        * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
593        * is not specified:
594        * * textual_field =
595        *     * "brands"
596        *     * "categories"
597        *     * "genders"
598        *     * "ageGroups"
599        *     * "availability"
600        *     * "colorFamilies"
601        *     * "colors"
602        *     * "sizes"
603        *     * "materials"
604        *     * "patterns"
605        *     * "conditions"
606        *     * "attributes.key"
607        *     * "pickupInStore"
608        *     * "shipToStore"
609        *     * "sameDayDelivery"
610        *     * "nextDayDelivery"
611        *     * "customFulfillment1"
612        *     * "customFulfillment2"
613        *     * "customFulfillment3"
614        *     * "customFulfillment4"
615        *     * "customFulfillment5"
616        *     * "inventory(place_id,attributes.key)"
617        * * numerical_field =
618        *     * "price"
619        *     * "discount"
620        *     * "rating"
621        *     * "ratingCount"
622        *     * "attributes.key"
623        *     * "inventory(place_id,price)"
624        *     * "inventory(place_id,original_price)"
625        *     * "inventory(place_id,attributes.key)"
626        * </pre>
627        *
628        * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
629        *
630        * @return The key.
631        */
getKey()632       java.lang.String getKey();
633       /**
634        *
635        *
636        * <pre>
637        * Required. Supported textual and numerical facet keys in
638        * [Product][google.cloud.retail.v2.Product] object, over which the facet
639        * values are computed. Facet key is case-sensitive.
640        * Allowed facet keys when
641        * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
642        * is not specified:
643        * * textual_field =
644        *     * "brands"
645        *     * "categories"
646        *     * "genders"
647        *     * "ageGroups"
648        *     * "availability"
649        *     * "colorFamilies"
650        *     * "colors"
651        *     * "sizes"
652        *     * "materials"
653        *     * "patterns"
654        *     * "conditions"
655        *     * "attributes.key"
656        *     * "pickupInStore"
657        *     * "shipToStore"
658        *     * "sameDayDelivery"
659        *     * "nextDayDelivery"
660        *     * "customFulfillment1"
661        *     * "customFulfillment2"
662        *     * "customFulfillment3"
663        *     * "customFulfillment4"
664        *     * "customFulfillment5"
665        *     * "inventory(place_id,attributes.key)"
666        * * numerical_field =
667        *     * "price"
668        *     * "discount"
669        *     * "rating"
670        *     * "ratingCount"
671        *     * "attributes.key"
672        *     * "inventory(place_id,price)"
673        *     * "inventory(place_id,original_price)"
674        *     * "inventory(place_id,attributes.key)"
675        * </pre>
676        *
677        * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
678        *
679        * @return The bytes for key.
680        */
getKeyBytes()681       com.google.protobuf.ByteString getKeyBytes();
682 
683       /**
684        *
685        *
686        * <pre>
687        * Set only if values should be bucketized into intervals. Must be set
688        * for facets with numerical values. Must not be set for facet with text
689        * values. Maximum number of intervals is 40.
690        * For all numerical facet keys that appear in the list of products from
691        * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
692        * computed from their distribution weekly. If the model assigns a high
693        * score to a numerical facet key and its intervals are not specified in
694        * the search request, these percentiles will become the bounds
695        * for its intervals and will be returned in the response. If the
696        * facet key intervals are specified in the request, then the specified
697        * intervals will be returned instead.
698        * </pre>
699        *
700        * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
701        */
getIntervalsList()702       java.util.List<com.google.cloud.retail.v2.Interval> getIntervalsList();
703       /**
704        *
705        *
706        * <pre>
707        * Set only if values should be bucketized into intervals. Must be set
708        * for facets with numerical values. Must not be set for facet with text
709        * values. Maximum number of intervals is 40.
710        * For all numerical facet keys that appear in the list of products from
711        * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
712        * computed from their distribution weekly. If the model assigns a high
713        * score to a numerical facet key and its intervals are not specified in
714        * the search request, these percentiles will become the bounds
715        * for its intervals and will be returned in the response. If the
716        * facet key intervals are specified in the request, then the specified
717        * intervals will be returned instead.
718        * </pre>
719        *
720        * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
721        */
getIntervals(int index)722       com.google.cloud.retail.v2.Interval getIntervals(int index);
723       /**
724        *
725        *
726        * <pre>
727        * Set only if values should be bucketized into intervals. Must be set
728        * for facets with numerical values. Must not be set for facet with text
729        * values. Maximum number of intervals is 40.
730        * For all numerical facet keys that appear in the list of products from
731        * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
732        * computed from their distribution weekly. If the model assigns a high
733        * score to a numerical facet key and its intervals are not specified in
734        * the search request, these percentiles will become the bounds
735        * for its intervals and will be returned in the response. If the
736        * facet key intervals are specified in the request, then the specified
737        * intervals will be returned instead.
738        * </pre>
739        *
740        * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
741        */
getIntervalsCount()742       int getIntervalsCount();
743       /**
744        *
745        *
746        * <pre>
747        * Set only if values should be bucketized into intervals. Must be set
748        * for facets with numerical values. Must not be set for facet with text
749        * values. Maximum number of intervals is 40.
750        * For all numerical facet keys that appear in the list of products from
751        * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
752        * computed from their distribution weekly. If the model assigns a high
753        * score to a numerical facet key and its intervals are not specified in
754        * the search request, these percentiles will become the bounds
755        * for its intervals and will be returned in the response. If the
756        * facet key intervals are specified in the request, then the specified
757        * intervals will be returned instead.
758        * </pre>
759        *
760        * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
761        */
762       java.util.List<? extends com.google.cloud.retail.v2.IntervalOrBuilder>
getIntervalsOrBuilderList()763           getIntervalsOrBuilderList();
764       /**
765        *
766        *
767        * <pre>
768        * Set only if values should be bucketized into intervals. Must be set
769        * for facets with numerical values. Must not be set for facet with text
770        * values. Maximum number of intervals is 40.
771        * For all numerical facet keys that appear in the list of products from
772        * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
773        * computed from their distribution weekly. If the model assigns a high
774        * score to a numerical facet key and its intervals are not specified in
775        * the search request, these percentiles will become the bounds
776        * for its intervals and will be returned in the response. If the
777        * facet key intervals are specified in the request, then the specified
778        * intervals will be returned instead.
779        * </pre>
780        *
781        * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
782        */
getIntervalsOrBuilder(int index)783       com.google.cloud.retail.v2.IntervalOrBuilder getIntervalsOrBuilder(int index);
784 
785       /**
786        *
787        *
788        * <pre>
789        * Only get facet for the given restricted values. For example, when using
790        * "pickupInStore" as key and set restricted values to
791        * ["store123", "store456"], only facets for "store123" and "store456" are
792        * returned. Only supported on predefined textual fields, custom textual
793        * attributes and fulfillments. Maximum is 20.
794        * Must be set for the fulfillment facet keys:
795        * * pickupInStore
796        * * shipToStore
797        * * sameDayDelivery
798        * * nextDayDelivery
799        * * customFulfillment1
800        * * customFulfillment2
801        * * customFulfillment3
802        * * customFulfillment4
803        * * customFulfillment5
804        * </pre>
805        *
806        * <code>repeated string restricted_values = 3;</code>
807        *
808        * @return A list containing the restrictedValues.
809        */
getRestrictedValuesList()810       java.util.List<java.lang.String> getRestrictedValuesList();
811       /**
812        *
813        *
814        * <pre>
815        * Only get facet for the given restricted values. For example, when using
816        * "pickupInStore" as key and set restricted values to
817        * ["store123", "store456"], only facets for "store123" and "store456" are
818        * returned. Only supported on predefined textual fields, custom textual
819        * attributes and fulfillments. Maximum is 20.
820        * Must be set for the fulfillment facet keys:
821        * * pickupInStore
822        * * shipToStore
823        * * sameDayDelivery
824        * * nextDayDelivery
825        * * customFulfillment1
826        * * customFulfillment2
827        * * customFulfillment3
828        * * customFulfillment4
829        * * customFulfillment5
830        * </pre>
831        *
832        * <code>repeated string restricted_values = 3;</code>
833        *
834        * @return The count of restrictedValues.
835        */
getRestrictedValuesCount()836       int getRestrictedValuesCount();
837       /**
838        *
839        *
840        * <pre>
841        * Only get facet for the given restricted values. For example, when using
842        * "pickupInStore" as key and set restricted values to
843        * ["store123", "store456"], only facets for "store123" and "store456" are
844        * returned. Only supported on predefined textual fields, custom textual
845        * attributes and fulfillments. Maximum is 20.
846        * Must be set for the fulfillment facet keys:
847        * * pickupInStore
848        * * shipToStore
849        * * sameDayDelivery
850        * * nextDayDelivery
851        * * customFulfillment1
852        * * customFulfillment2
853        * * customFulfillment3
854        * * customFulfillment4
855        * * customFulfillment5
856        * </pre>
857        *
858        * <code>repeated string restricted_values = 3;</code>
859        *
860        * @param index The index of the element to return.
861        * @return The restrictedValues at the given index.
862        */
getRestrictedValues(int index)863       java.lang.String getRestrictedValues(int index);
864       /**
865        *
866        *
867        * <pre>
868        * Only get facet for the given restricted values. For example, when using
869        * "pickupInStore" as key and set restricted values to
870        * ["store123", "store456"], only facets for "store123" and "store456" are
871        * returned. Only supported on predefined textual fields, custom textual
872        * attributes and fulfillments. Maximum is 20.
873        * Must be set for the fulfillment facet keys:
874        * * pickupInStore
875        * * shipToStore
876        * * sameDayDelivery
877        * * nextDayDelivery
878        * * customFulfillment1
879        * * customFulfillment2
880        * * customFulfillment3
881        * * customFulfillment4
882        * * customFulfillment5
883        * </pre>
884        *
885        * <code>repeated string restricted_values = 3;</code>
886        *
887        * @param index The index of the value to return.
888        * @return The bytes of the restrictedValues at the given index.
889        */
getRestrictedValuesBytes(int index)890       com.google.protobuf.ByteString getRestrictedValuesBytes(int index);
891 
892       /**
893        *
894        *
895        * <pre>
896        * Only get facet values that start with the given string prefix. For
897        * example, suppose "categories" has three values "Women &gt; Shoe",
898        * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
899        * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
900        * Only supported on textual fields. Maximum is 10.
901        * </pre>
902        *
903        * <code>repeated string prefixes = 8;</code>
904        *
905        * @return A list containing the prefixes.
906        */
getPrefixesList()907       java.util.List<java.lang.String> getPrefixesList();
908       /**
909        *
910        *
911        * <pre>
912        * Only get facet values that start with the given string prefix. For
913        * example, suppose "categories" has three values "Women &gt; Shoe",
914        * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
915        * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
916        * Only supported on textual fields. Maximum is 10.
917        * </pre>
918        *
919        * <code>repeated string prefixes = 8;</code>
920        *
921        * @return The count of prefixes.
922        */
getPrefixesCount()923       int getPrefixesCount();
924       /**
925        *
926        *
927        * <pre>
928        * Only get facet values that start with the given string prefix. For
929        * example, suppose "categories" has three values "Women &gt; Shoe",
930        * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
931        * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
932        * Only supported on textual fields. Maximum is 10.
933        * </pre>
934        *
935        * <code>repeated string prefixes = 8;</code>
936        *
937        * @param index The index of the element to return.
938        * @return The prefixes at the given index.
939        */
getPrefixes(int index)940       java.lang.String getPrefixes(int index);
941       /**
942        *
943        *
944        * <pre>
945        * Only get facet values that start with the given string prefix. For
946        * example, suppose "categories" has three values "Women &gt; Shoe",
947        * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
948        * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
949        * Only supported on textual fields. Maximum is 10.
950        * </pre>
951        *
952        * <code>repeated string prefixes = 8;</code>
953        *
954        * @param index The index of the value to return.
955        * @return The bytes of the prefixes at the given index.
956        */
getPrefixesBytes(int index)957       com.google.protobuf.ByteString getPrefixesBytes(int index);
958 
959       /**
960        *
961        *
962        * <pre>
963        * Only get facet values that contains the given strings. For example,
964        * suppose "categories" has three values "Women &gt; Shoe",
965        * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
966        * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
967        * Only supported on textual fields. Maximum is 10.
968        * </pre>
969        *
970        * <code>repeated string contains = 9;</code>
971        *
972        * @return A list containing the contains.
973        */
getContainsList()974       java.util.List<java.lang.String> getContainsList();
975       /**
976        *
977        *
978        * <pre>
979        * Only get facet values that contains the given strings. For example,
980        * suppose "categories" has three values "Women &gt; Shoe",
981        * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
982        * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
983        * Only supported on textual fields. Maximum is 10.
984        * </pre>
985        *
986        * <code>repeated string contains = 9;</code>
987        *
988        * @return The count of contains.
989        */
getContainsCount()990       int getContainsCount();
991       /**
992        *
993        *
994        * <pre>
995        * Only get facet values that contains the given strings. For example,
996        * suppose "categories" has three values "Women &gt; Shoe",
997        * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
998        * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
999        * Only supported on textual fields. Maximum is 10.
1000        * </pre>
1001        *
1002        * <code>repeated string contains = 9;</code>
1003        *
1004        * @param index The index of the element to return.
1005        * @return The contains at the given index.
1006        */
getContains(int index)1007       java.lang.String getContains(int index);
1008       /**
1009        *
1010        *
1011        * <pre>
1012        * Only get facet values that contains the given strings. For example,
1013        * suppose "categories" has three values "Women &gt; Shoe",
1014        * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
1015        * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
1016        * Only supported on textual fields. Maximum is 10.
1017        * </pre>
1018        *
1019        * <code>repeated string contains = 9;</code>
1020        *
1021        * @param index The index of the value to return.
1022        * @return The bytes of the contains at the given index.
1023        */
getContainsBytes(int index)1024       com.google.protobuf.ByteString getContainsBytes(int index);
1025 
1026       /**
1027        *
1028        *
1029        * <pre>
1030        * True to make facet keys case insensitive when getting faceting
1031        * values with prefixes or contains; false otherwise.
1032        * </pre>
1033        *
1034        * <code>bool case_insensitive = 10;</code>
1035        *
1036        * @return The caseInsensitive.
1037        */
getCaseInsensitive()1038       boolean getCaseInsensitive();
1039 
1040       /**
1041        *
1042        *
1043        * <pre>
1044        * The order in which
1045        * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values]
1046        * are returned.
1047        * Allowed values are:
1048        * * "count desc", which means order by
1049        * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
1050        * descending.
1051        * * "value desc", which means order by
1052        * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
1053        * descending.
1054        *   Only applies to textual facets.
1055        * If not set, textual values are sorted in [natural
1056        * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
1057        * intervals are sorted in the order given by
1058        * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
1059        * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
1060        * are sorted in the order given by
1061        * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
1062        * </pre>
1063        *
1064        * <code>string order_by = 4;</code>
1065        *
1066        * @return The orderBy.
1067        */
getOrderBy()1068       java.lang.String getOrderBy();
1069       /**
1070        *
1071        *
1072        * <pre>
1073        * The order in which
1074        * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values]
1075        * are returned.
1076        * Allowed values are:
1077        * * "count desc", which means order by
1078        * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
1079        * descending.
1080        * * "value desc", which means order by
1081        * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
1082        * descending.
1083        *   Only applies to textual facets.
1084        * If not set, textual values are sorted in [natural
1085        * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
1086        * intervals are sorted in the order given by
1087        * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
1088        * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
1089        * are sorted in the order given by
1090        * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
1091        * </pre>
1092        *
1093        * <code>string order_by = 4;</code>
1094        *
1095        * @return The bytes for orderBy.
1096        */
getOrderByBytes()1097       com.google.protobuf.ByteString getOrderByBytes();
1098 
1099       /**
1100        *
1101        *
1102        * <pre>
1103        * The query that is used to compute facet for the given facet key.
1104        * When provided, it will override the default behavior of facet
1105        * computation. The query syntax is the same as a filter expression. See
1106        * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
1107        * detail syntax and limitations. Notice that there is no limitation on
1108        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
1109        * when query is specified.
1110        * In the response,
1111        * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
1112        * will be always "1" and
1113        * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
1114        * will be the number of results that match the query.
1115        * For example, you can set a customized facet for "shipToStore",
1116        * where
1117        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
1118        * is "customizedShipToStore", and
1119        * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
1120        * is "availability: ANY(&#92;"IN_STOCK&#92;") AND shipToStore: ANY(&#92;"123&#92;")".
1121        * Then the facet will count the products that are both in stock and ship
1122        * to store "123".
1123        * </pre>
1124        *
1125        * <code>string query = 5;</code>
1126        *
1127        * @return The query.
1128        */
getQuery()1129       java.lang.String getQuery();
1130       /**
1131        *
1132        *
1133        * <pre>
1134        * The query that is used to compute facet for the given facet key.
1135        * When provided, it will override the default behavior of facet
1136        * computation. The query syntax is the same as a filter expression. See
1137        * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
1138        * detail syntax and limitations. Notice that there is no limitation on
1139        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
1140        * when query is specified.
1141        * In the response,
1142        * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
1143        * will be always "1" and
1144        * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
1145        * will be the number of results that match the query.
1146        * For example, you can set a customized facet for "shipToStore",
1147        * where
1148        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
1149        * is "customizedShipToStore", and
1150        * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
1151        * is "availability: ANY(&#92;"IN_STOCK&#92;") AND shipToStore: ANY(&#92;"123&#92;")".
1152        * Then the facet will count the products that are both in stock and ship
1153        * to store "123".
1154        * </pre>
1155        *
1156        * <code>string query = 5;</code>
1157        *
1158        * @return The bytes for query.
1159        */
getQueryBytes()1160       com.google.protobuf.ByteString getQueryBytes();
1161 
1162       /**
1163        *
1164        *
1165        * <pre>
1166        * Returns the min and max value for each numerical facet intervals.
1167        * Ignored for textual facets.
1168        * </pre>
1169        *
1170        * <code>bool return_min_max = 11;</code>
1171        *
1172        * @return The returnMinMax.
1173        */
getReturnMinMax()1174       boolean getReturnMinMax();
1175     }
1176     /**
1177      *
1178      *
1179      * <pre>
1180      * Specifies how a facet is computed.
1181      * </pre>
1182      *
1183      * Protobuf type {@code google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey}
1184      */
1185     public static final class FacetKey extends com.google.protobuf.GeneratedMessageV3
1186         implements
1187         // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey)
1188         FacetKeyOrBuilder {
1189       private static final long serialVersionUID = 0L;
1190       // Use FacetKey.newBuilder() to construct.
FacetKey(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)1191       private FacetKey(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
1192         super(builder);
1193       }
1194 
FacetKey()1195       private FacetKey() {
1196         key_ = "";
1197         intervals_ = java.util.Collections.emptyList();
1198         restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1199         prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1200         contains_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1201         orderBy_ = "";
1202         query_ = "";
1203       }
1204 
1205       @java.lang.Override
1206       @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)1207       protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
1208         return new FacetKey();
1209       }
1210 
1211       @java.lang.Override
getUnknownFields()1212       public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
1213         return this.unknownFields;
1214       }
1215 
getDescriptor()1216       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
1217         return com.google.cloud.retail.v2.SearchServiceProto
1218             .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_descriptor;
1219       }
1220 
1221       @java.lang.Override
1222       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()1223           internalGetFieldAccessorTable() {
1224         return com.google.cloud.retail.v2.SearchServiceProto
1225             .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable
1226             .ensureFieldAccessorsInitialized(
1227                 com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.class,
1228                 com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder.class);
1229       }
1230 
1231       public static final int KEY_FIELD_NUMBER = 1;
1232 
1233       @SuppressWarnings("serial")
1234       private volatile java.lang.Object key_ = "";
1235       /**
1236        *
1237        *
1238        * <pre>
1239        * Required. Supported textual and numerical facet keys in
1240        * [Product][google.cloud.retail.v2.Product] object, over which the facet
1241        * values are computed. Facet key is case-sensitive.
1242        * Allowed facet keys when
1243        * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
1244        * is not specified:
1245        * * textual_field =
1246        *     * "brands"
1247        *     * "categories"
1248        *     * "genders"
1249        *     * "ageGroups"
1250        *     * "availability"
1251        *     * "colorFamilies"
1252        *     * "colors"
1253        *     * "sizes"
1254        *     * "materials"
1255        *     * "patterns"
1256        *     * "conditions"
1257        *     * "attributes.key"
1258        *     * "pickupInStore"
1259        *     * "shipToStore"
1260        *     * "sameDayDelivery"
1261        *     * "nextDayDelivery"
1262        *     * "customFulfillment1"
1263        *     * "customFulfillment2"
1264        *     * "customFulfillment3"
1265        *     * "customFulfillment4"
1266        *     * "customFulfillment5"
1267        *     * "inventory(place_id,attributes.key)"
1268        * * numerical_field =
1269        *     * "price"
1270        *     * "discount"
1271        *     * "rating"
1272        *     * "ratingCount"
1273        *     * "attributes.key"
1274        *     * "inventory(place_id,price)"
1275        *     * "inventory(place_id,original_price)"
1276        *     * "inventory(place_id,attributes.key)"
1277        * </pre>
1278        *
1279        * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
1280        *
1281        * @return The key.
1282        */
1283       @java.lang.Override
getKey()1284       public java.lang.String getKey() {
1285         java.lang.Object ref = key_;
1286         if (ref instanceof java.lang.String) {
1287           return (java.lang.String) ref;
1288         } else {
1289           com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1290           java.lang.String s = bs.toStringUtf8();
1291           key_ = s;
1292           return s;
1293         }
1294       }
1295       /**
1296        *
1297        *
1298        * <pre>
1299        * Required. Supported textual and numerical facet keys in
1300        * [Product][google.cloud.retail.v2.Product] object, over which the facet
1301        * values are computed. Facet key is case-sensitive.
1302        * Allowed facet keys when
1303        * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
1304        * is not specified:
1305        * * textual_field =
1306        *     * "brands"
1307        *     * "categories"
1308        *     * "genders"
1309        *     * "ageGroups"
1310        *     * "availability"
1311        *     * "colorFamilies"
1312        *     * "colors"
1313        *     * "sizes"
1314        *     * "materials"
1315        *     * "patterns"
1316        *     * "conditions"
1317        *     * "attributes.key"
1318        *     * "pickupInStore"
1319        *     * "shipToStore"
1320        *     * "sameDayDelivery"
1321        *     * "nextDayDelivery"
1322        *     * "customFulfillment1"
1323        *     * "customFulfillment2"
1324        *     * "customFulfillment3"
1325        *     * "customFulfillment4"
1326        *     * "customFulfillment5"
1327        *     * "inventory(place_id,attributes.key)"
1328        * * numerical_field =
1329        *     * "price"
1330        *     * "discount"
1331        *     * "rating"
1332        *     * "ratingCount"
1333        *     * "attributes.key"
1334        *     * "inventory(place_id,price)"
1335        *     * "inventory(place_id,original_price)"
1336        *     * "inventory(place_id,attributes.key)"
1337        * </pre>
1338        *
1339        * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
1340        *
1341        * @return The bytes for key.
1342        */
1343       @java.lang.Override
getKeyBytes()1344       public com.google.protobuf.ByteString getKeyBytes() {
1345         java.lang.Object ref = key_;
1346         if (ref instanceof java.lang.String) {
1347           com.google.protobuf.ByteString b =
1348               com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1349           key_ = b;
1350           return b;
1351         } else {
1352           return (com.google.protobuf.ByteString) ref;
1353         }
1354       }
1355 
1356       public static final int INTERVALS_FIELD_NUMBER = 2;
1357 
1358       @SuppressWarnings("serial")
1359       private java.util.List<com.google.cloud.retail.v2.Interval> intervals_;
1360       /**
1361        *
1362        *
1363        * <pre>
1364        * Set only if values should be bucketized into intervals. Must be set
1365        * for facets with numerical values. Must not be set for facet with text
1366        * values. Maximum number of intervals is 40.
1367        * For all numerical facet keys that appear in the list of products from
1368        * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
1369        * computed from their distribution weekly. If the model assigns a high
1370        * score to a numerical facet key and its intervals are not specified in
1371        * the search request, these percentiles will become the bounds
1372        * for its intervals and will be returned in the response. If the
1373        * facet key intervals are specified in the request, then the specified
1374        * intervals will be returned instead.
1375        * </pre>
1376        *
1377        * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
1378        */
1379       @java.lang.Override
getIntervalsList()1380       public java.util.List<com.google.cloud.retail.v2.Interval> getIntervalsList() {
1381         return intervals_;
1382       }
1383       /**
1384        *
1385        *
1386        * <pre>
1387        * Set only if values should be bucketized into intervals. Must be set
1388        * for facets with numerical values. Must not be set for facet with text
1389        * values. Maximum number of intervals is 40.
1390        * For all numerical facet keys that appear in the list of products from
1391        * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
1392        * computed from their distribution weekly. If the model assigns a high
1393        * score to a numerical facet key and its intervals are not specified in
1394        * the search request, these percentiles will become the bounds
1395        * for its intervals and will be returned in the response. If the
1396        * facet key intervals are specified in the request, then the specified
1397        * intervals will be returned instead.
1398        * </pre>
1399        *
1400        * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
1401        */
1402       @java.lang.Override
1403       public java.util.List<? extends com.google.cloud.retail.v2.IntervalOrBuilder>
getIntervalsOrBuilderList()1404           getIntervalsOrBuilderList() {
1405         return intervals_;
1406       }
1407       /**
1408        *
1409        *
1410        * <pre>
1411        * Set only if values should be bucketized into intervals. Must be set
1412        * for facets with numerical values. Must not be set for facet with text
1413        * values. Maximum number of intervals is 40.
1414        * For all numerical facet keys that appear in the list of products from
1415        * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
1416        * computed from their distribution weekly. If the model assigns a high
1417        * score to a numerical facet key and its intervals are not specified in
1418        * the search request, these percentiles will become the bounds
1419        * for its intervals and will be returned in the response. If the
1420        * facet key intervals are specified in the request, then the specified
1421        * intervals will be returned instead.
1422        * </pre>
1423        *
1424        * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
1425        */
1426       @java.lang.Override
getIntervalsCount()1427       public int getIntervalsCount() {
1428         return intervals_.size();
1429       }
1430       /**
1431        *
1432        *
1433        * <pre>
1434        * Set only if values should be bucketized into intervals. Must be set
1435        * for facets with numerical values. Must not be set for facet with text
1436        * values. Maximum number of intervals is 40.
1437        * For all numerical facet keys that appear in the list of products from
1438        * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
1439        * computed from their distribution weekly. If the model assigns a high
1440        * score to a numerical facet key and its intervals are not specified in
1441        * the search request, these percentiles will become the bounds
1442        * for its intervals and will be returned in the response. If the
1443        * facet key intervals are specified in the request, then the specified
1444        * intervals will be returned instead.
1445        * </pre>
1446        *
1447        * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
1448        */
1449       @java.lang.Override
getIntervals(int index)1450       public com.google.cloud.retail.v2.Interval getIntervals(int index) {
1451         return intervals_.get(index);
1452       }
1453       /**
1454        *
1455        *
1456        * <pre>
1457        * Set only if values should be bucketized into intervals. Must be set
1458        * for facets with numerical values. Must not be set for facet with text
1459        * values. Maximum number of intervals is 40.
1460        * For all numerical facet keys that appear in the list of products from
1461        * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
1462        * computed from their distribution weekly. If the model assigns a high
1463        * score to a numerical facet key and its intervals are not specified in
1464        * the search request, these percentiles will become the bounds
1465        * for its intervals and will be returned in the response. If the
1466        * facet key intervals are specified in the request, then the specified
1467        * intervals will be returned instead.
1468        * </pre>
1469        *
1470        * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
1471        */
1472       @java.lang.Override
getIntervalsOrBuilder(int index)1473       public com.google.cloud.retail.v2.IntervalOrBuilder getIntervalsOrBuilder(int index) {
1474         return intervals_.get(index);
1475       }
1476 
1477       public static final int RESTRICTED_VALUES_FIELD_NUMBER = 3;
1478 
1479       @SuppressWarnings("serial")
1480       private com.google.protobuf.LazyStringList restrictedValues_;
1481       /**
1482        *
1483        *
1484        * <pre>
1485        * Only get facet for the given restricted values. For example, when using
1486        * "pickupInStore" as key and set restricted values to
1487        * ["store123", "store456"], only facets for "store123" and "store456" are
1488        * returned. Only supported on predefined textual fields, custom textual
1489        * attributes and fulfillments. Maximum is 20.
1490        * Must be set for the fulfillment facet keys:
1491        * * pickupInStore
1492        * * shipToStore
1493        * * sameDayDelivery
1494        * * nextDayDelivery
1495        * * customFulfillment1
1496        * * customFulfillment2
1497        * * customFulfillment3
1498        * * customFulfillment4
1499        * * customFulfillment5
1500        * </pre>
1501        *
1502        * <code>repeated string restricted_values = 3;</code>
1503        *
1504        * @return A list containing the restrictedValues.
1505        */
getRestrictedValuesList()1506       public com.google.protobuf.ProtocolStringList getRestrictedValuesList() {
1507         return restrictedValues_;
1508       }
1509       /**
1510        *
1511        *
1512        * <pre>
1513        * Only get facet for the given restricted values. For example, when using
1514        * "pickupInStore" as key and set restricted values to
1515        * ["store123", "store456"], only facets for "store123" and "store456" are
1516        * returned. Only supported on predefined textual fields, custom textual
1517        * attributes and fulfillments. Maximum is 20.
1518        * Must be set for the fulfillment facet keys:
1519        * * pickupInStore
1520        * * shipToStore
1521        * * sameDayDelivery
1522        * * nextDayDelivery
1523        * * customFulfillment1
1524        * * customFulfillment2
1525        * * customFulfillment3
1526        * * customFulfillment4
1527        * * customFulfillment5
1528        * </pre>
1529        *
1530        * <code>repeated string restricted_values = 3;</code>
1531        *
1532        * @return The count of restrictedValues.
1533        */
getRestrictedValuesCount()1534       public int getRestrictedValuesCount() {
1535         return restrictedValues_.size();
1536       }
1537       /**
1538        *
1539        *
1540        * <pre>
1541        * Only get facet for the given restricted values. For example, when using
1542        * "pickupInStore" as key and set restricted values to
1543        * ["store123", "store456"], only facets for "store123" and "store456" are
1544        * returned. Only supported on predefined textual fields, custom textual
1545        * attributes and fulfillments. Maximum is 20.
1546        * Must be set for the fulfillment facet keys:
1547        * * pickupInStore
1548        * * shipToStore
1549        * * sameDayDelivery
1550        * * nextDayDelivery
1551        * * customFulfillment1
1552        * * customFulfillment2
1553        * * customFulfillment3
1554        * * customFulfillment4
1555        * * customFulfillment5
1556        * </pre>
1557        *
1558        * <code>repeated string restricted_values = 3;</code>
1559        *
1560        * @param index The index of the element to return.
1561        * @return The restrictedValues at the given index.
1562        */
getRestrictedValues(int index)1563       public java.lang.String getRestrictedValues(int index) {
1564         return restrictedValues_.get(index);
1565       }
1566       /**
1567        *
1568        *
1569        * <pre>
1570        * Only get facet for the given restricted values. For example, when using
1571        * "pickupInStore" as key and set restricted values to
1572        * ["store123", "store456"], only facets for "store123" and "store456" are
1573        * returned. Only supported on predefined textual fields, custom textual
1574        * attributes and fulfillments. Maximum is 20.
1575        * Must be set for the fulfillment facet keys:
1576        * * pickupInStore
1577        * * shipToStore
1578        * * sameDayDelivery
1579        * * nextDayDelivery
1580        * * customFulfillment1
1581        * * customFulfillment2
1582        * * customFulfillment3
1583        * * customFulfillment4
1584        * * customFulfillment5
1585        * </pre>
1586        *
1587        * <code>repeated string restricted_values = 3;</code>
1588        *
1589        * @param index The index of the value to return.
1590        * @return The bytes of the restrictedValues at the given index.
1591        */
getRestrictedValuesBytes(int index)1592       public com.google.protobuf.ByteString getRestrictedValuesBytes(int index) {
1593         return restrictedValues_.getByteString(index);
1594       }
1595 
1596       public static final int PREFIXES_FIELD_NUMBER = 8;
1597 
1598       @SuppressWarnings("serial")
1599       private com.google.protobuf.LazyStringList prefixes_;
1600       /**
1601        *
1602        *
1603        * <pre>
1604        * Only get facet values that start with the given string prefix. For
1605        * example, suppose "categories" has three values "Women &gt; Shoe",
1606        * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
1607        * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
1608        * Only supported on textual fields. Maximum is 10.
1609        * </pre>
1610        *
1611        * <code>repeated string prefixes = 8;</code>
1612        *
1613        * @return A list containing the prefixes.
1614        */
getPrefixesList()1615       public com.google.protobuf.ProtocolStringList getPrefixesList() {
1616         return prefixes_;
1617       }
1618       /**
1619        *
1620        *
1621        * <pre>
1622        * Only get facet values that start with the given string prefix. For
1623        * example, suppose "categories" has three values "Women &gt; Shoe",
1624        * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
1625        * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
1626        * Only supported on textual fields. Maximum is 10.
1627        * </pre>
1628        *
1629        * <code>repeated string prefixes = 8;</code>
1630        *
1631        * @return The count of prefixes.
1632        */
getPrefixesCount()1633       public int getPrefixesCount() {
1634         return prefixes_.size();
1635       }
1636       /**
1637        *
1638        *
1639        * <pre>
1640        * Only get facet values that start with the given string prefix. For
1641        * example, suppose "categories" has three values "Women &gt; Shoe",
1642        * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
1643        * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
1644        * Only supported on textual fields. Maximum is 10.
1645        * </pre>
1646        *
1647        * <code>repeated string prefixes = 8;</code>
1648        *
1649        * @param index The index of the element to return.
1650        * @return The prefixes at the given index.
1651        */
getPrefixes(int index)1652       public java.lang.String getPrefixes(int index) {
1653         return prefixes_.get(index);
1654       }
1655       /**
1656        *
1657        *
1658        * <pre>
1659        * Only get facet values that start with the given string prefix. For
1660        * example, suppose "categories" has three values "Women &gt; Shoe",
1661        * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
1662        * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
1663        * Only supported on textual fields. Maximum is 10.
1664        * </pre>
1665        *
1666        * <code>repeated string prefixes = 8;</code>
1667        *
1668        * @param index The index of the value to return.
1669        * @return The bytes of the prefixes at the given index.
1670        */
getPrefixesBytes(int index)1671       public com.google.protobuf.ByteString getPrefixesBytes(int index) {
1672         return prefixes_.getByteString(index);
1673       }
1674 
1675       public static final int CONTAINS_FIELD_NUMBER = 9;
1676 
1677       @SuppressWarnings("serial")
1678       private com.google.protobuf.LazyStringList contains_;
1679       /**
1680        *
1681        *
1682        * <pre>
1683        * Only get facet values that contains the given strings. For example,
1684        * suppose "categories" has three values "Women &gt; Shoe",
1685        * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
1686        * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
1687        * Only supported on textual fields. Maximum is 10.
1688        * </pre>
1689        *
1690        * <code>repeated string contains = 9;</code>
1691        *
1692        * @return A list containing the contains.
1693        */
getContainsList()1694       public com.google.protobuf.ProtocolStringList getContainsList() {
1695         return contains_;
1696       }
1697       /**
1698        *
1699        *
1700        * <pre>
1701        * Only get facet values that contains the given strings. For example,
1702        * suppose "categories" has three values "Women &gt; Shoe",
1703        * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
1704        * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
1705        * Only supported on textual fields. Maximum is 10.
1706        * </pre>
1707        *
1708        * <code>repeated string contains = 9;</code>
1709        *
1710        * @return The count of contains.
1711        */
getContainsCount()1712       public int getContainsCount() {
1713         return contains_.size();
1714       }
1715       /**
1716        *
1717        *
1718        * <pre>
1719        * Only get facet values that contains the given strings. For example,
1720        * suppose "categories" has three values "Women &gt; Shoe",
1721        * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
1722        * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
1723        * Only supported on textual fields. Maximum is 10.
1724        * </pre>
1725        *
1726        * <code>repeated string contains = 9;</code>
1727        *
1728        * @param index The index of the element to return.
1729        * @return The contains at the given index.
1730        */
getContains(int index)1731       public java.lang.String getContains(int index) {
1732         return contains_.get(index);
1733       }
1734       /**
1735        *
1736        *
1737        * <pre>
1738        * Only get facet values that contains the given strings. For example,
1739        * suppose "categories" has three values "Women &gt; Shoe",
1740        * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
1741        * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
1742        * Only supported on textual fields. Maximum is 10.
1743        * </pre>
1744        *
1745        * <code>repeated string contains = 9;</code>
1746        *
1747        * @param index The index of the value to return.
1748        * @return The bytes of the contains at the given index.
1749        */
getContainsBytes(int index)1750       public com.google.protobuf.ByteString getContainsBytes(int index) {
1751         return contains_.getByteString(index);
1752       }
1753 
1754       public static final int CASE_INSENSITIVE_FIELD_NUMBER = 10;
1755       private boolean caseInsensitive_ = false;
1756       /**
1757        *
1758        *
1759        * <pre>
1760        * True to make facet keys case insensitive when getting faceting
1761        * values with prefixes or contains; false otherwise.
1762        * </pre>
1763        *
1764        * <code>bool case_insensitive = 10;</code>
1765        *
1766        * @return The caseInsensitive.
1767        */
1768       @java.lang.Override
getCaseInsensitive()1769       public boolean getCaseInsensitive() {
1770         return caseInsensitive_;
1771       }
1772 
1773       public static final int ORDER_BY_FIELD_NUMBER = 4;
1774 
1775       @SuppressWarnings("serial")
1776       private volatile java.lang.Object orderBy_ = "";
1777       /**
1778        *
1779        *
1780        * <pre>
1781        * The order in which
1782        * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values]
1783        * are returned.
1784        * Allowed values are:
1785        * * "count desc", which means order by
1786        * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
1787        * descending.
1788        * * "value desc", which means order by
1789        * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
1790        * descending.
1791        *   Only applies to textual facets.
1792        * If not set, textual values are sorted in [natural
1793        * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
1794        * intervals are sorted in the order given by
1795        * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
1796        * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
1797        * are sorted in the order given by
1798        * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
1799        * </pre>
1800        *
1801        * <code>string order_by = 4;</code>
1802        *
1803        * @return The orderBy.
1804        */
1805       @java.lang.Override
getOrderBy()1806       public java.lang.String getOrderBy() {
1807         java.lang.Object ref = orderBy_;
1808         if (ref instanceof java.lang.String) {
1809           return (java.lang.String) ref;
1810         } else {
1811           com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1812           java.lang.String s = bs.toStringUtf8();
1813           orderBy_ = s;
1814           return s;
1815         }
1816       }
1817       /**
1818        *
1819        *
1820        * <pre>
1821        * The order in which
1822        * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values]
1823        * are returned.
1824        * Allowed values are:
1825        * * "count desc", which means order by
1826        * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
1827        * descending.
1828        * * "value desc", which means order by
1829        * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
1830        * descending.
1831        *   Only applies to textual facets.
1832        * If not set, textual values are sorted in [natural
1833        * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
1834        * intervals are sorted in the order given by
1835        * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
1836        * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
1837        * are sorted in the order given by
1838        * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
1839        * </pre>
1840        *
1841        * <code>string order_by = 4;</code>
1842        *
1843        * @return The bytes for orderBy.
1844        */
1845       @java.lang.Override
getOrderByBytes()1846       public com.google.protobuf.ByteString getOrderByBytes() {
1847         java.lang.Object ref = orderBy_;
1848         if (ref instanceof java.lang.String) {
1849           com.google.protobuf.ByteString b =
1850               com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1851           orderBy_ = b;
1852           return b;
1853         } else {
1854           return (com.google.protobuf.ByteString) ref;
1855         }
1856       }
1857 
1858       public static final int QUERY_FIELD_NUMBER = 5;
1859 
1860       @SuppressWarnings("serial")
1861       private volatile java.lang.Object query_ = "";
1862       /**
1863        *
1864        *
1865        * <pre>
1866        * The query that is used to compute facet for the given facet key.
1867        * When provided, it will override the default behavior of facet
1868        * computation. The query syntax is the same as a filter expression. See
1869        * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
1870        * detail syntax and limitations. Notice that there is no limitation on
1871        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
1872        * when query is specified.
1873        * In the response,
1874        * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
1875        * will be always "1" and
1876        * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
1877        * will be the number of results that match the query.
1878        * For example, you can set a customized facet for "shipToStore",
1879        * where
1880        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
1881        * is "customizedShipToStore", and
1882        * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
1883        * is "availability: ANY(&#92;"IN_STOCK&#92;") AND shipToStore: ANY(&#92;"123&#92;")".
1884        * Then the facet will count the products that are both in stock and ship
1885        * to store "123".
1886        * </pre>
1887        *
1888        * <code>string query = 5;</code>
1889        *
1890        * @return The query.
1891        */
1892       @java.lang.Override
getQuery()1893       public java.lang.String getQuery() {
1894         java.lang.Object ref = query_;
1895         if (ref instanceof java.lang.String) {
1896           return (java.lang.String) ref;
1897         } else {
1898           com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1899           java.lang.String s = bs.toStringUtf8();
1900           query_ = s;
1901           return s;
1902         }
1903       }
1904       /**
1905        *
1906        *
1907        * <pre>
1908        * The query that is used to compute facet for the given facet key.
1909        * When provided, it will override the default behavior of facet
1910        * computation. The query syntax is the same as a filter expression. See
1911        * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
1912        * detail syntax and limitations. Notice that there is no limitation on
1913        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
1914        * when query is specified.
1915        * In the response,
1916        * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
1917        * will be always "1" and
1918        * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
1919        * will be the number of results that match the query.
1920        * For example, you can set a customized facet for "shipToStore",
1921        * where
1922        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
1923        * is "customizedShipToStore", and
1924        * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
1925        * is "availability: ANY(&#92;"IN_STOCK&#92;") AND shipToStore: ANY(&#92;"123&#92;")".
1926        * Then the facet will count the products that are both in stock and ship
1927        * to store "123".
1928        * </pre>
1929        *
1930        * <code>string query = 5;</code>
1931        *
1932        * @return The bytes for query.
1933        */
1934       @java.lang.Override
getQueryBytes()1935       public com.google.protobuf.ByteString getQueryBytes() {
1936         java.lang.Object ref = query_;
1937         if (ref instanceof java.lang.String) {
1938           com.google.protobuf.ByteString b =
1939               com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1940           query_ = b;
1941           return b;
1942         } else {
1943           return (com.google.protobuf.ByteString) ref;
1944         }
1945       }
1946 
1947       public static final int RETURN_MIN_MAX_FIELD_NUMBER = 11;
1948       private boolean returnMinMax_ = false;
1949       /**
1950        *
1951        *
1952        * <pre>
1953        * Returns the min and max value for each numerical facet intervals.
1954        * Ignored for textual facets.
1955        * </pre>
1956        *
1957        * <code>bool return_min_max = 11;</code>
1958        *
1959        * @return The returnMinMax.
1960        */
1961       @java.lang.Override
getReturnMinMax()1962       public boolean getReturnMinMax() {
1963         return returnMinMax_;
1964       }
1965 
1966       private byte memoizedIsInitialized = -1;
1967 
1968       @java.lang.Override
isInitialized()1969       public final boolean isInitialized() {
1970         byte isInitialized = memoizedIsInitialized;
1971         if (isInitialized == 1) return true;
1972         if (isInitialized == 0) return false;
1973 
1974         memoizedIsInitialized = 1;
1975         return true;
1976       }
1977 
1978       @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)1979       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
1980         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) {
1981           com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_);
1982         }
1983         for (int i = 0; i < intervals_.size(); i++) {
1984           output.writeMessage(2, intervals_.get(i));
1985         }
1986         for (int i = 0; i < restrictedValues_.size(); i++) {
1987           com.google.protobuf.GeneratedMessageV3.writeString(
1988               output, 3, restrictedValues_.getRaw(i));
1989         }
1990         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) {
1991           com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_);
1992         }
1993         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) {
1994           com.google.protobuf.GeneratedMessageV3.writeString(output, 5, query_);
1995         }
1996         for (int i = 0; i < prefixes_.size(); i++) {
1997           com.google.protobuf.GeneratedMessageV3.writeString(output, 8, prefixes_.getRaw(i));
1998         }
1999         for (int i = 0; i < contains_.size(); i++) {
2000           com.google.protobuf.GeneratedMessageV3.writeString(output, 9, contains_.getRaw(i));
2001         }
2002         if (caseInsensitive_ != false) {
2003           output.writeBool(10, caseInsensitive_);
2004         }
2005         if (returnMinMax_ != false) {
2006           output.writeBool(11, returnMinMax_);
2007         }
2008         getUnknownFields().writeTo(output);
2009       }
2010 
2011       @java.lang.Override
getSerializedSize()2012       public int getSerializedSize() {
2013         int size = memoizedSize;
2014         if (size != -1) return size;
2015 
2016         size = 0;
2017         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) {
2018           size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_);
2019         }
2020         for (int i = 0; i < intervals_.size(); i++) {
2021           size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, intervals_.get(i));
2022         }
2023         {
2024           int dataSize = 0;
2025           for (int i = 0; i < restrictedValues_.size(); i++) {
2026             dataSize += computeStringSizeNoTag(restrictedValues_.getRaw(i));
2027           }
2028           size += dataSize;
2029           size += 1 * getRestrictedValuesList().size();
2030         }
2031         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) {
2032           size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_);
2033         }
2034         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) {
2035           size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, query_);
2036         }
2037         {
2038           int dataSize = 0;
2039           for (int i = 0; i < prefixes_.size(); i++) {
2040             dataSize += computeStringSizeNoTag(prefixes_.getRaw(i));
2041           }
2042           size += dataSize;
2043           size += 1 * getPrefixesList().size();
2044         }
2045         {
2046           int dataSize = 0;
2047           for (int i = 0; i < contains_.size(); i++) {
2048             dataSize += computeStringSizeNoTag(contains_.getRaw(i));
2049           }
2050           size += dataSize;
2051           size += 1 * getContainsList().size();
2052         }
2053         if (caseInsensitive_ != false) {
2054           size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, caseInsensitive_);
2055         }
2056         if (returnMinMax_ != false) {
2057           size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, returnMinMax_);
2058         }
2059         size += getUnknownFields().getSerializedSize();
2060         memoizedSize = size;
2061         return size;
2062       }
2063 
2064       @java.lang.Override
equals(final java.lang.Object obj)2065       public boolean equals(final java.lang.Object obj) {
2066         if (obj == this) {
2067           return true;
2068         }
2069         if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey)) {
2070           return super.equals(obj);
2071         }
2072         com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey other =
2073             (com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) obj;
2074 
2075         if (!getKey().equals(other.getKey())) return false;
2076         if (!getIntervalsList().equals(other.getIntervalsList())) return false;
2077         if (!getRestrictedValuesList().equals(other.getRestrictedValuesList())) return false;
2078         if (!getPrefixesList().equals(other.getPrefixesList())) return false;
2079         if (!getContainsList().equals(other.getContainsList())) return false;
2080         if (getCaseInsensitive() != other.getCaseInsensitive()) return false;
2081         if (!getOrderBy().equals(other.getOrderBy())) return false;
2082         if (!getQuery().equals(other.getQuery())) return false;
2083         if (getReturnMinMax() != other.getReturnMinMax()) return false;
2084         if (!getUnknownFields().equals(other.getUnknownFields())) return false;
2085         return true;
2086       }
2087 
2088       @java.lang.Override
hashCode()2089       public int hashCode() {
2090         if (memoizedHashCode != 0) {
2091           return memoizedHashCode;
2092         }
2093         int hash = 41;
2094         hash = (19 * hash) + getDescriptor().hashCode();
2095         hash = (37 * hash) + KEY_FIELD_NUMBER;
2096         hash = (53 * hash) + getKey().hashCode();
2097         if (getIntervalsCount() > 0) {
2098           hash = (37 * hash) + INTERVALS_FIELD_NUMBER;
2099           hash = (53 * hash) + getIntervalsList().hashCode();
2100         }
2101         if (getRestrictedValuesCount() > 0) {
2102           hash = (37 * hash) + RESTRICTED_VALUES_FIELD_NUMBER;
2103           hash = (53 * hash) + getRestrictedValuesList().hashCode();
2104         }
2105         if (getPrefixesCount() > 0) {
2106           hash = (37 * hash) + PREFIXES_FIELD_NUMBER;
2107           hash = (53 * hash) + getPrefixesList().hashCode();
2108         }
2109         if (getContainsCount() > 0) {
2110           hash = (37 * hash) + CONTAINS_FIELD_NUMBER;
2111           hash = (53 * hash) + getContainsList().hashCode();
2112         }
2113         hash = (37 * hash) + CASE_INSENSITIVE_FIELD_NUMBER;
2114         hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCaseInsensitive());
2115         hash = (37 * hash) + ORDER_BY_FIELD_NUMBER;
2116         hash = (53 * hash) + getOrderBy().hashCode();
2117         hash = (37 * hash) + QUERY_FIELD_NUMBER;
2118         hash = (53 * hash) + getQuery().hashCode();
2119         hash = (37 * hash) + RETURN_MIN_MAX_FIELD_NUMBER;
2120         hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReturnMinMax());
2121         hash = (29 * hash) + getUnknownFields().hashCode();
2122         memoizedHashCode = hash;
2123         return hash;
2124       }
2125 
parseFrom( java.nio.ByteBuffer data)2126       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom(
2127           java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
2128         return PARSER.parseFrom(data);
2129       }
2130 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2131       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom(
2132           java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2133           throws com.google.protobuf.InvalidProtocolBufferException {
2134         return PARSER.parseFrom(data, extensionRegistry);
2135       }
2136 
parseFrom( com.google.protobuf.ByteString data)2137       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom(
2138           com.google.protobuf.ByteString data)
2139           throws com.google.protobuf.InvalidProtocolBufferException {
2140         return PARSER.parseFrom(data);
2141       }
2142 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2143       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom(
2144           com.google.protobuf.ByteString data,
2145           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2146           throws com.google.protobuf.InvalidProtocolBufferException {
2147         return PARSER.parseFrom(data, extensionRegistry);
2148       }
2149 
parseFrom( byte[] data)2150       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom(
2151           byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
2152         return PARSER.parseFrom(data);
2153       }
2154 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2155       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom(
2156           byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2157           throws com.google.protobuf.InvalidProtocolBufferException {
2158         return PARSER.parseFrom(data, extensionRegistry);
2159       }
2160 
parseFrom( java.io.InputStream input)2161       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom(
2162           java.io.InputStream input) throws java.io.IOException {
2163         return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
2164       }
2165 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2166       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom(
2167           java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2168           throws java.io.IOException {
2169         return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
2170             PARSER, input, extensionRegistry);
2171       }
2172 
parseDelimitedFrom( java.io.InputStream input)2173       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseDelimitedFrom(
2174           java.io.InputStream input) throws java.io.IOException {
2175         return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
2176       }
2177 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2178       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseDelimitedFrom(
2179           java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2180           throws java.io.IOException {
2181         return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
2182             PARSER, input, extensionRegistry);
2183       }
2184 
parseFrom( com.google.protobuf.CodedInputStream input)2185       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom(
2186           com.google.protobuf.CodedInputStream input) throws java.io.IOException {
2187         return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
2188       }
2189 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2190       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom(
2191           com.google.protobuf.CodedInputStream input,
2192           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2193           throws java.io.IOException {
2194         return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
2195             PARSER, input, extensionRegistry);
2196       }
2197 
2198       @java.lang.Override
newBuilderForType()2199       public Builder newBuilderForType() {
2200         return newBuilder();
2201       }
2202 
newBuilder()2203       public static Builder newBuilder() {
2204         return DEFAULT_INSTANCE.toBuilder();
2205       }
2206 
newBuilder( com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey prototype)2207       public static Builder newBuilder(
2208           com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey prototype) {
2209         return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
2210       }
2211 
2212       @java.lang.Override
toBuilder()2213       public Builder toBuilder() {
2214         return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
2215       }
2216 
2217       @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2218       protected Builder newBuilderForType(
2219           com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
2220         Builder builder = new Builder(parent);
2221         return builder;
2222       }
2223       /**
2224        *
2225        *
2226        * <pre>
2227        * Specifies how a facet is computed.
2228        * </pre>
2229        *
2230        * Protobuf type {@code google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey}
2231        */
2232       public static final class Builder
2233           extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
2234           implements
2235           // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey)
2236           com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder {
getDescriptor()2237         public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
2238           return com.google.cloud.retail.v2.SearchServiceProto
2239               .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_descriptor;
2240         }
2241 
2242         @java.lang.Override
2243         protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()2244             internalGetFieldAccessorTable() {
2245           return com.google.cloud.retail.v2.SearchServiceProto
2246               .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable
2247               .ensureFieldAccessorsInitialized(
2248                   com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.class,
2249                   com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder.class);
2250         }
2251 
2252         // Construct using com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.newBuilder()
Builder()2253         private Builder() {}
2254 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2255         private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
2256           super(parent);
2257         }
2258 
2259         @java.lang.Override
clear()2260         public Builder clear() {
2261           super.clear();
2262           bitField0_ = 0;
2263           key_ = "";
2264           if (intervalsBuilder_ == null) {
2265             intervals_ = java.util.Collections.emptyList();
2266           } else {
2267             intervals_ = null;
2268             intervalsBuilder_.clear();
2269           }
2270           bitField0_ = (bitField0_ & ~0x00000002);
2271           restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
2272           bitField0_ = (bitField0_ & ~0x00000004);
2273           prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
2274           bitField0_ = (bitField0_ & ~0x00000008);
2275           contains_ = com.google.protobuf.LazyStringArrayList.EMPTY;
2276           bitField0_ = (bitField0_ & ~0x00000010);
2277           caseInsensitive_ = false;
2278           orderBy_ = "";
2279           query_ = "";
2280           returnMinMax_ = false;
2281           return this;
2282         }
2283 
2284         @java.lang.Override
getDescriptorForType()2285         public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
2286           return com.google.cloud.retail.v2.SearchServiceProto
2287               .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_descriptor;
2288         }
2289 
2290         @java.lang.Override
2291         public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey
getDefaultInstanceForType()2292             getDefaultInstanceForType() {
2293           return com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance();
2294         }
2295 
2296         @java.lang.Override
build()2297         public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey build() {
2298           com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey result = buildPartial();
2299           if (!result.isInitialized()) {
2300             throw newUninitializedMessageException(result);
2301           }
2302           return result;
2303         }
2304 
2305         @java.lang.Override
buildPartial()2306         public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey buildPartial() {
2307           com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey result =
2308               new com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey(this);
2309           buildPartialRepeatedFields(result);
2310           if (bitField0_ != 0) {
2311             buildPartial0(result);
2312           }
2313           onBuilt();
2314           return result;
2315         }
2316 
buildPartialRepeatedFields( com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey result)2317         private void buildPartialRepeatedFields(
2318             com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey result) {
2319           if (intervalsBuilder_ == null) {
2320             if (((bitField0_ & 0x00000002) != 0)) {
2321               intervals_ = java.util.Collections.unmodifiableList(intervals_);
2322               bitField0_ = (bitField0_ & ~0x00000002);
2323             }
2324             result.intervals_ = intervals_;
2325           } else {
2326             result.intervals_ = intervalsBuilder_.build();
2327           }
2328           if (((bitField0_ & 0x00000004) != 0)) {
2329             restrictedValues_ = restrictedValues_.getUnmodifiableView();
2330             bitField0_ = (bitField0_ & ~0x00000004);
2331           }
2332           result.restrictedValues_ = restrictedValues_;
2333           if (((bitField0_ & 0x00000008) != 0)) {
2334             prefixes_ = prefixes_.getUnmodifiableView();
2335             bitField0_ = (bitField0_ & ~0x00000008);
2336           }
2337           result.prefixes_ = prefixes_;
2338           if (((bitField0_ & 0x00000010) != 0)) {
2339             contains_ = contains_.getUnmodifiableView();
2340             bitField0_ = (bitField0_ & ~0x00000010);
2341           }
2342           result.contains_ = contains_;
2343         }
2344 
buildPartial0( com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey result)2345         private void buildPartial0(
2346             com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey result) {
2347           int from_bitField0_ = bitField0_;
2348           if (((from_bitField0_ & 0x00000001) != 0)) {
2349             result.key_ = key_;
2350           }
2351           if (((from_bitField0_ & 0x00000020) != 0)) {
2352             result.caseInsensitive_ = caseInsensitive_;
2353           }
2354           if (((from_bitField0_ & 0x00000040) != 0)) {
2355             result.orderBy_ = orderBy_;
2356           }
2357           if (((from_bitField0_ & 0x00000080) != 0)) {
2358             result.query_ = query_;
2359           }
2360           if (((from_bitField0_ & 0x00000100) != 0)) {
2361             result.returnMinMax_ = returnMinMax_;
2362           }
2363         }
2364 
2365         @java.lang.Override
clone()2366         public Builder clone() {
2367           return super.clone();
2368         }
2369 
2370         @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2371         public Builder setField(
2372             com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
2373           return super.setField(field, value);
2374         }
2375 
2376         @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)2377         public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
2378           return super.clearField(field);
2379         }
2380 
2381         @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)2382         public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
2383           return super.clearOneof(oneof);
2384         }
2385 
2386         @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)2387         public Builder setRepeatedField(
2388             com.google.protobuf.Descriptors.FieldDescriptor field,
2389             int index,
2390             java.lang.Object value) {
2391           return super.setRepeatedField(field, index, value);
2392         }
2393 
2394         @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2395         public Builder addRepeatedField(
2396             com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
2397           return super.addRepeatedField(field, value);
2398         }
2399 
2400         @java.lang.Override
mergeFrom(com.google.protobuf.Message other)2401         public Builder mergeFrom(com.google.protobuf.Message other) {
2402           if (other instanceof com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) {
2403             return mergeFrom((com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) other);
2404           } else {
2405             super.mergeFrom(other);
2406             return this;
2407           }
2408         }
2409 
mergeFrom( com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey other)2410         public Builder mergeFrom(
2411             com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey other) {
2412           if (other
2413               == com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance())
2414             return this;
2415           if (!other.getKey().isEmpty()) {
2416             key_ = other.key_;
2417             bitField0_ |= 0x00000001;
2418             onChanged();
2419           }
2420           if (intervalsBuilder_ == null) {
2421             if (!other.intervals_.isEmpty()) {
2422               if (intervals_.isEmpty()) {
2423                 intervals_ = other.intervals_;
2424                 bitField0_ = (bitField0_ & ~0x00000002);
2425               } else {
2426                 ensureIntervalsIsMutable();
2427                 intervals_.addAll(other.intervals_);
2428               }
2429               onChanged();
2430             }
2431           } else {
2432             if (!other.intervals_.isEmpty()) {
2433               if (intervalsBuilder_.isEmpty()) {
2434                 intervalsBuilder_.dispose();
2435                 intervalsBuilder_ = null;
2436                 intervals_ = other.intervals_;
2437                 bitField0_ = (bitField0_ & ~0x00000002);
2438                 intervalsBuilder_ =
2439                     com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
2440                         ? getIntervalsFieldBuilder()
2441                         : null;
2442               } else {
2443                 intervalsBuilder_.addAllMessages(other.intervals_);
2444               }
2445             }
2446           }
2447           if (!other.restrictedValues_.isEmpty()) {
2448             if (restrictedValues_.isEmpty()) {
2449               restrictedValues_ = other.restrictedValues_;
2450               bitField0_ = (bitField0_ & ~0x00000004);
2451             } else {
2452               ensureRestrictedValuesIsMutable();
2453               restrictedValues_.addAll(other.restrictedValues_);
2454             }
2455             onChanged();
2456           }
2457           if (!other.prefixes_.isEmpty()) {
2458             if (prefixes_.isEmpty()) {
2459               prefixes_ = other.prefixes_;
2460               bitField0_ = (bitField0_ & ~0x00000008);
2461             } else {
2462               ensurePrefixesIsMutable();
2463               prefixes_.addAll(other.prefixes_);
2464             }
2465             onChanged();
2466           }
2467           if (!other.contains_.isEmpty()) {
2468             if (contains_.isEmpty()) {
2469               contains_ = other.contains_;
2470               bitField0_ = (bitField0_ & ~0x00000010);
2471             } else {
2472               ensureContainsIsMutable();
2473               contains_.addAll(other.contains_);
2474             }
2475             onChanged();
2476           }
2477           if (other.getCaseInsensitive() != false) {
2478             setCaseInsensitive(other.getCaseInsensitive());
2479           }
2480           if (!other.getOrderBy().isEmpty()) {
2481             orderBy_ = other.orderBy_;
2482             bitField0_ |= 0x00000040;
2483             onChanged();
2484           }
2485           if (!other.getQuery().isEmpty()) {
2486             query_ = other.query_;
2487             bitField0_ |= 0x00000080;
2488             onChanged();
2489           }
2490           if (other.getReturnMinMax() != false) {
2491             setReturnMinMax(other.getReturnMinMax());
2492           }
2493           this.mergeUnknownFields(other.getUnknownFields());
2494           onChanged();
2495           return this;
2496         }
2497 
2498         @java.lang.Override
isInitialized()2499         public final boolean isInitialized() {
2500           return true;
2501         }
2502 
2503         @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2504         public Builder mergeFrom(
2505             com.google.protobuf.CodedInputStream input,
2506             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2507             throws java.io.IOException {
2508           if (extensionRegistry == null) {
2509             throw new java.lang.NullPointerException();
2510           }
2511           try {
2512             boolean done = false;
2513             while (!done) {
2514               int tag = input.readTag();
2515               switch (tag) {
2516                 case 0:
2517                   done = true;
2518                   break;
2519                 case 10:
2520                   {
2521                     key_ = input.readStringRequireUtf8();
2522                     bitField0_ |= 0x00000001;
2523                     break;
2524                   } // case 10
2525                 case 18:
2526                   {
2527                     com.google.cloud.retail.v2.Interval m =
2528                         input.readMessage(
2529                             com.google.cloud.retail.v2.Interval.parser(), extensionRegistry);
2530                     if (intervalsBuilder_ == null) {
2531                       ensureIntervalsIsMutable();
2532                       intervals_.add(m);
2533                     } else {
2534                       intervalsBuilder_.addMessage(m);
2535                     }
2536                     break;
2537                   } // case 18
2538                 case 26:
2539                   {
2540                     java.lang.String s = input.readStringRequireUtf8();
2541                     ensureRestrictedValuesIsMutable();
2542                     restrictedValues_.add(s);
2543                     break;
2544                   } // case 26
2545                 case 34:
2546                   {
2547                     orderBy_ = input.readStringRequireUtf8();
2548                     bitField0_ |= 0x00000040;
2549                     break;
2550                   } // case 34
2551                 case 42:
2552                   {
2553                     query_ = input.readStringRequireUtf8();
2554                     bitField0_ |= 0x00000080;
2555                     break;
2556                   } // case 42
2557                 case 66:
2558                   {
2559                     java.lang.String s = input.readStringRequireUtf8();
2560                     ensurePrefixesIsMutable();
2561                     prefixes_.add(s);
2562                     break;
2563                   } // case 66
2564                 case 74:
2565                   {
2566                     java.lang.String s = input.readStringRequireUtf8();
2567                     ensureContainsIsMutable();
2568                     contains_.add(s);
2569                     break;
2570                   } // case 74
2571                 case 80:
2572                   {
2573                     caseInsensitive_ = input.readBool();
2574                     bitField0_ |= 0x00000020;
2575                     break;
2576                   } // case 80
2577                 case 88:
2578                   {
2579                     returnMinMax_ = input.readBool();
2580                     bitField0_ |= 0x00000100;
2581                     break;
2582                   } // case 88
2583                 default:
2584                   {
2585                     if (!super.parseUnknownField(input, extensionRegistry, tag)) {
2586                       done = true; // was an endgroup tag
2587                     }
2588                     break;
2589                   } // default:
2590               } // switch (tag)
2591             } // while (!done)
2592           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
2593             throw e.unwrapIOException();
2594           } finally {
2595             onChanged();
2596           } // finally
2597           return this;
2598         }
2599 
2600         private int bitField0_;
2601 
2602         private java.lang.Object key_ = "";
2603         /**
2604          *
2605          *
2606          * <pre>
2607          * Required. Supported textual and numerical facet keys in
2608          * [Product][google.cloud.retail.v2.Product] object, over which the facet
2609          * values are computed. Facet key is case-sensitive.
2610          * Allowed facet keys when
2611          * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
2612          * is not specified:
2613          * * textual_field =
2614          *     * "brands"
2615          *     * "categories"
2616          *     * "genders"
2617          *     * "ageGroups"
2618          *     * "availability"
2619          *     * "colorFamilies"
2620          *     * "colors"
2621          *     * "sizes"
2622          *     * "materials"
2623          *     * "patterns"
2624          *     * "conditions"
2625          *     * "attributes.key"
2626          *     * "pickupInStore"
2627          *     * "shipToStore"
2628          *     * "sameDayDelivery"
2629          *     * "nextDayDelivery"
2630          *     * "customFulfillment1"
2631          *     * "customFulfillment2"
2632          *     * "customFulfillment3"
2633          *     * "customFulfillment4"
2634          *     * "customFulfillment5"
2635          *     * "inventory(place_id,attributes.key)"
2636          * * numerical_field =
2637          *     * "price"
2638          *     * "discount"
2639          *     * "rating"
2640          *     * "ratingCount"
2641          *     * "attributes.key"
2642          *     * "inventory(place_id,price)"
2643          *     * "inventory(place_id,original_price)"
2644          *     * "inventory(place_id,attributes.key)"
2645          * </pre>
2646          *
2647          * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
2648          *
2649          * @return The key.
2650          */
getKey()2651         public java.lang.String getKey() {
2652           java.lang.Object ref = key_;
2653           if (!(ref instanceof java.lang.String)) {
2654             com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2655             java.lang.String s = bs.toStringUtf8();
2656             key_ = s;
2657             return s;
2658           } else {
2659             return (java.lang.String) ref;
2660           }
2661         }
2662         /**
2663          *
2664          *
2665          * <pre>
2666          * Required. Supported textual and numerical facet keys in
2667          * [Product][google.cloud.retail.v2.Product] object, over which the facet
2668          * values are computed. Facet key is case-sensitive.
2669          * Allowed facet keys when
2670          * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
2671          * is not specified:
2672          * * textual_field =
2673          *     * "brands"
2674          *     * "categories"
2675          *     * "genders"
2676          *     * "ageGroups"
2677          *     * "availability"
2678          *     * "colorFamilies"
2679          *     * "colors"
2680          *     * "sizes"
2681          *     * "materials"
2682          *     * "patterns"
2683          *     * "conditions"
2684          *     * "attributes.key"
2685          *     * "pickupInStore"
2686          *     * "shipToStore"
2687          *     * "sameDayDelivery"
2688          *     * "nextDayDelivery"
2689          *     * "customFulfillment1"
2690          *     * "customFulfillment2"
2691          *     * "customFulfillment3"
2692          *     * "customFulfillment4"
2693          *     * "customFulfillment5"
2694          *     * "inventory(place_id,attributes.key)"
2695          * * numerical_field =
2696          *     * "price"
2697          *     * "discount"
2698          *     * "rating"
2699          *     * "ratingCount"
2700          *     * "attributes.key"
2701          *     * "inventory(place_id,price)"
2702          *     * "inventory(place_id,original_price)"
2703          *     * "inventory(place_id,attributes.key)"
2704          * </pre>
2705          *
2706          * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
2707          *
2708          * @return The bytes for key.
2709          */
getKeyBytes()2710         public com.google.protobuf.ByteString getKeyBytes() {
2711           java.lang.Object ref = key_;
2712           if (ref instanceof String) {
2713             com.google.protobuf.ByteString b =
2714                 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2715             key_ = b;
2716             return b;
2717           } else {
2718             return (com.google.protobuf.ByteString) ref;
2719           }
2720         }
2721         /**
2722          *
2723          *
2724          * <pre>
2725          * Required. Supported textual and numerical facet keys in
2726          * [Product][google.cloud.retail.v2.Product] object, over which the facet
2727          * values are computed. Facet key is case-sensitive.
2728          * Allowed facet keys when
2729          * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
2730          * is not specified:
2731          * * textual_field =
2732          *     * "brands"
2733          *     * "categories"
2734          *     * "genders"
2735          *     * "ageGroups"
2736          *     * "availability"
2737          *     * "colorFamilies"
2738          *     * "colors"
2739          *     * "sizes"
2740          *     * "materials"
2741          *     * "patterns"
2742          *     * "conditions"
2743          *     * "attributes.key"
2744          *     * "pickupInStore"
2745          *     * "shipToStore"
2746          *     * "sameDayDelivery"
2747          *     * "nextDayDelivery"
2748          *     * "customFulfillment1"
2749          *     * "customFulfillment2"
2750          *     * "customFulfillment3"
2751          *     * "customFulfillment4"
2752          *     * "customFulfillment5"
2753          *     * "inventory(place_id,attributes.key)"
2754          * * numerical_field =
2755          *     * "price"
2756          *     * "discount"
2757          *     * "rating"
2758          *     * "ratingCount"
2759          *     * "attributes.key"
2760          *     * "inventory(place_id,price)"
2761          *     * "inventory(place_id,original_price)"
2762          *     * "inventory(place_id,attributes.key)"
2763          * </pre>
2764          *
2765          * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
2766          *
2767          * @param value The key to set.
2768          * @return This builder for chaining.
2769          */
setKey(java.lang.String value)2770         public Builder setKey(java.lang.String value) {
2771           if (value == null) {
2772             throw new NullPointerException();
2773           }
2774           key_ = value;
2775           bitField0_ |= 0x00000001;
2776           onChanged();
2777           return this;
2778         }
2779         /**
2780          *
2781          *
2782          * <pre>
2783          * Required. Supported textual and numerical facet keys in
2784          * [Product][google.cloud.retail.v2.Product] object, over which the facet
2785          * values are computed. Facet key is case-sensitive.
2786          * Allowed facet keys when
2787          * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
2788          * is not specified:
2789          * * textual_field =
2790          *     * "brands"
2791          *     * "categories"
2792          *     * "genders"
2793          *     * "ageGroups"
2794          *     * "availability"
2795          *     * "colorFamilies"
2796          *     * "colors"
2797          *     * "sizes"
2798          *     * "materials"
2799          *     * "patterns"
2800          *     * "conditions"
2801          *     * "attributes.key"
2802          *     * "pickupInStore"
2803          *     * "shipToStore"
2804          *     * "sameDayDelivery"
2805          *     * "nextDayDelivery"
2806          *     * "customFulfillment1"
2807          *     * "customFulfillment2"
2808          *     * "customFulfillment3"
2809          *     * "customFulfillment4"
2810          *     * "customFulfillment5"
2811          *     * "inventory(place_id,attributes.key)"
2812          * * numerical_field =
2813          *     * "price"
2814          *     * "discount"
2815          *     * "rating"
2816          *     * "ratingCount"
2817          *     * "attributes.key"
2818          *     * "inventory(place_id,price)"
2819          *     * "inventory(place_id,original_price)"
2820          *     * "inventory(place_id,attributes.key)"
2821          * </pre>
2822          *
2823          * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
2824          *
2825          * @return This builder for chaining.
2826          */
clearKey()2827         public Builder clearKey() {
2828           key_ = getDefaultInstance().getKey();
2829           bitField0_ = (bitField0_ & ~0x00000001);
2830           onChanged();
2831           return this;
2832         }
2833         /**
2834          *
2835          *
2836          * <pre>
2837          * Required. Supported textual and numerical facet keys in
2838          * [Product][google.cloud.retail.v2.Product] object, over which the facet
2839          * values are computed. Facet key is case-sensitive.
2840          * Allowed facet keys when
2841          * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
2842          * is not specified:
2843          * * textual_field =
2844          *     * "brands"
2845          *     * "categories"
2846          *     * "genders"
2847          *     * "ageGroups"
2848          *     * "availability"
2849          *     * "colorFamilies"
2850          *     * "colors"
2851          *     * "sizes"
2852          *     * "materials"
2853          *     * "patterns"
2854          *     * "conditions"
2855          *     * "attributes.key"
2856          *     * "pickupInStore"
2857          *     * "shipToStore"
2858          *     * "sameDayDelivery"
2859          *     * "nextDayDelivery"
2860          *     * "customFulfillment1"
2861          *     * "customFulfillment2"
2862          *     * "customFulfillment3"
2863          *     * "customFulfillment4"
2864          *     * "customFulfillment5"
2865          *     * "inventory(place_id,attributes.key)"
2866          * * numerical_field =
2867          *     * "price"
2868          *     * "discount"
2869          *     * "rating"
2870          *     * "ratingCount"
2871          *     * "attributes.key"
2872          *     * "inventory(place_id,price)"
2873          *     * "inventory(place_id,original_price)"
2874          *     * "inventory(place_id,attributes.key)"
2875          * </pre>
2876          *
2877          * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
2878          *
2879          * @param value The bytes for key to set.
2880          * @return This builder for chaining.
2881          */
setKeyBytes(com.google.protobuf.ByteString value)2882         public Builder setKeyBytes(com.google.protobuf.ByteString value) {
2883           if (value == null) {
2884             throw new NullPointerException();
2885           }
2886           checkByteStringIsUtf8(value);
2887           key_ = value;
2888           bitField0_ |= 0x00000001;
2889           onChanged();
2890           return this;
2891         }
2892 
2893         private java.util.List<com.google.cloud.retail.v2.Interval> intervals_ =
2894             java.util.Collections.emptyList();
2895 
ensureIntervalsIsMutable()2896         private void ensureIntervalsIsMutable() {
2897           if (!((bitField0_ & 0x00000002) != 0)) {
2898             intervals_ = new java.util.ArrayList<com.google.cloud.retail.v2.Interval>(intervals_);
2899             bitField0_ |= 0x00000002;
2900           }
2901         }
2902 
2903         private com.google.protobuf.RepeatedFieldBuilderV3<
2904                 com.google.cloud.retail.v2.Interval,
2905                 com.google.cloud.retail.v2.Interval.Builder,
2906                 com.google.cloud.retail.v2.IntervalOrBuilder>
2907             intervalsBuilder_;
2908 
2909         /**
2910          *
2911          *
2912          * <pre>
2913          * Set only if values should be bucketized into intervals. Must be set
2914          * for facets with numerical values. Must not be set for facet with text
2915          * values. Maximum number of intervals is 40.
2916          * For all numerical facet keys that appear in the list of products from
2917          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
2918          * computed from their distribution weekly. If the model assigns a high
2919          * score to a numerical facet key and its intervals are not specified in
2920          * the search request, these percentiles will become the bounds
2921          * for its intervals and will be returned in the response. If the
2922          * facet key intervals are specified in the request, then the specified
2923          * intervals will be returned instead.
2924          * </pre>
2925          *
2926          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
2927          */
getIntervalsList()2928         public java.util.List<com.google.cloud.retail.v2.Interval> getIntervalsList() {
2929           if (intervalsBuilder_ == null) {
2930             return java.util.Collections.unmodifiableList(intervals_);
2931           } else {
2932             return intervalsBuilder_.getMessageList();
2933           }
2934         }
2935         /**
2936          *
2937          *
2938          * <pre>
2939          * Set only if values should be bucketized into intervals. Must be set
2940          * for facets with numerical values. Must not be set for facet with text
2941          * values. Maximum number of intervals is 40.
2942          * For all numerical facet keys that appear in the list of products from
2943          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
2944          * computed from their distribution weekly. If the model assigns a high
2945          * score to a numerical facet key and its intervals are not specified in
2946          * the search request, these percentiles will become the bounds
2947          * for its intervals and will be returned in the response. If the
2948          * facet key intervals are specified in the request, then the specified
2949          * intervals will be returned instead.
2950          * </pre>
2951          *
2952          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
2953          */
getIntervalsCount()2954         public int getIntervalsCount() {
2955           if (intervalsBuilder_ == null) {
2956             return intervals_.size();
2957           } else {
2958             return intervalsBuilder_.getCount();
2959           }
2960         }
2961         /**
2962          *
2963          *
2964          * <pre>
2965          * Set only if values should be bucketized into intervals. Must be set
2966          * for facets with numerical values. Must not be set for facet with text
2967          * values. Maximum number of intervals is 40.
2968          * For all numerical facet keys that appear in the list of products from
2969          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
2970          * computed from their distribution weekly. If the model assigns a high
2971          * score to a numerical facet key and its intervals are not specified in
2972          * the search request, these percentiles will become the bounds
2973          * for its intervals and will be returned in the response. If the
2974          * facet key intervals are specified in the request, then the specified
2975          * intervals will be returned instead.
2976          * </pre>
2977          *
2978          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
2979          */
getIntervals(int index)2980         public com.google.cloud.retail.v2.Interval getIntervals(int index) {
2981           if (intervalsBuilder_ == null) {
2982             return intervals_.get(index);
2983           } else {
2984             return intervalsBuilder_.getMessage(index);
2985           }
2986         }
2987         /**
2988          *
2989          *
2990          * <pre>
2991          * Set only if values should be bucketized into intervals. Must be set
2992          * for facets with numerical values. Must not be set for facet with text
2993          * values. Maximum number of intervals is 40.
2994          * For all numerical facet keys that appear in the list of products from
2995          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
2996          * computed from their distribution weekly. If the model assigns a high
2997          * score to a numerical facet key and its intervals are not specified in
2998          * the search request, these percentiles will become the bounds
2999          * for its intervals and will be returned in the response. If the
3000          * facet key intervals are specified in the request, then the specified
3001          * intervals will be returned instead.
3002          * </pre>
3003          *
3004          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3005          */
setIntervals(int index, com.google.cloud.retail.v2.Interval value)3006         public Builder setIntervals(int index, com.google.cloud.retail.v2.Interval value) {
3007           if (intervalsBuilder_ == null) {
3008             if (value == null) {
3009               throw new NullPointerException();
3010             }
3011             ensureIntervalsIsMutable();
3012             intervals_.set(index, value);
3013             onChanged();
3014           } else {
3015             intervalsBuilder_.setMessage(index, value);
3016           }
3017           return this;
3018         }
3019         /**
3020          *
3021          *
3022          * <pre>
3023          * Set only if values should be bucketized into intervals. Must be set
3024          * for facets with numerical values. Must not be set for facet with text
3025          * values. Maximum number of intervals is 40.
3026          * For all numerical facet keys that appear in the list of products from
3027          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3028          * computed from their distribution weekly. If the model assigns a high
3029          * score to a numerical facet key and its intervals are not specified in
3030          * the search request, these percentiles will become the bounds
3031          * for its intervals and will be returned in the response. If the
3032          * facet key intervals are specified in the request, then the specified
3033          * intervals will be returned instead.
3034          * </pre>
3035          *
3036          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3037          */
setIntervals( int index, com.google.cloud.retail.v2.Interval.Builder builderForValue)3038         public Builder setIntervals(
3039             int index, com.google.cloud.retail.v2.Interval.Builder builderForValue) {
3040           if (intervalsBuilder_ == null) {
3041             ensureIntervalsIsMutable();
3042             intervals_.set(index, builderForValue.build());
3043             onChanged();
3044           } else {
3045             intervalsBuilder_.setMessage(index, builderForValue.build());
3046           }
3047           return this;
3048         }
3049         /**
3050          *
3051          *
3052          * <pre>
3053          * Set only if values should be bucketized into intervals. Must be set
3054          * for facets with numerical values. Must not be set for facet with text
3055          * values. Maximum number of intervals is 40.
3056          * For all numerical facet keys that appear in the list of products from
3057          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3058          * computed from their distribution weekly. If the model assigns a high
3059          * score to a numerical facet key and its intervals are not specified in
3060          * the search request, these percentiles will become the bounds
3061          * for its intervals and will be returned in the response. If the
3062          * facet key intervals are specified in the request, then the specified
3063          * intervals will be returned instead.
3064          * </pre>
3065          *
3066          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3067          */
addIntervals(com.google.cloud.retail.v2.Interval value)3068         public Builder addIntervals(com.google.cloud.retail.v2.Interval value) {
3069           if (intervalsBuilder_ == null) {
3070             if (value == null) {
3071               throw new NullPointerException();
3072             }
3073             ensureIntervalsIsMutable();
3074             intervals_.add(value);
3075             onChanged();
3076           } else {
3077             intervalsBuilder_.addMessage(value);
3078           }
3079           return this;
3080         }
3081         /**
3082          *
3083          *
3084          * <pre>
3085          * Set only if values should be bucketized into intervals. Must be set
3086          * for facets with numerical values. Must not be set for facet with text
3087          * values. Maximum number of intervals is 40.
3088          * For all numerical facet keys that appear in the list of products from
3089          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3090          * computed from their distribution weekly. If the model assigns a high
3091          * score to a numerical facet key and its intervals are not specified in
3092          * the search request, these percentiles will become the bounds
3093          * for its intervals and will be returned in the response. If the
3094          * facet key intervals are specified in the request, then the specified
3095          * intervals will be returned instead.
3096          * </pre>
3097          *
3098          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3099          */
addIntervals(int index, com.google.cloud.retail.v2.Interval value)3100         public Builder addIntervals(int index, com.google.cloud.retail.v2.Interval value) {
3101           if (intervalsBuilder_ == null) {
3102             if (value == null) {
3103               throw new NullPointerException();
3104             }
3105             ensureIntervalsIsMutable();
3106             intervals_.add(index, value);
3107             onChanged();
3108           } else {
3109             intervalsBuilder_.addMessage(index, value);
3110           }
3111           return this;
3112         }
3113         /**
3114          *
3115          *
3116          * <pre>
3117          * Set only if values should be bucketized into intervals. Must be set
3118          * for facets with numerical values. Must not be set for facet with text
3119          * values. Maximum number of intervals is 40.
3120          * For all numerical facet keys that appear in the list of products from
3121          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3122          * computed from their distribution weekly. If the model assigns a high
3123          * score to a numerical facet key and its intervals are not specified in
3124          * the search request, these percentiles will become the bounds
3125          * for its intervals and will be returned in the response. If the
3126          * facet key intervals are specified in the request, then the specified
3127          * intervals will be returned instead.
3128          * </pre>
3129          *
3130          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3131          */
addIntervals(com.google.cloud.retail.v2.Interval.Builder builderForValue)3132         public Builder addIntervals(com.google.cloud.retail.v2.Interval.Builder builderForValue) {
3133           if (intervalsBuilder_ == null) {
3134             ensureIntervalsIsMutable();
3135             intervals_.add(builderForValue.build());
3136             onChanged();
3137           } else {
3138             intervalsBuilder_.addMessage(builderForValue.build());
3139           }
3140           return this;
3141         }
3142         /**
3143          *
3144          *
3145          * <pre>
3146          * Set only if values should be bucketized into intervals. Must be set
3147          * for facets with numerical values. Must not be set for facet with text
3148          * values. Maximum number of intervals is 40.
3149          * For all numerical facet keys that appear in the list of products from
3150          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3151          * computed from their distribution weekly. If the model assigns a high
3152          * score to a numerical facet key and its intervals are not specified in
3153          * the search request, these percentiles will become the bounds
3154          * for its intervals and will be returned in the response. If the
3155          * facet key intervals are specified in the request, then the specified
3156          * intervals will be returned instead.
3157          * </pre>
3158          *
3159          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3160          */
addIntervals( int index, com.google.cloud.retail.v2.Interval.Builder builderForValue)3161         public Builder addIntervals(
3162             int index, com.google.cloud.retail.v2.Interval.Builder builderForValue) {
3163           if (intervalsBuilder_ == null) {
3164             ensureIntervalsIsMutable();
3165             intervals_.add(index, builderForValue.build());
3166             onChanged();
3167           } else {
3168             intervalsBuilder_.addMessage(index, builderForValue.build());
3169           }
3170           return this;
3171         }
3172         /**
3173          *
3174          *
3175          * <pre>
3176          * Set only if values should be bucketized into intervals. Must be set
3177          * for facets with numerical values. Must not be set for facet with text
3178          * values. Maximum number of intervals is 40.
3179          * For all numerical facet keys that appear in the list of products from
3180          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3181          * computed from their distribution weekly. If the model assigns a high
3182          * score to a numerical facet key and its intervals are not specified in
3183          * the search request, these percentiles will become the bounds
3184          * for its intervals and will be returned in the response. If the
3185          * facet key intervals are specified in the request, then the specified
3186          * intervals will be returned instead.
3187          * </pre>
3188          *
3189          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3190          */
addAllIntervals( java.lang.Iterable<? extends com.google.cloud.retail.v2.Interval> values)3191         public Builder addAllIntervals(
3192             java.lang.Iterable<? extends com.google.cloud.retail.v2.Interval> values) {
3193           if (intervalsBuilder_ == null) {
3194             ensureIntervalsIsMutable();
3195             com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intervals_);
3196             onChanged();
3197           } else {
3198             intervalsBuilder_.addAllMessages(values);
3199           }
3200           return this;
3201         }
3202         /**
3203          *
3204          *
3205          * <pre>
3206          * Set only if values should be bucketized into intervals. Must be set
3207          * for facets with numerical values. Must not be set for facet with text
3208          * values. Maximum number of intervals is 40.
3209          * For all numerical facet keys that appear in the list of products from
3210          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3211          * computed from their distribution weekly. If the model assigns a high
3212          * score to a numerical facet key and its intervals are not specified in
3213          * the search request, these percentiles will become the bounds
3214          * for its intervals and will be returned in the response. If the
3215          * facet key intervals are specified in the request, then the specified
3216          * intervals will be returned instead.
3217          * </pre>
3218          *
3219          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3220          */
clearIntervals()3221         public Builder clearIntervals() {
3222           if (intervalsBuilder_ == null) {
3223             intervals_ = java.util.Collections.emptyList();
3224             bitField0_ = (bitField0_ & ~0x00000002);
3225             onChanged();
3226           } else {
3227             intervalsBuilder_.clear();
3228           }
3229           return this;
3230         }
3231         /**
3232          *
3233          *
3234          * <pre>
3235          * Set only if values should be bucketized into intervals. Must be set
3236          * for facets with numerical values. Must not be set for facet with text
3237          * values. Maximum number of intervals is 40.
3238          * For all numerical facet keys that appear in the list of products from
3239          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3240          * computed from their distribution weekly. If the model assigns a high
3241          * score to a numerical facet key and its intervals are not specified in
3242          * the search request, these percentiles will become the bounds
3243          * for its intervals and will be returned in the response. If the
3244          * facet key intervals are specified in the request, then the specified
3245          * intervals will be returned instead.
3246          * </pre>
3247          *
3248          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3249          */
removeIntervals(int index)3250         public Builder removeIntervals(int index) {
3251           if (intervalsBuilder_ == null) {
3252             ensureIntervalsIsMutable();
3253             intervals_.remove(index);
3254             onChanged();
3255           } else {
3256             intervalsBuilder_.remove(index);
3257           }
3258           return this;
3259         }
3260         /**
3261          *
3262          *
3263          * <pre>
3264          * Set only if values should be bucketized into intervals. Must be set
3265          * for facets with numerical values. Must not be set for facet with text
3266          * values. Maximum number of intervals is 40.
3267          * For all numerical facet keys that appear in the list of products from
3268          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3269          * computed from their distribution weekly. If the model assigns a high
3270          * score to a numerical facet key and its intervals are not specified in
3271          * the search request, these percentiles will become the bounds
3272          * for its intervals and will be returned in the response. If the
3273          * facet key intervals are specified in the request, then the specified
3274          * intervals will be returned instead.
3275          * </pre>
3276          *
3277          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3278          */
getIntervalsBuilder(int index)3279         public com.google.cloud.retail.v2.Interval.Builder getIntervalsBuilder(int index) {
3280           return getIntervalsFieldBuilder().getBuilder(index);
3281         }
3282         /**
3283          *
3284          *
3285          * <pre>
3286          * Set only if values should be bucketized into intervals. Must be set
3287          * for facets with numerical values. Must not be set for facet with text
3288          * values. Maximum number of intervals is 40.
3289          * For all numerical facet keys that appear in the list of products from
3290          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3291          * computed from their distribution weekly. If the model assigns a high
3292          * score to a numerical facet key and its intervals are not specified in
3293          * the search request, these percentiles will become the bounds
3294          * for its intervals and will be returned in the response. If the
3295          * facet key intervals are specified in the request, then the specified
3296          * intervals will be returned instead.
3297          * </pre>
3298          *
3299          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3300          */
getIntervalsOrBuilder(int index)3301         public com.google.cloud.retail.v2.IntervalOrBuilder getIntervalsOrBuilder(int index) {
3302           if (intervalsBuilder_ == null) {
3303             return intervals_.get(index);
3304           } else {
3305             return intervalsBuilder_.getMessageOrBuilder(index);
3306           }
3307         }
3308         /**
3309          *
3310          *
3311          * <pre>
3312          * Set only if values should be bucketized into intervals. Must be set
3313          * for facets with numerical values. Must not be set for facet with text
3314          * values. Maximum number of intervals is 40.
3315          * For all numerical facet keys that appear in the list of products from
3316          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3317          * computed from their distribution weekly. If the model assigns a high
3318          * score to a numerical facet key and its intervals are not specified in
3319          * the search request, these percentiles will become the bounds
3320          * for its intervals and will be returned in the response. If the
3321          * facet key intervals are specified in the request, then the specified
3322          * intervals will be returned instead.
3323          * </pre>
3324          *
3325          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3326          */
3327         public java.util.List<? extends com.google.cloud.retail.v2.IntervalOrBuilder>
getIntervalsOrBuilderList()3328             getIntervalsOrBuilderList() {
3329           if (intervalsBuilder_ != null) {
3330             return intervalsBuilder_.getMessageOrBuilderList();
3331           } else {
3332             return java.util.Collections.unmodifiableList(intervals_);
3333           }
3334         }
3335         /**
3336          *
3337          *
3338          * <pre>
3339          * Set only if values should be bucketized into intervals. Must be set
3340          * for facets with numerical values. Must not be set for facet with text
3341          * values. Maximum number of intervals is 40.
3342          * For all numerical facet keys that appear in the list of products from
3343          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3344          * computed from their distribution weekly. If the model assigns a high
3345          * score to a numerical facet key and its intervals are not specified in
3346          * the search request, these percentiles will become the bounds
3347          * for its intervals and will be returned in the response. If the
3348          * facet key intervals are specified in the request, then the specified
3349          * intervals will be returned instead.
3350          * </pre>
3351          *
3352          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3353          */
addIntervalsBuilder()3354         public com.google.cloud.retail.v2.Interval.Builder addIntervalsBuilder() {
3355           return getIntervalsFieldBuilder()
3356               .addBuilder(com.google.cloud.retail.v2.Interval.getDefaultInstance());
3357         }
3358         /**
3359          *
3360          *
3361          * <pre>
3362          * Set only if values should be bucketized into intervals. Must be set
3363          * for facets with numerical values. Must not be set for facet with text
3364          * values. Maximum number of intervals is 40.
3365          * For all numerical facet keys that appear in the list of products from
3366          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3367          * computed from their distribution weekly. If the model assigns a high
3368          * score to a numerical facet key and its intervals are not specified in
3369          * the search request, these percentiles will become the bounds
3370          * for its intervals and will be returned in the response. If the
3371          * facet key intervals are specified in the request, then the specified
3372          * intervals will be returned instead.
3373          * </pre>
3374          *
3375          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3376          */
addIntervalsBuilder(int index)3377         public com.google.cloud.retail.v2.Interval.Builder addIntervalsBuilder(int index) {
3378           return getIntervalsFieldBuilder()
3379               .addBuilder(index, com.google.cloud.retail.v2.Interval.getDefaultInstance());
3380         }
3381         /**
3382          *
3383          *
3384          * <pre>
3385          * Set only if values should be bucketized into intervals. Must be set
3386          * for facets with numerical values. Must not be set for facet with text
3387          * values. Maximum number of intervals is 40.
3388          * For all numerical facet keys that appear in the list of products from
3389          * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
3390          * computed from their distribution weekly. If the model assigns a high
3391          * score to a numerical facet key and its intervals are not specified in
3392          * the search request, these percentiles will become the bounds
3393          * for its intervals and will be returned in the response. If the
3394          * facet key intervals are specified in the request, then the specified
3395          * intervals will be returned instead.
3396          * </pre>
3397          *
3398          * <code>repeated .google.cloud.retail.v2.Interval intervals = 2;</code>
3399          */
3400         public java.util.List<com.google.cloud.retail.v2.Interval.Builder>
getIntervalsBuilderList()3401             getIntervalsBuilderList() {
3402           return getIntervalsFieldBuilder().getBuilderList();
3403         }
3404 
3405         private com.google.protobuf.RepeatedFieldBuilderV3<
3406                 com.google.cloud.retail.v2.Interval,
3407                 com.google.cloud.retail.v2.Interval.Builder,
3408                 com.google.cloud.retail.v2.IntervalOrBuilder>
getIntervalsFieldBuilder()3409             getIntervalsFieldBuilder() {
3410           if (intervalsBuilder_ == null) {
3411             intervalsBuilder_ =
3412                 new com.google.protobuf.RepeatedFieldBuilderV3<
3413                     com.google.cloud.retail.v2.Interval,
3414                     com.google.cloud.retail.v2.Interval.Builder,
3415                     com.google.cloud.retail.v2.IntervalOrBuilder>(
3416                     intervals_,
3417                     ((bitField0_ & 0x00000002) != 0),
3418                     getParentForChildren(),
3419                     isClean());
3420             intervals_ = null;
3421           }
3422           return intervalsBuilder_;
3423         }
3424 
3425         private com.google.protobuf.LazyStringList restrictedValues_ =
3426             com.google.protobuf.LazyStringArrayList.EMPTY;
3427 
ensureRestrictedValuesIsMutable()3428         private void ensureRestrictedValuesIsMutable() {
3429           if (!((bitField0_ & 0x00000004) != 0)) {
3430             restrictedValues_ = new com.google.protobuf.LazyStringArrayList(restrictedValues_);
3431             bitField0_ |= 0x00000004;
3432           }
3433         }
3434         /**
3435          *
3436          *
3437          * <pre>
3438          * Only get facet for the given restricted values. For example, when using
3439          * "pickupInStore" as key and set restricted values to
3440          * ["store123", "store456"], only facets for "store123" and "store456" are
3441          * returned. Only supported on predefined textual fields, custom textual
3442          * attributes and fulfillments. Maximum is 20.
3443          * Must be set for the fulfillment facet keys:
3444          * * pickupInStore
3445          * * shipToStore
3446          * * sameDayDelivery
3447          * * nextDayDelivery
3448          * * customFulfillment1
3449          * * customFulfillment2
3450          * * customFulfillment3
3451          * * customFulfillment4
3452          * * customFulfillment5
3453          * </pre>
3454          *
3455          * <code>repeated string restricted_values = 3;</code>
3456          *
3457          * @return A list containing the restrictedValues.
3458          */
getRestrictedValuesList()3459         public com.google.protobuf.ProtocolStringList getRestrictedValuesList() {
3460           return restrictedValues_.getUnmodifiableView();
3461         }
3462         /**
3463          *
3464          *
3465          * <pre>
3466          * Only get facet for the given restricted values. For example, when using
3467          * "pickupInStore" as key and set restricted values to
3468          * ["store123", "store456"], only facets for "store123" and "store456" are
3469          * returned. Only supported on predefined textual fields, custom textual
3470          * attributes and fulfillments. Maximum is 20.
3471          * Must be set for the fulfillment facet keys:
3472          * * pickupInStore
3473          * * shipToStore
3474          * * sameDayDelivery
3475          * * nextDayDelivery
3476          * * customFulfillment1
3477          * * customFulfillment2
3478          * * customFulfillment3
3479          * * customFulfillment4
3480          * * customFulfillment5
3481          * </pre>
3482          *
3483          * <code>repeated string restricted_values = 3;</code>
3484          *
3485          * @return The count of restrictedValues.
3486          */
getRestrictedValuesCount()3487         public int getRestrictedValuesCount() {
3488           return restrictedValues_.size();
3489         }
3490         /**
3491          *
3492          *
3493          * <pre>
3494          * Only get facet for the given restricted values. For example, when using
3495          * "pickupInStore" as key and set restricted values to
3496          * ["store123", "store456"], only facets for "store123" and "store456" are
3497          * returned. Only supported on predefined textual fields, custom textual
3498          * attributes and fulfillments. Maximum is 20.
3499          * Must be set for the fulfillment facet keys:
3500          * * pickupInStore
3501          * * shipToStore
3502          * * sameDayDelivery
3503          * * nextDayDelivery
3504          * * customFulfillment1
3505          * * customFulfillment2
3506          * * customFulfillment3
3507          * * customFulfillment4
3508          * * customFulfillment5
3509          * </pre>
3510          *
3511          * <code>repeated string restricted_values = 3;</code>
3512          *
3513          * @param index The index of the element to return.
3514          * @return The restrictedValues at the given index.
3515          */
getRestrictedValues(int index)3516         public java.lang.String getRestrictedValues(int index) {
3517           return restrictedValues_.get(index);
3518         }
3519         /**
3520          *
3521          *
3522          * <pre>
3523          * Only get facet for the given restricted values. For example, when using
3524          * "pickupInStore" as key and set restricted values to
3525          * ["store123", "store456"], only facets for "store123" and "store456" are
3526          * returned. Only supported on predefined textual fields, custom textual
3527          * attributes and fulfillments. Maximum is 20.
3528          * Must be set for the fulfillment facet keys:
3529          * * pickupInStore
3530          * * shipToStore
3531          * * sameDayDelivery
3532          * * nextDayDelivery
3533          * * customFulfillment1
3534          * * customFulfillment2
3535          * * customFulfillment3
3536          * * customFulfillment4
3537          * * customFulfillment5
3538          * </pre>
3539          *
3540          * <code>repeated string restricted_values = 3;</code>
3541          *
3542          * @param index The index of the value to return.
3543          * @return The bytes of the restrictedValues at the given index.
3544          */
getRestrictedValuesBytes(int index)3545         public com.google.protobuf.ByteString getRestrictedValuesBytes(int index) {
3546           return restrictedValues_.getByteString(index);
3547         }
3548         /**
3549          *
3550          *
3551          * <pre>
3552          * Only get facet for the given restricted values. For example, when using
3553          * "pickupInStore" as key and set restricted values to
3554          * ["store123", "store456"], only facets for "store123" and "store456" are
3555          * returned. Only supported on predefined textual fields, custom textual
3556          * attributes and fulfillments. Maximum is 20.
3557          * Must be set for the fulfillment facet keys:
3558          * * pickupInStore
3559          * * shipToStore
3560          * * sameDayDelivery
3561          * * nextDayDelivery
3562          * * customFulfillment1
3563          * * customFulfillment2
3564          * * customFulfillment3
3565          * * customFulfillment4
3566          * * customFulfillment5
3567          * </pre>
3568          *
3569          * <code>repeated string restricted_values = 3;</code>
3570          *
3571          * @param index The index to set the value at.
3572          * @param value The restrictedValues to set.
3573          * @return This builder for chaining.
3574          */
setRestrictedValues(int index, java.lang.String value)3575         public Builder setRestrictedValues(int index, java.lang.String value) {
3576           if (value == null) {
3577             throw new NullPointerException();
3578           }
3579           ensureRestrictedValuesIsMutable();
3580           restrictedValues_.set(index, value);
3581           onChanged();
3582           return this;
3583         }
3584         /**
3585          *
3586          *
3587          * <pre>
3588          * Only get facet for the given restricted values. For example, when using
3589          * "pickupInStore" as key and set restricted values to
3590          * ["store123", "store456"], only facets for "store123" and "store456" are
3591          * returned. Only supported on predefined textual fields, custom textual
3592          * attributes and fulfillments. Maximum is 20.
3593          * Must be set for the fulfillment facet keys:
3594          * * pickupInStore
3595          * * shipToStore
3596          * * sameDayDelivery
3597          * * nextDayDelivery
3598          * * customFulfillment1
3599          * * customFulfillment2
3600          * * customFulfillment3
3601          * * customFulfillment4
3602          * * customFulfillment5
3603          * </pre>
3604          *
3605          * <code>repeated string restricted_values = 3;</code>
3606          *
3607          * @param value The restrictedValues to add.
3608          * @return This builder for chaining.
3609          */
addRestrictedValues(java.lang.String value)3610         public Builder addRestrictedValues(java.lang.String value) {
3611           if (value == null) {
3612             throw new NullPointerException();
3613           }
3614           ensureRestrictedValuesIsMutable();
3615           restrictedValues_.add(value);
3616           onChanged();
3617           return this;
3618         }
3619         /**
3620          *
3621          *
3622          * <pre>
3623          * Only get facet for the given restricted values. For example, when using
3624          * "pickupInStore" as key and set restricted values to
3625          * ["store123", "store456"], only facets for "store123" and "store456" are
3626          * returned. Only supported on predefined textual fields, custom textual
3627          * attributes and fulfillments. Maximum is 20.
3628          * Must be set for the fulfillment facet keys:
3629          * * pickupInStore
3630          * * shipToStore
3631          * * sameDayDelivery
3632          * * nextDayDelivery
3633          * * customFulfillment1
3634          * * customFulfillment2
3635          * * customFulfillment3
3636          * * customFulfillment4
3637          * * customFulfillment5
3638          * </pre>
3639          *
3640          * <code>repeated string restricted_values = 3;</code>
3641          *
3642          * @param values The restrictedValues to add.
3643          * @return This builder for chaining.
3644          */
addAllRestrictedValues(java.lang.Iterable<java.lang.String> values)3645         public Builder addAllRestrictedValues(java.lang.Iterable<java.lang.String> values) {
3646           ensureRestrictedValuesIsMutable();
3647           com.google.protobuf.AbstractMessageLite.Builder.addAll(values, restrictedValues_);
3648           onChanged();
3649           return this;
3650         }
3651         /**
3652          *
3653          *
3654          * <pre>
3655          * Only get facet for the given restricted values. For example, when using
3656          * "pickupInStore" as key and set restricted values to
3657          * ["store123", "store456"], only facets for "store123" and "store456" are
3658          * returned. Only supported on predefined textual fields, custom textual
3659          * attributes and fulfillments. Maximum is 20.
3660          * Must be set for the fulfillment facet keys:
3661          * * pickupInStore
3662          * * shipToStore
3663          * * sameDayDelivery
3664          * * nextDayDelivery
3665          * * customFulfillment1
3666          * * customFulfillment2
3667          * * customFulfillment3
3668          * * customFulfillment4
3669          * * customFulfillment5
3670          * </pre>
3671          *
3672          * <code>repeated string restricted_values = 3;</code>
3673          *
3674          * @return This builder for chaining.
3675          */
clearRestrictedValues()3676         public Builder clearRestrictedValues() {
3677           restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
3678           bitField0_ = (bitField0_ & ~0x00000004);
3679           onChanged();
3680           return this;
3681         }
3682         /**
3683          *
3684          *
3685          * <pre>
3686          * Only get facet for the given restricted values. For example, when using
3687          * "pickupInStore" as key and set restricted values to
3688          * ["store123", "store456"], only facets for "store123" and "store456" are
3689          * returned. Only supported on predefined textual fields, custom textual
3690          * attributes and fulfillments. Maximum is 20.
3691          * Must be set for the fulfillment facet keys:
3692          * * pickupInStore
3693          * * shipToStore
3694          * * sameDayDelivery
3695          * * nextDayDelivery
3696          * * customFulfillment1
3697          * * customFulfillment2
3698          * * customFulfillment3
3699          * * customFulfillment4
3700          * * customFulfillment5
3701          * </pre>
3702          *
3703          * <code>repeated string restricted_values = 3;</code>
3704          *
3705          * @param value The bytes of the restrictedValues to add.
3706          * @return This builder for chaining.
3707          */
addRestrictedValuesBytes(com.google.protobuf.ByteString value)3708         public Builder addRestrictedValuesBytes(com.google.protobuf.ByteString value) {
3709           if (value == null) {
3710             throw new NullPointerException();
3711           }
3712           checkByteStringIsUtf8(value);
3713           ensureRestrictedValuesIsMutable();
3714           restrictedValues_.add(value);
3715           onChanged();
3716           return this;
3717         }
3718 
3719         private com.google.protobuf.LazyStringList prefixes_ =
3720             com.google.protobuf.LazyStringArrayList.EMPTY;
3721 
ensurePrefixesIsMutable()3722         private void ensurePrefixesIsMutable() {
3723           if (!((bitField0_ & 0x00000008) != 0)) {
3724             prefixes_ = new com.google.protobuf.LazyStringArrayList(prefixes_);
3725             bitField0_ |= 0x00000008;
3726           }
3727         }
3728         /**
3729          *
3730          *
3731          * <pre>
3732          * Only get facet values that start with the given string prefix. For
3733          * example, suppose "categories" has three values "Women &gt; Shoe",
3734          * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
3735          * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
3736          * Only supported on textual fields. Maximum is 10.
3737          * </pre>
3738          *
3739          * <code>repeated string prefixes = 8;</code>
3740          *
3741          * @return A list containing the prefixes.
3742          */
getPrefixesList()3743         public com.google.protobuf.ProtocolStringList getPrefixesList() {
3744           return prefixes_.getUnmodifiableView();
3745         }
3746         /**
3747          *
3748          *
3749          * <pre>
3750          * Only get facet values that start with the given string prefix. For
3751          * example, suppose "categories" has three values "Women &gt; Shoe",
3752          * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
3753          * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
3754          * Only supported on textual fields. Maximum is 10.
3755          * </pre>
3756          *
3757          * <code>repeated string prefixes = 8;</code>
3758          *
3759          * @return The count of prefixes.
3760          */
getPrefixesCount()3761         public int getPrefixesCount() {
3762           return prefixes_.size();
3763         }
3764         /**
3765          *
3766          *
3767          * <pre>
3768          * Only get facet values that start with the given string prefix. For
3769          * example, suppose "categories" has three values "Women &gt; Shoe",
3770          * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
3771          * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
3772          * Only supported on textual fields. Maximum is 10.
3773          * </pre>
3774          *
3775          * <code>repeated string prefixes = 8;</code>
3776          *
3777          * @param index The index of the element to return.
3778          * @return The prefixes at the given index.
3779          */
getPrefixes(int index)3780         public java.lang.String getPrefixes(int index) {
3781           return prefixes_.get(index);
3782         }
3783         /**
3784          *
3785          *
3786          * <pre>
3787          * Only get facet values that start with the given string prefix. For
3788          * example, suppose "categories" has three values "Women &gt; Shoe",
3789          * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
3790          * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
3791          * Only supported on textual fields. Maximum is 10.
3792          * </pre>
3793          *
3794          * <code>repeated string prefixes = 8;</code>
3795          *
3796          * @param index The index of the value to return.
3797          * @return The bytes of the prefixes at the given index.
3798          */
getPrefixesBytes(int index)3799         public com.google.protobuf.ByteString getPrefixesBytes(int index) {
3800           return prefixes_.getByteString(index);
3801         }
3802         /**
3803          *
3804          *
3805          * <pre>
3806          * Only get facet values that start with the given string prefix. For
3807          * example, suppose "categories" has three values "Women &gt; Shoe",
3808          * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
3809          * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
3810          * Only supported on textual fields. Maximum is 10.
3811          * </pre>
3812          *
3813          * <code>repeated string prefixes = 8;</code>
3814          *
3815          * @param index The index to set the value at.
3816          * @param value The prefixes to set.
3817          * @return This builder for chaining.
3818          */
setPrefixes(int index, java.lang.String value)3819         public Builder setPrefixes(int index, java.lang.String value) {
3820           if (value == null) {
3821             throw new NullPointerException();
3822           }
3823           ensurePrefixesIsMutable();
3824           prefixes_.set(index, value);
3825           onChanged();
3826           return this;
3827         }
3828         /**
3829          *
3830          *
3831          * <pre>
3832          * Only get facet values that start with the given string prefix. For
3833          * example, suppose "categories" has three values "Women &gt; Shoe",
3834          * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
3835          * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
3836          * Only supported on textual fields. Maximum is 10.
3837          * </pre>
3838          *
3839          * <code>repeated string prefixes = 8;</code>
3840          *
3841          * @param value The prefixes to add.
3842          * @return This builder for chaining.
3843          */
addPrefixes(java.lang.String value)3844         public Builder addPrefixes(java.lang.String value) {
3845           if (value == null) {
3846             throw new NullPointerException();
3847           }
3848           ensurePrefixesIsMutable();
3849           prefixes_.add(value);
3850           onChanged();
3851           return this;
3852         }
3853         /**
3854          *
3855          *
3856          * <pre>
3857          * Only get facet values that start with the given string prefix. For
3858          * example, suppose "categories" has three values "Women &gt; Shoe",
3859          * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
3860          * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
3861          * Only supported on textual fields. Maximum is 10.
3862          * </pre>
3863          *
3864          * <code>repeated string prefixes = 8;</code>
3865          *
3866          * @param values The prefixes to add.
3867          * @return This builder for chaining.
3868          */
addAllPrefixes(java.lang.Iterable<java.lang.String> values)3869         public Builder addAllPrefixes(java.lang.Iterable<java.lang.String> values) {
3870           ensurePrefixesIsMutable();
3871           com.google.protobuf.AbstractMessageLite.Builder.addAll(values, prefixes_);
3872           onChanged();
3873           return this;
3874         }
3875         /**
3876          *
3877          *
3878          * <pre>
3879          * Only get facet values that start with the given string prefix. For
3880          * example, suppose "categories" has three values "Women &gt; Shoe",
3881          * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
3882          * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
3883          * Only supported on textual fields. Maximum is 10.
3884          * </pre>
3885          *
3886          * <code>repeated string prefixes = 8;</code>
3887          *
3888          * @return This builder for chaining.
3889          */
clearPrefixes()3890         public Builder clearPrefixes() {
3891           prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
3892           bitField0_ = (bitField0_ & ~0x00000008);
3893           onChanged();
3894           return this;
3895         }
3896         /**
3897          *
3898          *
3899          * <pre>
3900          * Only get facet values that start with the given string prefix. For
3901          * example, suppose "categories" has three values "Women &gt; Shoe",
3902          * "Women &gt; Dress" and "Men &gt; Shoe". If set "prefixes" to "Women", the
3903          * "categories" facet will give only "Women &gt; Shoe" and "Women &gt; Dress".
3904          * Only supported on textual fields. Maximum is 10.
3905          * </pre>
3906          *
3907          * <code>repeated string prefixes = 8;</code>
3908          *
3909          * @param value The bytes of the prefixes to add.
3910          * @return This builder for chaining.
3911          */
addPrefixesBytes(com.google.protobuf.ByteString value)3912         public Builder addPrefixesBytes(com.google.protobuf.ByteString value) {
3913           if (value == null) {
3914             throw new NullPointerException();
3915           }
3916           checkByteStringIsUtf8(value);
3917           ensurePrefixesIsMutable();
3918           prefixes_.add(value);
3919           onChanged();
3920           return this;
3921         }
3922 
3923         private com.google.protobuf.LazyStringList contains_ =
3924             com.google.protobuf.LazyStringArrayList.EMPTY;
3925 
ensureContainsIsMutable()3926         private void ensureContainsIsMutable() {
3927           if (!((bitField0_ & 0x00000010) != 0)) {
3928             contains_ = new com.google.protobuf.LazyStringArrayList(contains_);
3929             bitField0_ |= 0x00000010;
3930           }
3931         }
3932         /**
3933          *
3934          *
3935          * <pre>
3936          * Only get facet values that contains the given strings. For example,
3937          * suppose "categories" has three values "Women &gt; Shoe",
3938          * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
3939          * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
3940          * Only supported on textual fields. Maximum is 10.
3941          * </pre>
3942          *
3943          * <code>repeated string contains = 9;</code>
3944          *
3945          * @return A list containing the contains.
3946          */
getContainsList()3947         public com.google.protobuf.ProtocolStringList getContainsList() {
3948           return contains_.getUnmodifiableView();
3949         }
3950         /**
3951          *
3952          *
3953          * <pre>
3954          * Only get facet values that contains the given strings. For example,
3955          * suppose "categories" has three values "Women &gt; Shoe",
3956          * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
3957          * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
3958          * Only supported on textual fields. Maximum is 10.
3959          * </pre>
3960          *
3961          * <code>repeated string contains = 9;</code>
3962          *
3963          * @return The count of contains.
3964          */
getContainsCount()3965         public int getContainsCount() {
3966           return contains_.size();
3967         }
3968         /**
3969          *
3970          *
3971          * <pre>
3972          * Only get facet values that contains the given strings. For example,
3973          * suppose "categories" has three values "Women &gt; Shoe",
3974          * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
3975          * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
3976          * Only supported on textual fields. Maximum is 10.
3977          * </pre>
3978          *
3979          * <code>repeated string contains = 9;</code>
3980          *
3981          * @param index The index of the element to return.
3982          * @return The contains at the given index.
3983          */
getContains(int index)3984         public java.lang.String getContains(int index) {
3985           return contains_.get(index);
3986         }
3987         /**
3988          *
3989          *
3990          * <pre>
3991          * Only get facet values that contains the given strings. For example,
3992          * suppose "categories" has three values "Women &gt; Shoe",
3993          * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
3994          * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
3995          * Only supported on textual fields. Maximum is 10.
3996          * </pre>
3997          *
3998          * <code>repeated string contains = 9;</code>
3999          *
4000          * @param index The index of the value to return.
4001          * @return The bytes of the contains at the given index.
4002          */
getContainsBytes(int index)4003         public com.google.protobuf.ByteString getContainsBytes(int index) {
4004           return contains_.getByteString(index);
4005         }
4006         /**
4007          *
4008          *
4009          * <pre>
4010          * Only get facet values that contains the given strings. For example,
4011          * suppose "categories" has three values "Women &gt; Shoe",
4012          * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
4013          * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
4014          * Only supported on textual fields. Maximum is 10.
4015          * </pre>
4016          *
4017          * <code>repeated string contains = 9;</code>
4018          *
4019          * @param index The index to set the value at.
4020          * @param value The contains to set.
4021          * @return This builder for chaining.
4022          */
setContains(int index, java.lang.String value)4023         public Builder setContains(int index, java.lang.String value) {
4024           if (value == null) {
4025             throw new NullPointerException();
4026           }
4027           ensureContainsIsMutable();
4028           contains_.set(index, value);
4029           onChanged();
4030           return this;
4031         }
4032         /**
4033          *
4034          *
4035          * <pre>
4036          * Only get facet values that contains the given strings. For example,
4037          * suppose "categories" has three values "Women &gt; Shoe",
4038          * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
4039          * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
4040          * Only supported on textual fields. Maximum is 10.
4041          * </pre>
4042          *
4043          * <code>repeated string contains = 9;</code>
4044          *
4045          * @param value The contains to add.
4046          * @return This builder for chaining.
4047          */
addContains(java.lang.String value)4048         public Builder addContains(java.lang.String value) {
4049           if (value == null) {
4050             throw new NullPointerException();
4051           }
4052           ensureContainsIsMutable();
4053           contains_.add(value);
4054           onChanged();
4055           return this;
4056         }
4057         /**
4058          *
4059          *
4060          * <pre>
4061          * Only get facet values that contains the given strings. For example,
4062          * suppose "categories" has three values "Women &gt; Shoe",
4063          * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
4064          * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
4065          * Only supported on textual fields. Maximum is 10.
4066          * </pre>
4067          *
4068          * <code>repeated string contains = 9;</code>
4069          *
4070          * @param values The contains to add.
4071          * @return This builder for chaining.
4072          */
addAllContains(java.lang.Iterable<java.lang.String> values)4073         public Builder addAllContains(java.lang.Iterable<java.lang.String> values) {
4074           ensureContainsIsMutable();
4075           com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contains_);
4076           onChanged();
4077           return this;
4078         }
4079         /**
4080          *
4081          *
4082          * <pre>
4083          * Only get facet values that contains the given strings. For example,
4084          * suppose "categories" has three values "Women &gt; Shoe",
4085          * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
4086          * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
4087          * Only supported on textual fields. Maximum is 10.
4088          * </pre>
4089          *
4090          * <code>repeated string contains = 9;</code>
4091          *
4092          * @return This builder for chaining.
4093          */
clearContains()4094         public Builder clearContains() {
4095           contains_ = com.google.protobuf.LazyStringArrayList.EMPTY;
4096           bitField0_ = (bitField0_ & ~0x00000010);
4097           onChanged();
4098           return this;
4099         }
4100         /**
4101          *
4102          *
4103          * <pre>
4104          * Only get facet values that contains the given strings. For example,
4105          * suppose "categories" has three values "Women &gt; Shoe",
4106          * "Women &gt; Dress" and "Men &gt; Shoe". If set "contains" to "Shoe", the
4107          * "categories" facet will give only "Women &gt; Shoe" and "Men &gt; Shoe".
4108          * Only supported on textual fields. Maximum is 10.
4109          * </pre>
4110          *
4111          * <code>repeated string contains = 9;</code>
4112          *
4113          * @param value The bytes of the contains to add.
4114          * @return This builder for chaining.
4115          */
addContainsBytes(com.google.protobuf.ByteString value)4116         public Builder addContainsBytes(com.google.protobuf.ByteString value) {
4117           if (value == null) {
4118             throw new NullPointerException();
4119           }
4120           checkByteStringIsUtf8(value);
4121           ensureContainsIsMutable();
4122           contains_.add(value);
4123           onChanged();
4124           return this;
4125         }
4126 
4127         private boolean caseInsensitive_;
4128         /**
4129          *
4130          *
4131          * <pre>
4132          * True to make facet keys case insensitive when getting faceting
4133          * values with prefixes or contains; false otherwise.
4134          * </pre>
4135          *
4136          * <code>bool case_insensitive = 10;</code>
4137          *
4138          * @return The caseInsensitive.
4139          */
4140         @java.lang.Override
getCaseInsensitive()4141         public boolean getCaseInsensitive() {
4142           return caseInsensitive_;
4143         }
4144         /**
4145          *
4146          *
4147          * <pre>
4148          * True to make facet keys case insensitive when getting faceting
4149          * values with prefixes or contains; false otherwise.
4150          * </pre>
4151          *
4152          * <code>bool case_insensitive = 10;</code>
4153          *
4154          * @param value The caseInsensitive to set.
4155          * @return This builder for chaining.
4156          */
setCaseInsensitive(boolean value)4157         public Builder setCaseInsensitive(boolean value) {
4158 
4159           caseInsensitive_ = value;
4160           bitField0_ |= 0x00000020;
4161           onChanged();
4162           return this;
4163         }
4164         /**
4165          *
4166          *
4167          * <pre>
4168          * True to make facet keys case insensitive when getting faceting
4169          * values with prefixes or contains; false otherwise.
4170          * </pre>
4171          *
4172          * <code>bool case_insensitive = 10;</code>
4173          *
4174          * @return This builder for chaining.
4175          */
clearCaseInsensitive()4176         public Builder clearCaseInsensitive() {
4177           bitField0_ = (bitField0_ & ~0x00000020);
4178           caseInsensitive_ = false;
4179           onChanged();
4180           return this;
4181         }
4182 
4183         private java.lang.Object orderBy_ = "";
4184         /**
4185          *
4186          *
4187          * <pre>
4188          * The order in which
4189          * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values]
4190          * are returned.
4191          * Allowed values are:
4192          * * "count desc", which means order by
4193          * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
4194          * descending.
4195          * * "value desc", which means order by
4196          * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
4197          * descending.
4198          *   Only applies to textual facets.
4199          * If not set, textual values are sorted in [natural
4200          * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
4201          * intervals are sorted in the order given by
4202          * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
4203          * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
4204          * are sorted in the order given by
4205          * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
4206          * </pre>
4207          *
4208          * <code>string order_by = 4;</code>
4209          *
4210          * @return The orderBy.
4211          */
getOrderBy()4212         public java.lang.String getOrderBy() {
4213           java.lang.Object ref = orderBy_;
4214           if (!(ref instanceof java.lang.String)) {
4215             com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
4216             java.lang.String s = bs.toStringUtf8();
4217             orderBy_ = s;
4218             return s;
4219           } else {
4220             return (java.lang.String) ref;
4221           }
4222         }
4223         /**
4224          *
4225          *
4226          * <pre>
4227          * The order in which
4228          * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values]
4229          * are returned.
4230          * Allowed values are:
4231          * * "count desc", which means order by
4232          * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
4233          * descending.
4234          * * "value desc", which means order by
4235          * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
4236          * descending.
4237          *   Only applies to textual facets.
4238          * If not set, textual values are sorted in [natural
4239          * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
4240          * intervals are sorted in the order given by
4241          * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
4242          * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
4243          * are sorted in the order given by
4244          * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
4245          * </pre>
4246          *
4247          * <code>string order_by = 4;</code>
4248          *
4249          * @return The bytes for orderBy.
4250          */
getOrderByBytes()4251         public com.google.protobuf.ByteString getOrderByBytes() {
4252           java.lang.Object ref = orderBy_;
4253           if (ref instanceof String) {
4254             com.google.protobuf.ByteString b =
4255                 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
4256             orderBy_ = b;
4257             return b;
4258           } else {
4259             return (com.google.protobuf.ByteString) ref;
4260           }
4261         }
4262         /**
4263          *
4264          *
4265          * <pre>
4266          * The order in which
4267          * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values]
4268          * are returned.
4269          * Allowed values are:
4270          * * "count desc", which means order by
4271          * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
4272          * descending.
4273          * * "value desc", which means order by
4274          * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
4275          * descending.
4276          *   Only applies to textual facets.
4277          * If not set, textual values are sorted in [natural
4278          * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
4279          * intervals are sorted in the order given by
4280          * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
4281          * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
4282          * are sorted in the order given by
4283          * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
4284          * </pre>
4285          *
4286          * <code>string order_by = 4;</code>
4287          *
4288          * @param value The orderBy to set.
4289          * @return This builder for chaining.
4290          */
setOrderBy(java.lang.String value)4291         public Builder setOrderBy(java.lang.String value) {
4292           if (value == null) {
4293             throw new NullPointerException();
4294           }
4295           orderBy_ = value;
4296           bitField0_ |= 0x00000040;
4297           onChanged();
4298           return this;
4299         }
4300         /**
4301          *
4302          *
4303          * <pre>
4304          * The order in which
4305          * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values]
4306          * are returned.
4307          * Allowed values are:
4308          * * "count desc", which means order by
4309          * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
4310          * descending.
4311          * * "value desc", which means order by
4312          * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
4313          * descending.
4314          *   Only applies to textual facets.
4315          * If not set, textual values are sorted in [natural
4316          * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
4317          * intervals are sorted in the order given by
4318          * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
4319          * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
4320          * are sorted in the order given by
4321          * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
4322          * </pre>
4323          *
4324          * <code>string order_by = 4;</code>
4325          *
4326          * @return This builder for chaining.
4327          */
clearOrderBy()4328         public Builder clearOrderBy() {
4329           orderBy_ = getDefaultInstance().getOrderBy();
4330           bitField0_ = (bitField0_ & ~0x00000040);
4331           onChanged();
4332           return this;
4333         }
4334         /**
4335          *
4336          *
4337          * <pre>
4338          * The order in which
4339          * [SearchResponse.Facet.values][google.cloud.retail.v2.SearchResponse.Facet.values]
4340          * are returned.
4341          * Allowed values are:
4342          * * "count desc", which means order by
4343          * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
4344          * descending.
4345          * * "value desc", which means order by
4346          * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
4347          * descending.
4348          *   Only applies to textual facets.
4349          * If not set, textual values are sorted in [natural
4350          * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
4351          * intervals are sorted in the order given by
4352          * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
4353          * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
4354          * are sorted in the order given by
4355          * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
4356          * </pre>
4357          *
4358          * <code>string order_by = 4;</code>
4359          *
4360          * @param value The bytes for orderBy to set.
4361          * @return This builder for chaining.
4362          */
setOrderByBytes(com.google.protobuf.ByteString value)4363         public Builder setOrderByBytes(com.google.protobuf.ByteString value) {
4364           if (value == null) {
4365             throw new NullPointerException();
4366           }
4367           checkByteStringIsUtf8(value);
4368           orderBy_ = value;
4369           bitField0_ |= 0x00000040;
4370           onChanged();
4371           return this;
4372         }
4373 
4374         private java.lang.Object query_ = "";
4375         /**
4376          *
4377          *
4378          * <pre>
4379          * The query that is used to compute facet for the given facet key.
4380          * When provided, it will override the default behavior of facet
4381          * computation. The query syntax is the same as a filter expression. See
4382          * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
4383          * detail syntax and limitations. Notice that there is no limitation on
4384          * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4385          * when query is specified.
4386          * In the response,
4387          * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
4388          * will be always "1" and
4389          * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
4390          * will be the number of results that match the query.
4391          * For example, you can set a customized facet for "shipToStore",
4392          * where
4393          * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4394          * is "customizedShipToStore", and
4395          * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
4396          * is "availability: ANY(&#92;"IN_STOCK&#92;") AND shipToStore: ANY(&#92;"123&#92;")".
4397          * Then the facet will count the products that are both in stock and ship
4398          * to store "123".
4399          * </pre>
4400          *
4401          * <code>string query = 5;</code>
4402          *
4403          * @return The query.
4404          */
getQuery()4405         public java.lang.String getQuery() {
4406           java.lang.Object ref = query_;
4407           if (!(ref instanceof java.lang.String)) {
4408             com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
4409             java.lang.String s = bs.toStringUtf8();
4410             query_ = s;
4411             return s;
4412           } else {
4413             return (java.lang.String) ref;
4414           }
4415         }
4416         /**
4417          *
4418          *
4419          * <pre>
4420          * The query that is used to compute facet for the given facet key.
4421          * When provided, it will override the default behavior of facet
4422          * computation. The query syntax is the same as a filter expression. See
4423          * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
4424          * detail syntax and limitations. Notice that there is no limitation on
4425          * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4426          * when query is specified.
4427          * In the response,
4428          * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
4429          * will be always "1" and
4430          * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
4431          * will be the number of results that match the query.
4432          * For example, you can set a customized facet for "shipToStore",
4433          * where
4434          * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4435          * is "customizedShipToStore", and
4436          * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
4437          * is "availability: ANY(&#92;"IN_STOCK&#92;") AND shipToStore: ANY(&#92;"123&#92;")".
4438          * Then the facet will count the products that are both in stock and ship
4439          * to store "123".
4440          * </pre>
4441          *
4442          * <code>string query = 5;</code>
4443          *
4444          * @return The bytes for query.
4445          */
getQueryBytes()4446         public com.google.protobuf.ByteString getQueryBytes() {
4447           java.lang.Object ref = query_;
4448           if (ref instanceof String) {
4449             com.google.protobuf.ByteString b =
4450                 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
4451             query_ = b;
4452             return b;
4453           } else {
4454             return (com.google.protobuf.ByteString) ref;
4455           }
4456         }
4457         /**
4458          *
4459          *
4460          * <pre>
4461          * The query that is used to compute facet for the given facet key.
4462          * When provided, it will override the default behavior of facet
4463          * computation. The query syntax is the same as a filter expression. See
4464          * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
4465          * detail syntax and limitations. Notice that there is no limitation on
4466          * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4467          * when query is specified.
4468          * In the response,
4469          * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
4470          * will be always "1" and
4471          * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
4472          * will be the number of results that match the query.
4473          * For example, you can set a customized facet for "shipToStore",
4474          * where
4475          * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4476          * is "customizedShipToStore", and
4477          * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
4478          * is "availability: ANY(&#92;"IN_STOCK&#92;") AND shipToStore: ANY(&#92;"123&#92;")".
4479          * Then the facet will count the products that are both in stock and ship
4480          * to store "123".
4481          * </pre>
4482          *
4483          * <code>string query = 5;</code>
4484          *
4485          * @param value The query to set.
4486          * @return This builder for chaining.
4487          */
setQuery(java.lang.String value)4488         public Builder setQuery(java.lang.String value) {
4489           if (value == null) {
4490             throw new NullPointerException();
4491           }
4492           query_ = value;
4493           bitField0_ |= 0x00000080;
4494           onChanged();
4495           return this;
4496         }
4497         /**
4498          *
4499          *
4500          * <pre>
4501          * The query that is used to compute facet for the given facet key.
4502          * When provided, it will override the default behavior of facet
4503          * computation. The query syntax is the same as a filter expression. See
4504          * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
4505          * detail syntax and limitations. Notice that there is no limitation on
4506          * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4507          * when query is specified.
4508          * In the response,
4509          * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
4510          * will be always "1" and
4511          * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
4512          * will be the number of results that match the query.
4513          * For example, you can set a customized facet for "shipToStore",
4514          * where
4515          * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4516          * is "customizedShipToStore", and
4517          * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
4518          * is "availability: ANY(&#92;"IN_STOCK&#92;") AND shipToStore: ANY(&#92;"123&#92;")".
4519          * Then the facet will count the products that are both in stock and ship
4520          * to store "123".
4521          * </pre>
4522          *
4523          * <code>string query = 5;</code>
4524          *
4525          * @return This builder for chaining.
4526          */
clearQuery()4527         public Builder clearQuery() {
4528           query_ = getDefaultInstance().getQuery();
4529           bitField0_ = (bitField0_ & ~0x00000080);
4530           onChanged();
4531           return this;
4532         }
4533         /**
4534          *
4535          *
4536          * <pre>
4537          * The query that is used to compute facet for the given facet key.
4538          * When provided, it will override the default behavior of facet
4539          * computation. The query syntax is the same as a filter expression. See
4540          * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
4541          * detail syntax and limitations. Notice that there is no limitation on
4542          * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4543          * when query is specified.
4544          * In the response,
4545          * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value]
4546          * will be always "1" and
4547          * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count]
4548          * will be the number of results that match the query.
4549          * For example, you can set a customized facet for "shipToStore",
4550          * where
4551          * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4552          * is "customizedShipToStore", and
4553          * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
4554          * is "availability: ANY(&#92;"IN_STOCK&#92;") AND shipToStore: ANY(&#92;"123&#92;")".
4555          * Then the facet will count the products that are both in stock and ship
4556          * to store "123".
4557          * </pre>
4558          *
4559          * <code>string query = 5;</code>
4560          *
4561          * @param value The bytes for query to set.
4562          * @return This builder for chaining.
4563          */
setQueryBytes(com.google.protobuf.ByteString value)4564         public Builder setQueryBytes(com.google.protobuf.ByteString value) {
4565           if (value == null) {
4566             throw new NullPointerException();
4567           }
4568           checkByteStringIsUtf8(value);
4569           query_ = value;
4570           bitField0_ |= 0x00000080;
4571           onChanged();
4572           return this;
4573         }
4574 
4575         private boolean returnMinMax_;
4576         /**
4577          *
4578          *
4579          * <pre>
4580          * Returns the min and max value for each numerical facet intervals.
4581          * Ignored for textual facets.
4582          * </pre>
4583          *
4584          * <code>bool return_min_max = 11;</code>
4585          *
4586          * @return The returnMinMax.
4587          */
4588         @java.lang.Override
getReturnMinMax()4589         public boolean getReturnMinMax() {
4590           return returnMinMax_;
4591         }
4592         /**
4593          *
4594          *
4595          * <pre>
4596          * Returns the min and max value for each numerical facet intervals.
4597          * Ignored for textual facets.
4598          * </pre>
4599          *
4600          * <code>bool return_min_max = 11;</code>
4601          *
4602          * @param value The returnMinMax to set.
4603          * @return This builder for chaining.
4604          */
setReturnMinMax(boolean value)4605         public Builder setReturnMinMax(boolean value) {
4606 
4607           returnMinMax_ = value;
4608           bitField0_ |= 0x00000100;
4609           onChanged();
4610           return this;
4611         }
4612         /**
4613          *
4614          *
4615          * <pre>
4616          * Returns the min and max value for each numerical facet intervals.
4617          * Ignored for textual facets.
4618          * </pre>
4619          *
4620          * <code>bool return_min_max = 11;</code>
4621          *
4622          * @return This builder for chaining.
4623          */
clearReturnMinMax()4624         public Builder clearReturnMinMax() {
4625           bitField0_ = (bitField0_ & ~0x00000100);
4626           returnMinMax_ = false;
4627           onChanged();
4628           return this;
4629         }
4630 
4631         @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)4632         public final Builder setUnknownFields(
4633             final com.google.protobuf.UnknownFieldSet unknownFields) {
4634           return super.setUnknownFields(unknownFields);
4635         }
4636 
4637         @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)4638         public final Builder mergeUnknownFields(
4639             final com.google.protobuf.UnknownFieldSet unknownFields) {
4640           return super.mergeUnknownFields(unknownFields);
4641         }
4642 
4643         // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey)
4644       }
4645 
4646       // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey)
4647       private static final com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey
4648           DEFAULT_INSTANCE;
4649 
4650       static {
4651         DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey();
4652       }
4653 
4654       public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey
getDefaultInstance()4655           getDefaultInstance() {
4656         return DEFAULT_INSTANCE;
4657       }
4658 
4659       private static final com.google.protobuf.Parser<FacetKey> PARSER =
4660           new com.google.protobuf.AbstractParser<FacetKey>() {
4661             @java.lang.Override
4662             public FacetKey parsePartialFrom(
4663                 com.google.protobuf.CodedInputStream input,
4664                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4665                 throws com.google.protobuf.InvalidProtocolBufferException {
4666               Builder builder = newBuilder();
4667               try {
4668                 builder.mergeFrom(input, extensionRegistry);
4669               } catch (com.google.protobuf.InvalidProtocolBufferException e) {
4670                 throw e.setUnfinishedMessage(builder.buildPartial());
4671               } catch (com.google.protobuf.UninitializedMessageException e) {
4672                 throw e.asInvalidProtocolBufferException()
4673                     .setUnfinishedMessage(builder.buildPartial());
4674               } catch (java.io.IOException e) {
4675                 throw new com.google.protobuf.InvalidProtocolBufferException(e)
4676                     .setUnfinishedMessage(builder.buildPartial());
4677               }
4678               return builder.buildPartial();
4679             }
4680           };
4681 
parser()4682       public static com.google.protobuf.Parser<FacetKey> parser() {
4683         return PARSER;
4684       }
4685 
4686       @java.lang.Override
getParserForType()4687       public com.google.protobuf.Parser<FacetKey> getParserForType() {
4688         return PARSER;
4689       }
4690 
4691       @java.lang.Override
4692       public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey
getDefaultInstanceForType()4693           getDefaultInstanceForType() {
4694         return DEFAULT_INSTANCE;
4695       }
4696     }
4697 
4698     public static final int FACET_KEY_FIELD_NUMBER = 1;
4699     private com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facetKey_;
4700     /**
4701      *
4702      *
4703      * <pre>
4704      * Required. The facet key specification.
4705      * </pre>
4706      *
4707      * <code>
4708      * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
4709      * </code>
4710      *
4711      * @return Whether the facetKey field is set.
4712      */
4713     @java.lang.Override
hasFacetKey()4714     public boolean hasFacetKey() {
4715       return facetKey_ != null;
4716     }
4717     /**
4718      *
4719      *
4720      * <pre>
4721      * Required. The facet key specification.
4722      * </pre>
4723      *
4724      * <code>
4725      * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
4726      * </code>
4727      *
4728      * @return The facetKey.
4729      */
4730     @java.lang.Override
getFacetKey()4731     public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey getFacetKey() {
4732       return facetKey_ == null
4733           ? com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance()
4734           : facetKey_;
4735     }
4736     /**
4737      *
4738      *
4739      * <pre>
4740      * Required. The facet key specification.
4741      * </pre>
4742      *
4743      * <code>
4744      * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
4745      * </code>
4746      */
4747     @java.lang.Override
4748     public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder
getFacetKeyOrBuilder()4749         getFacetKeyOrBuilder() {
4750       return facetKey_ == null
4751           ? com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance()
4752           : facetKey_;
4753     }
4754 
4755     public static final int LIMIT_FIELD_NUMBER = 2;
4756     private int limit_ = 0;
4757     /**
4758      *
4759      *
4760      * <pre>
4761      * Maximum of facet values that should be returned for this facet. If
4762      * unspecified, defaults to 50. The maximum allowed value is 300. Values
4763      * above 300 will be coerced to 300.
4764      * If this field is negative, an INVALID_ARGUMENT is returned.
4765      * </pre>
4766      *
4767      * <code>int32 limit = 2;</code>
4768      *
4769      * @return The limit.
4770      */
4771     @java.lang.Override
getLimit()4772     public int getLimit() {
4773       return limit_;
4774     }
4775 
4776     public static final int EXCLUDED_FILTER_KEYS_FIELD_NUMBER = 3;
4777 
4778     @SuppressWarnings("serial")
4779     private com.google.protobuf.LazyStringList excludedFilterKeys_;
4780     /**
4781      *
4782      *
4783      * <pre>
4784      * List of keys to exclude when faceting.
4785      * By default,
4786      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4787      * is not excluded from the filter unless it is listed in this field.
4788      * Listing a facet key in this field allows its values to appear as facet
4789      * results, even when they are filtered out of search results. Using this
4790      * field does not affect what search results are returned.
4791      * For example, suppose there are 100 products with the color facet "Red"
4792      * and 200 products with the color facet "Blue". A query containing the
4793      * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
4794      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4795      * would by default return only "Red" products in the search results, and
4796      * also return "Red" with count 100 as the only color facet. Although there
4797      * are also blue products available, "Blue" would not be shown as an
4798      * available facet value.
4799      * If "colorFamilies" is listed in "excludedFilterKeys", then the query
4800      * returns the facet values "Red" with count 100 and "Blue" with count
4801      * 200, because the "colorFamilies" key is now excluded from the filter.
4802      * Because this field doesn't affect search results, the search results
4803      * are still correctly filtered to return only "Red" products.
4804      * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
4805      * is returned.
4806      * </pre>
4807      *
4808      * <code>repeated string excluded_filter_keys = 3;</code>
4809      *
4810      * @return A list containing the excludedFilterKeys.
4811      */
getExcludedFilterKeysList()4812     public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() {
4813       return excludedFilterKeys_;
4814     }
4815     /**
4816      *
4817      *
4818      * <pre>
4819      * List of keys to exclude when faceting.
4820      * By default,
4821      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4822      * is not excluded from the filter unless it is listed in this field.
4823      * Listing a facet key in this field allows its values to appear as facet
4824      * results, even when they are filtered out of search results. Using this
4825      * field does not affect what search results are returned.
4826      * For example, suppose there are 100 products with the color facet "Red"
4827      * and 200 products with the color facet "Blue". A query containing the
4828      * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
4829      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4830      * would by default return only "Red" products in the search results, and
4831      * also return "Red" with count 100 as the only color facet. Although there
4832      * are also blue products available, "Blue" would not be shown as an
4833      * available facet value.
4834      * If "colorFamilies" is listed in "excludedFilterKeys", then the query
4835      * returns the facet values "Red" with count 100 and "Blue" with count
4836      * 200, because the "colorFamilies" key is now excluded from the filter.
4837      * Because this field doesn't affect search results, the search results
4838      * are still correctly filtered to return only "Red" products.
4839      * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
4840      * is returned.
4841      * </pre>
4842      *
4843      * <code>repeated string excluded_filter_keys = 3;</code>
4844      *
4845      * @return The count of excludedFilterKeys.
4846      */
getExcludedFilterKeysCount()4847     public int getExcludedFilterKeysCount() {
4848       return excludedFilterKeys_.size();
4849     }
4850     /**
4851      *
4852      *
4853      * <pre>
4854      * List of keys to exclude when faceting.
4855      * By default,
4856      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4857      * is not excluded from the filter unless it is listed in this field.
4858      * Listing a facet key in this field allows its values to appear as facet
4859      * results, even when they are filtered out of search results. Using this
4860      * field does not affect what search results are returned.
4861      * For example, suppose there are 100 products with the color facet "Red"
4862      * and 200 products with the color facet "Blue". A query containing the
4863      * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
4864      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4865      * would by default return only "Red" products in the search results, and
4866      * also return "Red" with count 100 as the only color facet. Although there
4867      * are also blue products available, "Blue" would not be shown as an
4868      * available facet value.
4869      * If "colorFamilies" is listed in "excludedFilterKeys", then the query
4870      * returns the facet values "Red" with count 100 and "Blue" with count
4871      * 200, because the "colorFamilies" key is now excluded from the filter.
4872      * Because this field doesn't affect search results, the search results
4873      * are still correctly filtered to return only "Red" products.
4874      * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
4875      * is returned.
4876      * </pre>
4877      *
4878      * <code>repeated string excluded_filter_keys = 3;</code>
4879      *
4880      * @param index The index of the element to return.
4881      * @return The excludedFilterKeys at the given index.
4882      */
getExcludedFilterKeys(int index)4883     public java.lang.String getExcludedFilterKeys(int index) {
4884       return excludedFilterKeys_.get(index);
4885     }
4886     /**
4887      *
4888      *
4889      * <pre>
4890      * List of keys to exclude when faceting.
4891      * By default,
4892      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4893      * is not excluded from the filter unless it is listed in this field.
4894      * Listing a facet key in this field allows its values to appear as facet
4895      * results, even when they are filtered out of search results. Using this
4896      * field does not affect what search results are returned.
4897      * For example, suppose there are 100 products with the color facet "Red"
4898      * and 200 products with the color facet "Blue". A query containing the
4899      * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
4900      * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
4901      * would by default return only "Red" products in the search results, and
4902      * also return "Red" with count 100 as the only color facet. Although there
4903      * are also blue products available, "Blue" would not be shown as an
4904      * available facet value.
4905      * If "colorFamilies" is listed in "excludedFilterKeys", then the query
4906      * returns the facet values "Red" with count 100 and "Blue" with count
4907      * 200, because the "colorFamilies" key is now excluded from the filter.
4908      * Because this field doesn't affect search results, the search results
4909      * are still correctly filtered to return only "Red" products.
4910      * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
4911      * is returned.
4912      * </pre>
4913      *
4914      * <code>repeated string excluded_filter_keys = 3;</code>
4915      *
4916      * @param index The index of the value to return.
4917      * @return The bytes of the excludedFilterKeys at the given index.
4918      */
getExcludedFilterKeysBytes(int index)4919     public com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index) {
4920       return excludedFilterKeys_.getByteString(index);
4921     }
4922 
4923     public static final int ENABLE_DYNAMIC_POSITION_FIELD_NUMBER = 4;
4924     private boolean enableDynamicPosition_ = false;
4925     /**
4926      *
4927      *
4928      * <pre>
4929      * Enables dynamic position for this facet. If set to true, the position of
4930      * this facet among all facets in the response is determined by Google
4931      * Retail Search. It will be ordered together with dynamic facets if dynamic
4932      * facets is enabled. If set to false, the position of this facet in the
4933      * response will be the same as in the request, and it will be ranked before
4934      * the facets with dynamic position enable and all dynamic facets.
4935      * For example, you may always want to have rating facet returned in
4936      * the response, but it's not necessarily to always display the rating facet
4937      * at the top. In that case, you can set enable_dynamic_position to true so
4938      * that the position of rating facet in response will be determined by
4939      * Google Retail Search.
4940      * Another example, assuming you have the following facets in the request:
4941      * * "rating", enable_dynamic_position = true
4942      * * "price", enable_dynamic_position = false
4943      * * "brands", enable_dynamic_position = false
4944      * And also you have a dynamic facets enable, which will generate a facet
4945      * 'gender'. Then the final order of the facets in the response can be
4946      * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
4947      * "rating") depends on how Google Retail Search orders "gender" and
4948      * "rating" facets. However, notice that "price" and "brands" will always be
4949      * ranked at 1st and 2nd position since their enable_dynamic_position are
4950      * false.
4951      * </pre>
4952      *
4953      * <code>bool enable_dynamic_position = 4;</code>
4954      *
4955      * @return The enableDynamicPosition.
4956      */
4957     @java.lang.Override
getEnableDynamicPosition()4958     public boolean getEnableDynamicPosition() {
4959       return enableDynamicPosition_;
4960     }
4961 
4962     private byte memoizedIsInitialized = -1;
4963 
4964     @java.lang.Override
isInitialized()4965     public final boolean isInitialized() {
4966       byte isInitialized = memoizedIsInitialized;
4967       if (isInitialized == 1) return true;
4968       if (isInitialized == 0) return false;
4969 
4970       memoizedIsInitialized = 1;
4971       return true;
4972     }
4973 
4974     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)4975     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
4976       if (facetKey_ != null) {
4977         output.writeMessage(1, getFacetKey());
4978       }
4979       if (limit_ != 0) {
4980         output.writeInt32(2, limit_);
4981       }
4982       for (int i = 0; i < excludedFilterKeys_.size(); i++) {
4983         com.google.protobuf.GeneratedMessageV3.writeString(
4984             output, 3, excludedFilterKeys_.getRaw(i));
4985       }
4986       if (enableDynamicPosition_ != false) {
4987         output.writeBool(4, enableDynamicPosition_);
4988       }
4989       getUnknownFields().writeTo(output);
4990     }
4991 
4992     @java.lang.Override
getSerializedSize()4993     public int getSerializedSize() {
4994       int size = memoizedSize;
4995       if (size != -1) return size;
4996 
4997       size = 0;
4998       if (facetKey_ != null) {
4999         size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFacetKey());
5000       }
5001       if (limit_ != 0) {
5002         size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, limit_);
5003       }
5004       {
5005         int dataSize = 0;
5006         for (int i = 0; i < excludedFilterKeys_.size(); i++) {
5007           dataSize += computeStringSizeNoTag(excludedFilterKeys_.getRaw(i));
5008         }
5009         size += dataSize;
5010         size += 1 * getExcludedFilterKeysList().size();
5011       }
5012       if (enableDynamicPosition_ != false) {
5013         size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, enableDynamicPosition_);
5014       }
5015       size += getUnknownFields().getSerializedSize();
5016       memoizedSize = size;
5017       return size;
5018     }
5019 
5020     @java.lang.Override
equals(final java.lang.Object obj)5021     public boolean equals(final java.lang.Object obj) {
5022       if (obj == this) {
5023         return true;
5024       }
5025       if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.FacetSpec)) {
5026         return super.equals(obj);
5027       }
5028       com.google.cloud.retail.v2.SearchRequest.FacetSpec other =
5029           (com.google.cloud.retail.v2.SearchRequest.FacetSpec) obj;
5030 
5031       if (hasFacetKey() != other.hasFacetKey()) return false;
5032       if (hasFacetKey()) {
5033         if (!getFacetKey().equals(other.getFacetKey())) return false;
5034       }
5035       if (getLimit() != other.getLimit()) return false;
5036       if (!getExcludedFilterKeysList().equals(other.getExcludedFilterKeysList())) return false;
5037       if (getEnableDynamicPosition() != other.getEnableDynamicPosition()) return false;
5038       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
5039       return true;
5040     }
5041 
5042     @java.lang.Override
hashCode()5043     public int hashCode() {
5044       if (memoizedHashCode != 0) {
5045         return memoizedHashCode;
5046       }
5047       int hash = 41;
5048       hash = (19 * hash) + getDescriptor().hashCode();
5049       if (hasFacetKey()) {
5050         hash = (37 * hash) + FACET_KEY_FIELD_NUMBER;
5051         hash = (53 * hash) + getFacetKey().hashCode();
5052       }
5053       hash = (37 * hash) + LIMIT_FIELD_NUMBER;
5054       hash = (53 * hash) + getLimit();
5055       if (getExcludedFilterKeysCount() > 0) {
5056         hash = (37 * hash) + EXCLUDED_FILTER_KEYS_FIELD_NUMBER;
5057         hash = (53 * hash) + getExcludedFilterKeysList().hashCode();
5058       }
5059       hash = (37 * hash) + ENABLE_DYNAMIC_POSITION_FIELD_NUMBER;
5060       hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableDynamicPosition());
5061       hash = (29 * hash) + getUnknownFields().hashCode();
5062       memoizedHashCode = hash;
5063       return hash;
5064     }
5065 
parseFrom( java.nio.ByteBuffer data)5066     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(
5067         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
5068       return PARSER.parseFrom(data);
5069     }
5070 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5071     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(
5072         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
5073         throws com.google.protobuf.InvalidProtocolBufferException {
5074       return PARSER.parseFrom(data, extensionRegistry);
5075     }
5076 
parseFrom( com.google.protobuf.ByteString data)5077     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(
5078         com.google.protobuf.ByteString data)
5079         throws com.google.protobuf.InvalidProtocolBufferException {
5080       return PARSER.parseFrom(data);
5081     }
5082 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5083     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(
5084         com.google.protobuf.ByteString data,
5085         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
5086         throws com.google.protobuf.InvalidProtocolBufferException {
5087       return PARSER.parseFrom(data, extensionRegistry);
5088     }
5089 
parseFrom(byte[] data)5090     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(byte[] data)
5091         throws com.google.protobuf.InvalidProtocolBufferException {
5092       return PARSER.parseFrom(data);
5093     }
5094 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5095     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(
5096         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
5097         throws com.google.protobuf.InvalidProtocolBufferException {
5098       return PARSER.parseFrom(data, extensionRegistry);
5099     }
5100 
parseFrom( java.io.InputStream input)5101     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(
5102         java.io.InputStream input) throws java.io.IOException {
5103       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
5104     }
5105 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5106     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(
5107         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
5108         throws java.io.IOException {
5109       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
5110           PARSER, input, extensionRegistry);
5111     }
5112 
parseDelimitedFrom( java.io.InputStream input)5113     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseDelimitedFrom(
5114         java.io.InputStream input) throws java.io.IOException {
5115       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
5116     }
5117 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5118     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseDelimitedFrom(
5119         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
5120         throws java.io.IOException {
5121       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
5122           PARSER, input, extensionRegistry);
5123     }
5124 
parseFrom( com.google.protobuf.CodedInputStream input)5125     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(
5126         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
5127       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
5128     }
5129 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5130     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(
5131         com.google.protobuf.CodedInputStream input,
5132         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
5133         throws java.io.IOException {
5134       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
5135           PARSER, input, extensionRegistry);
5136     }
5137 
5138     @java.lang.Override
newBuilderForType()5139     public Builder newBuilderForType() {
5140       return newBuilder();
5141     }
5142 
newBuilder()5143     public static Builder newBuilder() {
5144       return DEFAULT_INSTANCE.toBuilder();
5145     }
5146 
newBuilder(com.google.cloud.retail.v2.SearchRequest.FacetSpec prototype)5147     public static Builder newBuilder(com.google.cloud.retail.v2.SearchRequest.FacetSpec prototype) {
5148       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
5149     }
5150 
5151     @java.lang.Override
toBuilder()5152     public Builder toBuilder() {
5153       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
5154     }
5155 
5156     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)5157     protected Builder newBuilderForType(
5158         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
5159       Builder builder = new Builder(parent);
5160       return builder;
5161     }
5162     /**
5163      *
5164      *
5165      * <pre>
5166      * A facet specification to perform faceted search.
5167      * </pre>
5168      *
5169      * Protobuf type {@code google.cloud.retail.v2.SearchRequest.FacetSpec}
5170      */
5171     public static final class Builder
5172         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
5173         implements
5174         // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.FacetSpec)
5175         com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder {
getDescriptor()5176       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
5177         return com.google.cloud.retail.v2.SearchServiceProto
5178             .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_descriptor;
5179       }
5180 
5181       @java.lang.Override
5182       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()5183           internalGetFieldAccessorTable() {
5184         return com.google.cloud.retail.v2.SearchServiceProto
5185             .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_fieldAccessorTable
5186             .ensureFieldAccessorsInitialized(
5187                 com.google.cloud.retail.v2.SearchRequest.FacetSpec.class,
5188                 com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder.class);
5189       }
5190 
5191       // Construct using com.google.cloud.retail.v2.SearchRequest.FacetSpec.newBuilder()
Builder()5192       private Builder() {}
5193 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)5194       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
5195         super(parent);
5196       }
5197 
5198       @java.lang.Override
clear()5199       public Builder clear() {
5200         super.clear();
5201         bitField0_ = 0;
5202         facetKey_ = null;
5203         if (facetKeyBuilder_ != null) {
5204           facetKeyBuilder_.dispose();
5205           facetKeyBuilder_ = null;
5206         }
5207         limit_ = 0;
5208         excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
5209         bitField0_ = (bitField0_ & ~0x00000004);
5210         enableDynamicPosition_ = false;
5211         return this;
5212       }
5213 
5214       @java.lang.Override
getDescriptorForType()5215       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
5216         return com.google.cloud.retail.v2.SearchServiceProto
5217             .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_descriptor;
5218       }
5219 
5220       @java.lang.Override
getDefaultInstanceForType()5221       public com.google.cloud.retail.v2.SearchRequest.FacetSpec getDefaultInstanceForType() {
5222         return com.google.cloud.retail.v2.SearchRequest.FacetSpec.getDefaultInstance();
5223       }
5224 
5225       @java.lang.Override
build()5226       public com.google.cloud.retail.v2.SearchRequest.FacetSpec build() {
5227         com.google.cloud.retail.v2.SearchRequest.FacetSpec result = buildPartial();
5228         if (!result.isInitialized()) {
5229           throw newUninitializedMessageException(result);
5230         }
5231         return result;
5232       }
5233 
5234       @java.lang.Override
buildPartial()5235       public com.google.cloud.retail.v2.SearchRequest.FacetSpec buildPartial() {
5236         com.google.cloud.retail.v2.SearchRequest.FacetSpec result =
5237             new com.google.cloud.retail.v2.SearchRequest.FacetSpec(this);
5238         buildPartialRepeatedFields(result);
5239         if (bitField0_ != 0) {
5240           buildPartial0(result);
5241         }
5242         onBuilt();
5243         return result;
5244       }
5245 
buildPartialRepeatedFields( com.google.cloud.retail.v2.SearchRequest.FacetSpec result)5246       private void buildPartialRepeatedFields(
5247           com.google.cloud.retail.v2.SearchRequest.FacetSpec result) {
5248         if (((bitField0_ & 0x00000004) != 0)) {
5249           excludedFilterKeys_ = excludedFilterKeys_.getUnmodifiableView();
5250           bitField0_ = (bitField0_ & ~0x00000004);
5251         }
5252         result.excludedFilterKeys_ = excludedFilterKeys_;
5253       }
5254 
buildPartial0(com.google.cloud.retail.v2.SearchRequest.FacetSpec result)5255       private void buildPartial0(com.google.cloud.retail.v2.SearchRequest.FacetSpec result) {
5256         int from_bitField0_ = bitField0_;
5257         if (((from_bitField0_ & 0x00000001) != 0)) {
5258           result.facetKey_ = facetKeyBuilder_ == null ? facetKey_ : facetKeyBuilder_.build();
5259         }
5260         if (((from_bitField0_ & 0x00000002) != 0)) {
5261           result.limit_ = limit_;
5262         }
5263         if (((from_bitField0_ & 0x00000008) != 0)) {
5264           result.enableDynamicPosition_ = enableDynamicPosition_;
5265         }
5266       }
5267 
5268       @java.lang.Override
clone()5269       public Builder clone() {
5270         return super.clone();
5271       }
5272 
5273       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)5274       public Builder setField(
5275           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
5276         return super.setField(field, value);
5277       }
5278 
5279       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)5280       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
5281         return super.clearField(field);
5282       }
5283 
5284       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)5285       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
5286         return super.clearOneof(oneof);
5287       }
5288 
5289       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)5290       public Builder setRepeatedField(
5291           com.google.protobuf.Descriptors.FieldDescriptor field,
5292           int index,
5293           java.lang.Object value) {
5294         return super.setRepeatedField(field, index, value);
5295       }
5296 
5297       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)5298       public Builder addRepeatedField(
5299           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
5300         return super.addRepeatedField(field, value);
5301       }
5302 
5303       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)5304       public Builder mergeFrom(com.google.protobuf.Message other) {
5305         if (other instanceof com.google.cloud.retail.v2.SearchRequest.FacetSpec) {
5306           return mergeFrom((com.google.cloud.retail.v2.SearchRequest.FacetSpec) other);
5307         } else {
5308           super.mergeFrom(other);
5309           return this;
5310         }
5311       }
5312 
mergeFrom(com.google.cloud.retail.v2.SearchRequest.FacetSpec other)5313       public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest.FacetSpec other) {
5314         if (other == com.google.cloud.retail.v2.SearchRequest.FacetSpec.getDefaultInstance())
5315           return this;
5316         if (other.hasFacetKey()) {
5317           mergeFacetKey(other.getFacetKey());
5318         }
5319         if (other.getLimit() != 0) {
5320           setLimit(other.getLimit());
5321         }
5322         if (!other.excludedFilterKeys_.isEmpty()) {
5323           if (excludedFilterKeys_.isEmpty()) {
5324             excludedFilterKeys_ = other.excludedFilterKeys_;
5325             bitField0_ = (bitField0_ & ~0x00000004);
5326           } else {
5327             ensureExcludedFilterKeysIsMutable();
5328             excludedFilterKeys_.addAll(other.excludedFilterKeys_);
5329           }
5330           onChanged();
5331         }
5332         if (other.getEnableDynamicPosition() != false) {
5333           setEnableDynamicPosition(other.getEnableDynamicPosition());
5334         }
5335         this.mergeUnknownFields(other.getUnknownFields());
5336         onChanged();
5337         return this;
5338       }
5339 
5340       @java.lang.Override
isInitialized()5341       public final boolean isInitialized() {
5342         return true;
5343       }
5344 
5345       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5346       public Builder mergeFrom(
5347           com.google.protobuf.CodedInputStream input,
5348           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
5349           throws java.io.IOException {
5350         if (extensionRegistry == null) {
5351           throw new java.lang.NullPointerException();
5352         }
5353         try {
5354           boolean done = false;
5355           while (!done) {
5356             int tag = input.readTag();
5357             switch (tag) {
5358               case 0:
5359                 done = true;
5360                 break;
5361               case 10:
5362                 {
5363                   input.readMessage(getFacetKeyFieldBuilder().getBuilder(), extensionRegistry);
5364                   bitField0_ |= 0x00000001;
5365                   break;
5366                 } // case 10
5367               case 16:
5368                 {
5369                   limit_ = input.readInt32();
5370                   bitField0_ |= 0x00000002;
5371                   break;
5372                 } // case 16
5373               case 26:
5374                 {
5375                   java.lang.String s = input.readStringRequireUtf8();
5376                   ensureExcludedFilterKeysIsMutable();
5377                   excludedFilterKeys_.add(s);
5378                   break;
5379                 } // case 26
5380               case 32:
5381                 {
5382                   enableDynamicPosition_ = input.readBool();
5383                   bitField0_ |= 0x00000008;
5384                   break;
5385                 } // case 32
5386               default:
5387                 {
5388                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
5389                     done = true; // was an endgroup tag
5390                   }
5391                   break;
5392                 } // default:
5393             } // switch (tag)
5394           } // while (!done)
5395         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
5396           throw e.unwrapIOException();
5397         } finally {
5398           onChanged();
5399         } // finally
5400         return this;
5401       }
5402 
5403       private int bitField0_;
5404 
5405       private com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facetKey_;
5406       private com.google.protobuf.SingleFieldBuilderV3<
5407               com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey,
5408               com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder,
5409               com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder>
5410           facetKeyBuilder_;
5411       /**
5412        *
5413        *
5414        * <pre>
5415        * Required. The facet key specification.
5416        * </pre>
5417        *
5418        * <code>
5419        * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
5420        * </code>
5421        *
5422        * @return Whether the facetKey field is set.
5423        */
hasFacetKey()5424       public boolean hasFacetKey() {
5425         return ((bitField0_ & 0x00000001) != 0);
5426       }
5427       /**
5428        *
5429        *
5430        * <pre>
5431        * Required. The facet key specification.
5432        * </pre>
5433        *
5434        * <code>
5435        * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
5436        * </code>
5437        *
5438        * @return The facetKey.
5439        */
getFacetKey()5440       public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey getFacetKey() {
5441         if (facetKeyBuilder_ == null) {
5442           return facetKey_ == null
5443               ? com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance()
5444               : facetKey_;
5445         } else {
5446           return facetKeyBuilder_.getMessage();
5447         }
5448       }
5449       /**
5450        *
5451        *
5452        * <pre>
5453        * Required. The facet key specification.
5454        * </pre>
5455        *
5456        * <code>
5457        * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
5458        * </code>
5459        */
setFacetKey( com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey value)5460       public Builder setFacetKey(
5461           com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey value) {
5462         if (facetKeyBuilder_ == null) {
5463           if (value == null) {
5464             throw new NullPointerException();
5465           }
5466           facetKey_ = value;
5467         } else {
5468           facetKeyBuilder_.setMessage(value);
5469         }
5470         bitField0_ |= 0x00000001;
5471         onChanged();
5472         return this;
5473       }
5474       /**
5475        *
5476        *
5477        * <pre>
5478        * Required. The facet key specification.
5479        * </pre>
5480        *
5481        * <code>
5482        * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
5483        * </code>
5484        */
setFacetKey( com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder builderForValue)5485       public Builder setFacetKey(
5486           com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder builderForValue) {
5487         if (facetKeyBuilder_ == null) {
5488           facetKey_ = builderForValue.build();
5489         } else {
5490           facetKeyBuilder_.setMessage(builderForValue.build());
5491         }
5492         bitField0_ |= 0x00000001;
5493         onChanged();
5494         return this;
5495       }
5496       /**
5497        *
5498        *
5499        * <pre>
5500        * Required. The facet key specification.
5501        * </pre>
5502        *
5503        * <code>
5504        * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
5505        * </code>
5506        */
mergeFacetKey( com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey value)5507       public Builder mergeFacetKey(
5508           com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey value) {
5509         if (facetKeyBuilder_ == null) {
5510           if (((bitField0_ & 0x00000001) != 0)
5511               && facetKey_ != null
5512               && facetKey_
5513                   != com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey
5514                       .getDefaultInstance()) {
5515             getFacetKeyBuilder().mergeFrom(value);
5516           } else {
5517             facetKey_ = value;
5518           }
5519         } else {
5520           facetKeyBuilder_.mergeFrom(value);
5521         }
5522         bitField0_ |= 0x00000001;
5523         onChanged();
5524         return this;
5525       }
5526       /**
5527        *
5528        *
5529        * <pre>
5530        * Required. The facet key specification.
5531        * </pre>
5532        *
5533        * <code>
5534        * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
5535        * </code>
5536        */
clearFacetKey()5537       public Builder clearFacetKey() {
5538         bitField0_ = (bitField0_ & ~0x00000001);
5539         facetKey_ = null;
5540         if (facetKeyBuilder_ != null) {
5541           facetKeyBuilder_.dispose();
5542           facetKeyBuilder_ = null;
5543         }
5544         onChanged();
5545         return this;
5546       }
5547       /**
5548        *
5549        *
5550        * <pre>
5551        * Required. The facet key specification.
5552        * </pre>
5553        *
5554        * <code>
5555        * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
5556        * </code>
5557        */
5558       public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder
getFacetKeyBuilder()5559           getFacetKeyBuilder() {
5560         bitField0_ |= 0x00000001;
5561         onChanged();
5562         return getFacetKeyFieldBuilder().getBuilder();
5563       }
5564       /**
5565        *
5566        *
5567        * <pre>
5568        * Required. The facet key specification.
5569        * </pre>
5570        *
5571        * <code>
5572        * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
5573        * </code>
5574        */
5575       public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder
getFacetKeyOrBuilder()5576           getFacetKeyOrBuilder() {
5577         if (facetKeyBuilder_ != null) {
5578           return facetKeyBuilder_.getMessageOrBuilder();
5579         } else {
5580           return facetKey_ == null
5581               ? com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance()
5582               : facetKey_;
5583         }
5584       }
5585       /**
5586        *
5587        *
5588        * <pre>
5589        * Required. The facet key specification.
5590        * </pre>
5591        *
5592        * <code>
5593        * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
5594        * </code>
5595        */
5596       private com.google.protobuf.SingleFieldBuilderV3<
5597               com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey,
5598               com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder,
5599               com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder>
getFacetKeyFieldBuilder()5600           getFacetKeyFieldBuilder() {
5601         if (facetKeyBuilder_ == null) {
5602           facetKeyBuilder_ =
5603               new com.google.protobuf.SingleFieldBuilderV3<
5604                   com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey,
5605                   com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder,
5606                   com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder>(
5607                   getFacetKey(), getParentForChildren(), isClean());
5608           facetKey_ = null;
5609         }
5610         return facetKeyBuilder_;
5611       }
5612 
5613       private int limit_;
5614       /**
5615        *
5616        *
5617        * <pre>
5618        * Maximum of facet values that should be returned for this facet. If
5619        * unspecified, defaults to 50. The maximum allowed value is 300. Values
5620        * above 300 will be coerced to 300.
5621        * If this field is negative, an INVALID_ARGUMENT is returned.
5622        * </pre>
5623        *
5624        * <code>int32 limit = 2;</code>
5625        *
5626        * @return The limit.
5627        */
5628       @java.lang.Override
getLimit()5629       public int getLimit() {
5630         return limit_;
5631       }
5632       /**
5633        *
5634        *
5635        * <pre>
5636        * Maximum of facet values that should be returned for this facet. If
5637        * unspecified, defaults to 50. The maximum allowed value is 300. Values
5638        * above 300 will be coerced to 300.
5639        * If this field is negative, an INVALID_ARGUMENT is returned.
5640        * </pre>
5641        *
5642        * <code>int32 limit = 2;</code>
5643        *
5644        * @param value The limit to set.
5645        * @return This builder for chaining.
5646        */
setLimit(int value)5647       public Builder setLimit(int value) {
5648 
5649         limit_ = value;
5650         bitField0_ |= 0x00000002;
5651         onChanged();
5652         return this;
5653       }
5654       /**
5655        *
5656        *
5657        * <pre>
5658        * Maximum of facet values that should be returned for this facet. If
5659        * unspecified, defaults to 50. The maximum allowed value is 300. Values
5660        * above 300 will be coerced to 300.
5661        * If this field is negative, an INVALID_ARGUMENT is returned.
5662        * </pre>
5663        *
5664        * <code>int32 limit = 2;</code>
5665        *
5666        * @return This builder for chaining.
5667        */
clearLimit()5668       public Builder clearLimit() {
5669         bitField0_ = (bitField0_ & ~0x00000002);
5670         limit_ = 0;
5671         onChanged();
5672         return this;
5673       }
5674 
5675       private com.google.protobuf.LazyStringList excludedFilterKeys_ =
5676           com.google.protobuf.LazyStringArrayList.EMPTY;
5677 
ensureExcludedFilterKeysIsMutable()5678       private void ensureExcludedFilterKeysIsMutable() {
5679         if (!((bitField0_ & 0x00000004) != 0)) {
5680           excludedFilterKeys_ = new com.google.protobuf.LazyStringArrayList(excludedFilterKeys_);
5681           bitField0_ |= 0x00000004;
5682         }
5683       }
5684       /**
5685        *
5686        *
5687        * <pre>
5688        * List of keys to exclude when faceting.
5689        * By default,
5690        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5691        * is not excluded from the filter unless it is listed in this field.
5692        * Listing a facet key in this field allows its values to appear as facet
5693        * results, even when they are filtered out of search results. Using this
5694        * field does not affect what search results are returned.
5695        * For example, suppose there are 100 products with the color facet "Red"
5696        * and 200 products with the color facet "Blue". A query containing the
5697        * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
5698        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5699        * would by default return only "Red" products in the search results, and
5700        * also return "Red" with count 100 as the only color facet. Although there
5701        * are also blue products available, "Blue" would not be shown as an
5702        * available facet value.
5703        * If "colorFamilies" is listed in "excludedFilterKeys", then the query
5704        * returns the facet values "Red" with count 100 and "Blue" with count
5705        * 200, because the "colorFamilies" key is now excluded from the filter.
5706        * Because this field doesn't affect search results, the search results
5707        * are still correctly filtered to return only "Red" products.
5708        * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
5709        * is returned.
5710        * </pre>
5711        *
5712        * <code>repeated string excluded_filter_keys = 3;</code>
5713        *
5714        * @return A list containing the excludedFilterKeys.
5715        */
getExcludedFilterKeysList()5716       public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() {
5717         return excludedFilterKeys_.getUnmodifiableView();
5718       }
5719       /**
5720        *
5721        *
5722        * <pre>
5723        * List of keys to exclude when faceting.
5724        * By default,
5725        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5726        * is not excluded from the filter unless it is listed in this field.
5727        * Listing a facet key in this field allows its values to appear as facet
5728        * results, even when they are filtered out of search results. Using this
5729        * field does not affect what search results are returned.
5730        * For example, suppose there are 100 products with the color facet "Red"
5731        * and 200 products with the color facet "Blue". A query containing the
5732        * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
5733        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5734        * would by default return only "Red" products in the search results, and
5735        * also return "Red" with count 100 as the only color facet. Although there
5736        * are also blue products available, "Blue" would not be shown as an
5737        * available facet value.
5738        * If "colorFamilies" is listed in "excludedFilterKeys", then the query
5739        * returns the facet values "Red" with count 100 and "Blue" with count
5740        * 200, because the "colorFamilies" key is now excluded from the filter.
5741        * Because this field doesn't affect search results, the search results
5742        * are still correctly filtered to return only "Red" products.
5743        * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
5744        * is returned.
5745        * </pre>
5746        *
5747        * <code>repeated string excluded_filter_keys = 3;</code>
5748        *
5749        * @return The count of excludedFilterKeys.
5750        */
getExcludedFilterKeysCount()5751       public int getExcludedFilterKeysCount() {
5752         return excludedFilterKeys_.size();
5753       }
5754       /**
5755        *
5756        *
5757        * <pre>
5758        * List of keys to exclude when faceting.
5759        * By default,
5760        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5761        * is not excluded from the filter unless it is listed in this field.
5762        * Listing a facet key in this field allows its values to appear as facet
5763        * results, even when they are filtered out of search results. Using this
5764        * field does not affect what search results are returned.
5765        * For example, suppose there are 100 products with the color facet "Red"
5766        * and 200 products with the color facet "Blue". A query containing the
5767        * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
5768        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5769        * would by default return only "Red" products in the search results, and
5770        * also return "Red" with count 100 as the only color facet. Although there
5771        * are also blue products available, "Blue" would not be shown as an
5772        * available facet value.
5773        * If "colorFamilies" is listed in "excludedFilterKeys", then the query
5774        * returns the facet values "Red" with count 100 and "Blue" with count
5775        * 200, because the "colorFamilies" key is now excluded from the filter.
5776        * Because this field doesn't affect search results, the search results
5777        * are still correctly filtered to return only "Red" products.
5778        * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
5779        * is returned.
5780        * </pre>
5781        *
5782        * <code>repeated string excluded_filter_keys = 3;</code>
5783        *
5784        * @param index The index of the element to return.
5785        * @return The excludedFilterKeys at the given index.
5786        */
getExcludedFilterKeys(int index)5787       public java.lang.String getExcludedFilterKeys(int index) {
5788         return excludedFilterKeys_.get(index);
5789       }
5790       /**
5791        *
5792        *
5793        * <pre>
5794        * List of keys to exclude when faceting.
5795        * By default,
5796        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5797        * is not excluded from the filter unless it is listed in this field.
5798        * Listing a facet key in this field allows its values to appear as facet
5799        * results, even when they are filtered out of search results. Using this
5800        * field does not affect what search results are returned.
5801        * For example, suppose there are 100 products with the color facet "Red"
5802        * and 200 products with the color facet "Blue". A query containing the
5803        * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
5804        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5805        * would by default return only "Red" products in the search results, and
5806        * also return "Red" with count 100 as the only color facet. Although there
5807        * are also blue products available, "Blue" would not be shown as an
5808        * available facet value.
5809        * If "colorFamilies" is listed in "excludedFilterKeys", then the query
5810        * returns the facet values "Red" with count 100 and "Blue" with count
5811        * 200, because the "colorFamilies" key is now excluded from the filter.
5812        * Because this field doesn't affect search results, the search results
5813        * are still correctly filtered to return only "Red" products.
5814        * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
5815        * is returned.
5816        * </pre>
5817        *
5818        * <code>repeated string excluded_filter_keys = 3;</code>
5819        *
5820        * @param index The index of the value to return.
5821        * @return The bytes of the excludedFilterKeys at the given index.
5822        */
getExcludedFilterKeysBytes(int index)5823       public com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index) {
5824         return excludedFilterKeys_.getByteString(index);
5825       }
5826       /**
5827        *
5828        *
5829        * <pre>
5830        * List of keys to exclude when faceting.
5831        * By default,
5832        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5833        * is not excluded from the filter unless it is listed in this field.
5834        * Listing a facet key in this field allows its values to appear as facet
5835        * results, even when they are filtered out of search results. Using this
5836        * field does not affect what search results are returned.
5837        * For example, suppose there are 100 products with the color facet "Red"
5838        * and 200 products with the color facet "Blue". A query containing the
5839        * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
5840        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5841        * would by default return only "Red" products in the search results, and
5842        * also return "Red" with count 100 as the only color facet. Although there
5843        * are also blue products available, "Blue" would not be shown as an
5844        * available facet value.
5845        * If "colorFamilies" is listed in "excludedFilterKeys", then the query
5846        * returns the facet values "Red" with count 100 and "Blue" with count
5847        * 200, because the "colorFamilies" key is now excluded from the filter.
5848        * Because this field doesn't affect search results, the search results
5849        * are still correctly filtered to return only "Red" products.
5850        * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
5851        * is returned.
5852        * </pre>
5853        *
5854        * <code>repeated string excluded_filter_keys = 3;</code>
5855        *
5856        * @param index The index to set the value at.
5857        * @param value The excludedFilterKeys to set.
5858        * @return This builder for chaining.
5859        */
setExcludedFilterKeys(int index, java.lang.String value)5860       public Builder setExcludedFilterKeys(int index, java.lang.String value) {
5861         if (value == null) {
5862           throw new NullPointerException();
5863         }
5864         ensureExcludedFilterKeysIsMutable();
5865         excludedFilterKeys_.set(index, value);
5866         onChanged();
5867         return this;
5868       }
5869       /**
5870        *
5871        *
5872        * <pre>
5873        * List of keys to exclude when faceting.
5874        * By default,
5875        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5876        * is not excluded from the filter unless it is listed in this field.
5877        * Listing a facet key in this field allows its values to appear as facet
5878        * results, even when they are filtered out of search results. Using this
5879        * field does not affect what search results are returned.
5880        * For example, suppose there are 100 products with the color facet "Red"
5881        * and 200 products with the color facet "Blue". A query containing the
5882        * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
5883        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5884        * would by default return only "Red" products in the search results, and
5885        * also return "Red" with count 100 as the only color facet. Although there
5886        * are also blue products available, "Blue" would not be shown as an
5887        * available facet value.
5888        * If "colorFamilies" is listed in "excludedFilterKeys", then the query
5889        * returns the facet values "Red" with count 100 and "Blue" with count
5890        * 200, because the "colorFamilies" key is now excluded from the filter.
5891        * Because this field doesn't affect search results, the search results
5892        * are still correctly filtered to return only "Red" products.
5893        * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
5894        * is returned.
5895        * </pre>
5896        *
5897        * <code>repeated string excluded_filter_keys = 3;</code>
5898        *
5899        * @param value The excludedFilterKeys to add.
5900        * @return This builder for chaining.
5901        */
addExcludedFilterKeys(java.lang.String value)5902       public Builder addExcludedFilterKeys(java.lang.String value) {
5903         if (value == null) {
5904           throw new NullPointerException();
5905         }
5906         ensureExcludedFilterKeysIsMutable();
5907         excludedFilterKeys_.add(value);
5908         onChanged();
5909         return this;
5910       }
5911       /**
5912        *
5913        *
5914        * <pre>
5915        * List of keys to exclude when faceting.
5916        * By default,
5917        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5918        * is not excluded from the filter unless it is listed in this field.
5919        * Listing a facet key in this field allows its values to appear as facet
5920        * results, even when they are filtered out of search results. Using this
5921        * field does not affect what search results are returned.
5922        * For example, suppose there are 100 products with the color facet "Red"
5923        * and 200 products with the color facet "Blue". A query containing the
5924        * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
5925        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5926        * would by default return only "Red" products in the search results, and
5927        * also return "Red" with count 100 as the only color facet. Although there
5928        * are also blue products available, "Blue" would not be shown as an
5929        * available facet value.
5930        * If "colorFamilies" is listed in "excludedFilterKeys", then the query
5931        * returns the facet values "Red" with count 100 and "Blue" with count
5932        * 200, because the "colorFamilies" key is now excluded from the filter.
5933        * Because this field doesn't affect search results, the search results
5934        * are still correctly filtered to return only "Red" products.
5935        * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
5936        * is returned.
5937        * </pre>
5938        *
5939        * <code>repeated string excluded_filter_keys = 3;</code>
5940        *
5941        * @param values The excludedFilterKeys to add.
5942        * @return This builder for chaining.
5943        */
addAllExcludedFilterKeys(java.lang.Iterable<java.lang.String> values)5944       public Builder addAllExcludedFilterKeys(java.lang.Iterable<java.lang.String> values) {
5945         ensureExcludedFilterKeysIsMutable();
5946         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, excludedFilterKeys_);
5947         onChanged();
5948         return this;
5949       }
5950       /**
5951        *
5952        *
5953        * <pre>
5954        * List of keys to exclude when faceting.
5955        * By default,
5956        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5957        * is not excluded from the filter unless it is listed in this field.
5958        * Listing a facet key in this field allows its values to appear as facet
5959        * results, even when they are filtered out of search results. Using this
5960        * field does not affect what search results are returned.
5961        * For example, suppose there are 100 products with the color facet "Red"
5962        * and 200 products with the color facet "Blue". A query containing the
5963        * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
5964        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5965        * would by default return only "Red" products in the search results, and
5966        * also return "Red" with count 100 as the only color facet. Although there
5967        * are also blue products available, "Blue" would not be shown as an
5968        * available facet value.
5969        * If "colorFamilies" is listed in "excludedFilterKeys", then the query
5970        * returns the facet values "Red" with count 100 and "Blue" with count
5971        * 200, because the "colorFamilies" key is now excluded from the filter.
5972        * Because this field doesn't affect search results, the search results
5973        * are still correctly filtered to return only "Red" products.
5974        * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
5975        * is returned.
5976        * </pre>
5977        *
5978        * <code>repeated string excluded_filter_keys = 3;</code>
5979        *
5980        * @return This builder for chaining.
5981        */
clearExcludedFilterKeys()5982       public Builder clearExcludedFilterKeys() {
5983         excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
5984         bitField0_ = (bitField0_ & ~0x00000004);
5985         onChanged();
5986         return this;
5987       }
5988       /**
5989        *
5990        *
5991        * <pre>
5992        * List of keys to exclude when faceting.
5993        * By default,
5994        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
5995        * is not excluded from the filter unless it is listed in this field.
5996        * Listing a facet key in this field allows its values to appear as facet
5997        * results, even when they are filtered out of search results. Using this
5998        * field does not affect what search results are returned.
5999        * For example, suppose there are 100 products with the color facet "Red"
6000        * and 200 products with the color facet "Blue". A query containing the
6001        * filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
6002        * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
6003        * would by default return only "Red" products in the search results, and
6004        * also return "Red" with count 100 as the only color facet. Although there
6005        * are also blue products available, "Blue" would not be shown as an
6006        * available facet value.
6007        * If "colorFamilies" is listed in "excludedFilterKeys", then the query
6008        * returns the facet values "Red" with count 100 and "Blue" with count
6009        * 200, because the "colorFamilies" key is now excluded from the filter.
6010        * Because this field doesn't affect search results, the search results
6011        * are still correctly filtered to return only "Red" products.
6012        * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
6013        * is returned.
6014        * </pre>
6015        *
6016        * <code>repeated string excluded_filter_keys = 3;</code>
6017        *
6018        * @param value The bytes of the excludedFilterKeys to add.
6019        * @return This builder for chaining.
6020        */
addExcludedFilterKeysBytes(com.google.protobuf.ByteString value)6021       public Builder addExcludedFilterKeysBytes(com.google.protobuf.ByteString value) {
6022         if (value == null) {
6023           throw new NullPointerException();
6024         }
6025         checkByteStringIsUtf8(value);
6026         ensureExcludedFilterKeysIsMutable();
6027         excludedFilterKeys_.add(value);
6028         onChanged();
6029         return this;
6030       }
6031 
6032       private boolean enableDynamicPosition_;
6033       /**
6034        *
6035        *
6036        * <pre>
6037        * Enables dynamic position for this facet. If set to true, the position of
6038        * this facet among all facets in the response is determined by Google
6039        * Retail Search. It will be ordered together with dynamic facets if dynamic
6040        * facets is enabled. If set to false, the position of this facet in the
6041        * response will be the same as in the request, and it will be ranked before
6042        * the facets with dynamic position enable and all dynamic facets.
6043        * For example, you may always want to have rating facet returned in
6044        * the response, but it's not necessarily to always display the rating facet
6045        * at the top. In that case, you can set enable_dynamic_position to true so
6046        * that the position of rating facet in response will be determined by
6047        * Google Retail Search.
6048        * Another example, assuming you have the following facets in the request:
6049        * * "rating", enable_dynamic_position = true
6050        * * "price", enable_dynamic_position = false
6051        * * "brands", enable_dynamic_position = false
6052        * And also you have a dynamic facets enable, which will generate a facet
6053        * 'gender'. Then the final order of the facets in the response can be
6054        * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
6055        * "rating") depends on how Google Retail Search orders "gender" and
6056        * "rating" facets. However, notice that "price" and "brands" will always be
6057        * ranked at 1st and 2nd position since their enable_dynamic_position are
6058        * false.
6059        * </pre>
6060        *
6061        * <code>bool enable_dynamic_position = 4;</code>
6062        *
6063        * @return The enableDynamicPosition.
6064        */
6065       @java.lang.Override
getEnableDynamicPosition()6066       public boolean getEnableDynamicPosition() {
6067         return enableDynamicPosition_;
6068       }
6069       /**
6070        *
6071        *
6072        * <pre>
6073        * Enables dynamic position for this facet. If set to true, the position of
6074        * this facet among all facets in the response is determined by Google
6075        * Retail Search. It will be ordered together with dynamic facets if dynamic
6076        * facets is enabled. If set to false, the position of this facet in the
6077        * response will be the same as in the request, and it will be ranked before
6078        * the facets with dynamic position enable and all dynamic facets.
6079        * For example, you may always want to have rating facet returned in
6080        * the response, but it's not necessarily to always display the rating facet
6081        * at the top. In that case, you can set enable_dynamic_position to true so
6082        * that the position of rating facet in response will be determined by
6083        * Google Retail Search.
6084        * Another example, assuming you have the following facets in the request:
6085        * * "rating", enable_dynamic_position = true
6086        * * "price", enable_dynamic_position = false
6087        * * "brands", enable_dynamic_position = false
6088        * And also you have a dynamic facets enable, which will generate a facet
6089        * 'gender'. Then the final order of the facets in the response can be
6090        * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
6091        * "rating") depends on how Google Retail Search orders "gender" and
6092        * "rating" facets. However, notice that "price" and "brands" will always be
6093        * ranked at 1st and 2nd position since their enable_dynamic_position are
6094        * false.
6095        * </pre>
6096        *
6097        * <code>bool enable_dynamic_position = 4;</code>
6098        *
6099        * @param value The enableDynamicPosition to set.
6100        * @return This builder for chaining.
6101        */
setEnableDynamicPosition(boolean value)6102       public Builder setEnableDynamicPosition(boolean value) {
6103 
6104         enableDynamicPosition_ = value;
6105         bitField0_ |= 0x00000008;
6106         onChanged();
6107         return this;
6108       }
6109       /**
6110        *
6111        *
6112        * <pre>
6113        * Enables dynamic position for this facet. If set to true, the position of
6114        * this facet among all facets in the response is determined by Google
6115        * Retail Search. It will be ordered together with dynamic facets if dynamic
6116        * facets is enabled. If set to false, the position of this facet in the
6117        * response will be the same as in the request, and it will be ranked before
6118        * the facets with dynamic position enable and all dynamic facets.
6119        * For example, you may always want to have rating facet returned in
6120        * the response, but it's not necessarily to always display the rating facet
6121        * at the top. In that case, you can set enable_dynamic_position to true so
6122        * that the position of rating facet in response will be determined by
6123        * Google Retail Search.
6124        * Another example, assuming you have the following facets in the request:
6125        * * "rating", enable_dynamic_position = true
6126        * * "price", enable_dynamic_position = false
6127        * * "brands", enable_dynamic_position = false
6128        * And also you have a dynamic facets enable, which will generate a facet
6129        * 'gender'. Then the final order of the facets in the response can be
6130        * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
6131        * "rating") depends on how Google Retail Search orders "gender" and
6132        * "rating" facets. However, notice that "price" and "brands" will always be
6133        * ranked at 1st and 2nd position since their enable_dynamic_position are
6134        * false.
6135        * </pre>
6136        *
6137        * <code>bool enable_dynamic_position = 4;</code>
6138        *
6139        * @return This builder for chaining.
6140        */
clearEnableDynamicPosition()6141       public Builder clearEnableDynamicPosition() {
6142         bitField0_ = (bitField0_ & ~0x00000008);
6143         enableDynamicPosition_ = false;
6144         onChanged();
6145         return this;
6146       }
6147 
6148       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)6149       public final Builder setUnknownFields(
6150           final com.google.protobuf.UnknownFieldSet unknownFields) {
6151         return super.setUnknownFields(unknownFields);
6152       }
6153 
6154       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)6155       public final Builder mergeUnknownFields(
6156           final com.google.protobuf.UnknownFieldSet unknownFields) {
6157         return super.mergeUnknownFields(unknownFields);
6158       }
6159 
6160       // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.FacetSpec)
6161     }
6162 
6163     // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.FacetSpec)
6164     private static final com.google.cloud.retail.v2.SearchRequest.FacetSpec DEFAULT_INSTANCE;
6165 
6166     static {
6167       DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.FacetSpec();
6168     }
6169 
getDefaultInstance()6170     public static com.google.cloud.retail.v2.SearchRequest.FacetSpec getDefaultInstance() {
6171       return DEFAULT_INSTANCE;
6172     }
6173 
6174     private static final com.google.protobuf.Parser<FacetSpec> PARSER =
6175         new com.google.protobuf.AbstractParser<FacetSpec>() {
6176           @java.lang.Override
6177           public FacetSpec parsePartialFrom(
6178               com.google.protobuf.CodedInputStream input,
6179               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
6180               throws com.google.protobuf.InvalidProtocolBufferException {
6181             Builder builder = newBuilder();
6182             try {
6183               builder.mergeFrom(input, extensionRegistry);
6184             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
6185               throw e.setUnfinishedMessage(builder.buildPartial());
6186             } catch (com.google.protobuf.UninitializedMessageException e) {
6187               throw e.asInvalidProtocolBufferException()
6188                   .setUnfinishedMessage(builder.buildPartial());
6189             } catch (java.io.IOException e) {
6190               throw new com.google.protobuf.InvalidProtocolBufferException(e)
6191                   .setUnfinishedMessage(builder.buildPartial());
6192             }
6193             return builder.buildPartial();
6194           }
6195         };
6196 
parser()6197     public static com.google.protobuf.Parser<FacetSpec> parser() {
6198       return PARSER;
6199     }
6200 
6201     @java.lang.Override
getParserForType()6202     public com.google.protobuf.Parser<FacetSpec> getParserForType() {
6203       return PARSER;
6204     }
6205 
6206     @java.lang.Override
getDefaultInstanceForType()6207     public com.google.cloud.retail.v2.SearchRequest.FacetSpec getDefaultInstanceForType() {
6208       return DEFAULT_INSTANCE;
6209     }
6210   }
6211 
6212   public interface DynamicFacetSpecOrBuilder
6213       extends
6214       // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec)
6215       com.google.protobuf.MessageOrBuilder {
6216 
6217     /**
6218      *
6219      *
6220      * <pre>
6221      * Mode of the DynamicFacet feature.
6222      * Defaults to
6223      * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
6224      * if it's unset.
6225      * </pre>
6226      *
6227      * <code>.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1;</code>
6228      *
6229      * @return The enum numeric value on the wire for mode.
6230      */
getModeValue()6231     int getModeValue();
6232     /**
6233      *
6234      *
6235      * <pre>
6236      * Mode of the DynamicFacet feature.
6237      * Defaults to
6238      * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
6239      * if it's unset.
6240      * </pre>
6241      *
6242      * <code>.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1;</code>
6243      *
6244      * @return The mode.
6245      */
getMode()6246     com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode getMode();
6247   }
6248   /**
6249    *
6250    *
6251    * <pre>
6252    * The specifications of dynamically generated facets.
6253    * </pre>
6254    *
6255    * Protobuf type {@code google.cloud.retail.v2.SearchRequest.DynamicFacetSpec}
6256    */
6257   public static final class DynamicFacetSpec extends com.google.protobuf.GeneratedMessageV3
6258       implements
6259       // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec)
6260       DynamicFacetSpecOrBuilder {
6261     private static final long serialVersionUID = 0L;
6262     // Use DynamicFacetSpec.newBuilder() to construct.
DynamicFacetSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)6263     private DynamicFacetSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
6264       super(builder);
6265     }
6266 
DynamicFacetSpec()6267     private DynamicFacetSpec() {
6268       mode_ = 0;
6269     }
6270 
6271     @java.lang.Override
6272     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)6273     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
6274       return new DynamicFacetSpec();
6275     }
6276 
6277     @java.lang.Override
getUnknownFields()6278     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
6279       return this.unknownFields;
6280     }
6281 
getDescriptor()6282     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
6283       return com.google.cloud.retail.v2.SearchServiceProto
6284           .internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_descriptor;
6285     }
6286 
6287     @java.lang.Override
6288     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()6289         internalGetFieldAccessorTable() {
6290       return com.google.cloud.retail.v2.SearchServiceProto
6291           .internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_fieldAccessorTable
6292           .ensureFieldAccessorsInitialized(
6293               com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.class,
6294               com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder.class);
6295     }
6296 
6297     /**
6298      *
6299      *
6300      * <pre>
6301      * Enum to control DynamicFacet mode
6302      * </pre>
6303      *
6304      * Protobuf enum {@code google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode}
6305      */
6306     public enum Mode implements com.google.protobuf.ProtocolMessageEnum {
6307       /**
6308        *
6309        *
6310        * <pre>
6311        * Default value.
6312        * </pre>
6313        *
6314        * <code>MODE_UNSPECIFIED = 0;</code>
6315        */
6316       MODE_UNSPECIFIED(0),
6317       /**
6318        *
6319        *
6320        * <pre>
6321        * Disable Dynamic Facet.
6322        * </pre>
6323        *
6324        * <code>DISABLED = 1;</code>
6325        */
6326       DISABLED(1),
6327       /**
6328        *
6329        *
6330        * <pre>
6331        * Automatic mode built by Google Retail Search.
6332        * </pre>
6333        *
6334        * <code>ENABLED = 2;</code>
6335        */
6336       ENABLED(2),
6337       UNRECOGNIZED(-1),
6338       ;
6339 
6340       /**
6341        *
6342        *
6343        * <pre>
6344        * Default value.
6345        * </pre>
6346        *
6347        * <code>MODE_UNSPECIFIED = 0;</code>
6348        */
6349       public static final int MODE_UNSPECIFIED_VALUE = 0;
6350       /**
6351        *
6352        *
6353        * <pre>
6354        * Disable Dynamic Facet.
6355        * </pre>
6356        *
6357        * <code>DISABLED = 1;</code>
6358        */
6359       public static final int DISABLED_VALUE = 1;
6360       /**
6361        *
6362        *
6363        * <pre>
6364        * Automatic mode built by Google Retail Search.
6365        * </pre>
6366        *
6367        * <code>ENABLED = 2;</code>
6368        */
6369       public static final int ENABLED_VALUE = 2;
6370 
getNumber()6371       public final int getNumber() {
6372         if (this == UNRECOGNIZED) {
6373           throw new java.lang.IllegalArgumentException(
6374               "Can't get the number of an unknown enum value.");
6375         }
6376         return value;
6377       }
6378 
6379       /**
6380        * @param value The numeric wire value of the corresponding enum entry.
6381        * @return The enum associated with the given numeric wire value.
6382        * @deprecated Use {@link #forNumber(int)} instead.
6383        */
6384       @java.lang.Deprecated
valueOf(int value)6385       public static Mode valueOf(int value) {
6386         return forNumber(value);
6387       }
6388 
6389       /**
6390        * @param value The numeric wire value of the corresponding enum entry.
6391        * @return The enum associated with the given numeric wire value.
6392        */
forNumber(int value)6393       public static Mode forNumber(int value) {
6394         switch (value) {
6395           case 0:
6396             return MODE_UNSPECIFIED;
6397           case 1:
6398             return DISABLED;
6399           case 2:
6400             return ENABLED;
6401           default:
6402             return null;
6403         }
6404       }
6405 
internalGetValueMap()6406       public static com.google.protobuf.Internal.EnumLiteMap<Mode> internalGetValueMap() {
6407         return internalValueMap;
6408       }
6409 
6410       private static final com.google.protobuf.Internal.EnumLiteMap<Mode> internalValueMap =
6411           new com.google.protobuf.Internal.EnumLiteMap<Mode>() {
6412             public Mode findValueByNumber(int number) {
6413               return Mode.forNumber(number);
6414             }
6415           };
6416 
getValueDescriptor()6417       public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
6418         if (this == UNRECOGNIZED) {
6419           throw new java.lang.IllegalStateException(
6420               "Can't get the descriptor of an unrecognized enum value.");
6421         }
6422         return getDescriptor().getValues().get(ordinal());
6423       }
6424 
getDescriptorForType()6425       public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
6426         return getDescriptor();
6427       }
6428 
getDescriptor()6429       public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
6430         return com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDescriptor()
6431             .getEnumTypes()
6432             .get(0);
6433       }
6434 
6435       private static final Mode[] VALUES = values();
6436 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)6437       public static Mode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
6438         if (desc.getType() != getDescriptor()) {
6439           throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
6440         }
6441         if (desc.getIndex() == -1) {
6442           return UNRECOGNIZED;
6443         }
6444         return VALUES[desc.getIndex()];
6445       }
6446 
6447       private final int value;
6448 
Mode(int value)6449       private Mode(int value) {
6450         this.value = value;
6451       }
6452 
6453       // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode)
6454     }
6455 
6456     public static final int MODE_FIELD_NUMBER = 1;
6457     private int mode_ = 0;
6458     /**
6459      *
6460      *
6461      * <pre>
6462      * Mode of the DynamicFacet feature.
6463      * Defaults to
6464      * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
6465      * if it's unset.
6466      * </pre>
6467      *
6468      * <code>.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1;</code>
6469      *
6470      * @return The enum numeric value on the wire for mode.
6471      */
6472     @java.lang.Override
getModeValue()6473     public int getModeValue() {
6474       return mode_;
6475     }
6476     /**
6477      *
6478      *
6479      * <pre>
6480      * Mode of the DynamicFacet feature.
6481      * Defaults to
6482      * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
6483      * if it's unset.
6484      * </pre>
6485      *
6486      * <code>.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1;</code>
6487      *
6488      * @return The mode.
6489      */
6490     @java.lang.Override
getMode()6491     public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode getMode() {
6492       com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode result =
6493           com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.forNumber(mode_);
6494       return result == null
6495           ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.UNRECOGNIZED
6496           : result;
6497     }
6498 
6499     private byte memoizedIsInitialized = -1;
6500 
6501     @java.lang.Override
isInitialized()6502     public final boolean isInitialized() {
6503       byte isInitialized = memoizedIsInitialized;
6504       if (isInitialized == 1) return true;
6505       if (isInitialized == 0) return false;
6506 
6507       memoizedIsInitialized = 1;
6508       return true;
6509     }
6510 
6511     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)6512     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
6513       if (mode_
6514           != com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.MODE_UNSPECIFIED
6515               .getNumber()) {
6516         output.writeEnum(1, mode_);
6517       }
6518       getUnknownFields().writeTo(output);
6519     }
6520 
6521     @java.lang.Override
getSerializedSize()6522     public int getSerializedSize() {
6523       int size = memoizedSize;
6524       if (size != -1) return size;
6525 
6526       size = 0;
6527       if (mode_
6528           != com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.MODE_UNSPECIFIED
6529               .getNumber()) {
6530         size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_);
6531       }
6532       size += getUnknownFields().getSerializedSize();
6533       memoizedSize = size;
6534       return size;
6535     }
6536 
6537     @java.lang.Override
equals(final java.lang.Object obj)6538     public boolean equals(final java.lang.Object obj) {
6539       if (obj == this) {
6540         return true;
6541       }
6542       if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec)) {
6543         return super.equals(obj);
6544       }
6545       com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec other =
6546           (com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) obj;
6547 
6548       if (mode_ != other.mode_) return false;
6549       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
6550       return true;
6551     }
6552 
6553     @java.lang.Override
hashCode()6554     public int hashCode() {
6555       if (memoizedHashCode != 0) {
6556         return memoizedHashCode;
6557       }
6558       int hash = 41;
6559       hash = (19 * hash) + getDescriptor().hashCode();
6560       hash = (37 * hash) + MODE_FIELD_NUMBER;
6561       hash = (53 * hash) + mode_;
6562       hash = (29 * hash) + getUnknownFields().hashCode();
6563       memoizedHashCode = hash;
6564       return hash;
6565     }
6566 
parseFrom( java.nio.ByteBuffer data)6567     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(
6568         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
6569       return PARSER.parseFrom(data);
6570     }
6571 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6572     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(
6573         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
6574         throws com.google.protobuf.InvalidProtocolBufferException {
6575       return PARSER.parseFrom(data, extensionRegistry);
6576     }
6577 
parseFrom( com.google.protobuf.ByteString data)6578     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(
6579         com.google.protobuf.ByteString data)
6580         throws com.google.protobuf.InvalidProtocolBufferException {
6581       return PARSER.parseFrom(data);
6582     }
6583 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6584     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(
6585         com.google.protobuf.ByteString data,
6586         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
6587         throws com.google.protobuf.InvalidProtocolBufferException {
6588       return PARSER.parseFrom(data, extensionRegistry);
6589     }
6590 
parseFrom(byte[] data)6591     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(byte[] data)
6592         throws com.google.protobuf.InvalidProtocolBufferException {
6593       return PARSER.parseFrom(data);
6594     }
6595 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6596     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(
6597         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
6598         throws com.google.protobuf.InvalidProtocolBufferException {
6599       return PARSER.parseFrom(data, extensionRegistry);
6600     }
6601 
parseFrom( java.io.InputStream input)6602     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(
6603         java.io.InputStream input) throws java.io.IOException {
6604       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
6605     }
6606 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6607     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(
6608         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
6609         throws java.io.IOException {
6610       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
6611           PARSER, input, extensionRegistry);
6612     }
6613 
parseDelimitedFrom( java.io.InputStream input)6614     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseDelimitedFrom(
6615         java.io.InputStream input) throws java.io.IOException {
6616       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
6617     }
6618 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6619     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseDelimitedFrom(
6620         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
6621         throws java.io.IOException {
6622       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
6623           PARSER, input, extensionRegistry);
6624     }
6625 
parseFrom( com.google.protobuf.CodedInputStream input)6626     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(
6627         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
6628       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
6629     }
6630 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6631     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(
6632         com.google.protobuf.CodedInputStream input,
6633         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
6634         throws java.io.IOException {
6635       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
6636           PARSER, input, extensionRegistry);
6637     }
6638 
6639     @java.lang.Override
newBuilderForType()6640     public Builder newBuilderForType() {
6641       return newBuilder();
6642     }
6643 
newBuilder()6644     public static Builder newBuilder() {
6645       return DEFAULT_INSTANCE.toBuilder();
6646     }
6647 
newBuilder( com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec prototype)6648     public static Builder newBuilder(
6649         com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec prototype) {
6650       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
6651     }
6652 
6653     @java.lang.Override
toBuilder()6654     public Builder toBuilder() {
6655       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
6656     }
6657 
6658     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)6659     protected Builder newBuilderForType(
6660         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
6661       Builder builder = new Builder(parent);
6662       return builder;
6663     }
6664     /**
6665      *
6666      *
6667      * <pre>
6668      * The specifications of dynamically generated facets.
6669      * </pre>
6670      *
6671      * Protobuf type {@code google.cloud.retail.v2.SearchRequest.DynamicFacetSpec}
6672      */
6673     public static final class Builder
6674         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
6675         implements
6676         // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec)
6677         com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder {
getDescriptor()6678       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
6679         return com.google.cloud.retail.v2.SearchServiceProto
6680             .internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_descriptor;
6681       }
6682 
6683       @java.lang.Override
6684       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()6685           internalGetFieldAccessorTable() {
6686         return com.google.cloud.retail.v2.SearchServiceProto
6687             .internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_fieldAccessorTable
6688             .ensureFieldAccessorsInitialized(
6689                 com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.class,
6690                 com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder.class);
6691       }
6692 
6693       // Construct using com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.newBuilder()
Builder()6694       private Builder() {}
6695 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)6696       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
6697         super(parent);
6698       }
6699 
6700       @java.lang.Override
clear()6701       public Builder clear() {
6702         super.clear();
6703         bitField0_ = 0;
6704         mode_ = 0;
6705         return this;
6706       }
6707 
6708       @java.lang.Override
getDescriptorForType()6709       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
6710         return com.google.cloud.retail.v2.SearchServiceProto
6711             .internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_descriptor;
6712       }
6713 
6714       @java.lang.Override
getDefaultInstanceForType()6715       public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDefaultInstanceForType() {
6716         return com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance();
6717       }
6718 
6719       @java.lang.Override
build()6720       public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec build() {
6721         com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec result = buildPartial();
6722         if (!result.isInitialized()) {
6723           throw newUninitializedMessageException(result);
6724         }
6725         return result;
6726       }
6727 
6728       @java.lang.Override
buildPartial()6729       public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec buildPartial() {
6730         com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec result =
6731             new com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec(this);
6732         if (bitField0_ != 0) {
6733           buildPartial0(result);
6734         }
6735         onBuilt();
6736         return result;
6737       }
6738 
buildPartial0(com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec result)6739       private void buildPartial0(com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec result) {
6740         int from_bitField0_ = bitField0_;
6741         if (((from_bitField0_ & 0x00000001) != 0)) {
6742           result.mode_ = mode_;
6743         }
6744       }
6745 
6746       @java.lang.Override
clone()6747       public Builder clone() {
6748         return super.clone();
6749       }
6750 
6751       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)6752       public Builder setField(
6753           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
6754         return super.setField(field, value);
6755       }
6756 
6757       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)6758       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
6759         return super.clearField(field);
6760       }
6761 
6762       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)6763       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
6764         return super.clearOneof(oneof);
6765       }
6766 
6767       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)6768       public Builder setRepeatedField(
6769           com.google.protobuf.Descriptors.FieldDescriptor field,
6770           int index,
6771           java.lang.Object value) {
6772         return super.setRepeatedField(field, index, value);
6773       }
6774 
6775       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)6776       public Builder addRepeatedField(
6777           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
6778         return super.addRepeatedField(field, value);
6779       }
6780 
6781       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)6782       public Builder mergeFrom(com.google.protobuf.Message other) {
6783         if (other instanceof com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) {
6784           return mergeFrom((com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) other);
6785         } else {
6786           super.mergeFrom(other);
6787           return this;
6788         }
6789       }
6790 
mergeFrom(com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec other)6791       public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec other) {
6792         if (other == com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance())
6793           return this;
6794         if (other.mode_ != 0) {
6795           setModeValue(other.getModeValue());
6796         }
6797         this.mergeUnknownFields(other.getUnknownFields());
6798         onChanged();
6799         return this;
6800       }
6801 
6802       @java.lang.Override
isInitialized()6803       public final boolean isInitialized() {
6804         return true;
6805       }
6806 
6807       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6808       public Builder mergeFrom(
6809           com.google.protobuf.CodedInputStream input,
6810           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
6811           throws java.io.IOException {
6812         if (extensionRegistry == null) {
6813           throw new java.lang.NullPointerException();
6814         }
6815         try {
6816           boolean done = false;
6817           while (!done) {
6818             int tag = input.readTag();
6819             switch (tag) {
6820               case 0:
6821                 done = true;
6822                 break;
6823               case 8:
6824                 {
6825                   mode_ = input.readEnum();
6826                   bitField0_ |= 0x00000001;
6827                   break;
6828                 } // case 8
6829               default:
6830                 {
6831                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
6832                     done = true; // was an endgroup tag
6833                   }
6834                   break;
6835                 } // default:
6836             } // switch (tag)
6837           } // while (!done)
6838         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
6839           throw e.unwrapIOException();
6840         } finally {
6841           onChanged();
6842         } // finally
6843         return this;
6844       }
6845 
6846       private int bitField0_;
6847 
6848       private int mode_ = 0;
6849       /**
6850        *
6851        *
6852        * <pre>
6853        * Mode of the DynamicFacet feature.
6854        * Defaults to
6855        * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
6856        * if it's unset.
6857        * </pre>
6858        *
6859        * <code>.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1;</code>
6860        *
6861        * @return The enum numeric value on the wire for mode.
6862        */
6863       @java.lang.Override
getModeValue()6864       public int getModeValue() {
6865         return mode_;
6866       }
6867       /**
6868        *
6869        *
6870        * <pre>
6871        * Mode of the DynamicFacet feature.
6872        * Defaults to
6873        * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
6874        * if it's unset.
6875        * </pre>
6876        *
6877        * <code>.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1;</code>
6878        *
6879        * @param value The enum numeric value on the wire for mode to set.
6880        * @return This builder for chaining.
6881        */
setModeValue(int value)6882       public Builder setModeValue(int value) {
6883         mode_ = value;
6884         bitField0_ |= 0x00000001;
6885         onChanged();
6886         return this;
6887       }
6888       /**
6889        *
6890        *
6891        * <pre>
6892        * Mode of the DynamicFacet feature.
6893        * Defaults to
6894        * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
6895        * if it's unset.
6896        * </pre>
6897        *
6898        * <code>.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1;</code>
6899        *
6900        * @return The mode.
6901        */
6902       @java.lang.Override
getMode()6903       public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode getMode() {
6904         com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode result =
6905             com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.forNumber(mode_);
6906         return result == null
6907             ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.UNRECOGNIZED
6908             : result;
6909       }
6910       /**
6911        *
6912        *
6913        * <pre>
6914        * Mode of the DynamicFacet feature.
6915        * Defaults to
6916        * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
6917        * if it's unset.
6918        * </pre>
6919        *
6920        * <code>.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1;</code>
6921        *
6922        * @param value The mode to set.
6923        * @return This builder for chaining.
6924        */
setMode(com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode value)6925       public Builder setMode(com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode value) {
6926         if (value == null) {
6927           throw new NullPointerException();
6928         }
6929         bitField0_ |= 0x00000001;
6930         mode_ = value.getNumber();
6931         onChanged();
6932         return this;
6933       }
6934       /**
6935        *
6936        *
6937        * <pre>
6938        * Mode of the DynamicFacet feature.
6939        * Defaults to
6940        * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
6941        * if it's unset.
6942        * </pre>
6943        *
6944        * <code>.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1;</code>
6945        *
6946        * @return This builder for chaining.
6947        */
clearMode()6948       public Builder clearMode() {
6949         bitField0_ = (bitField0_ & ~0x00000001);
6950         mode_ = 0;
6951         onChanged();
6952         return this;
6953       }
6954 
6955       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)6956       public final Builder setUnknownFields(
6957           final com.google.protobuf.UnknownFieldSet unknownFields) {
6958         return super.setUnknownFields(unknownFields);
6959       }
6960 
6961       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)6962       public final Builder mergeUnknownFields(
6963           final com.google.protobuf.UnknownFieldSet unknownFields) {
6964         return super.mergeUnknownFields(unknownFields);
6965       }
6966 
6967       // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec)
6968     }
6969 
6970     // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec)
6971     private static final com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec DEFAULT_INSTANCE;
6972 
6973     static {
6974       DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec();
6975     }
6976 
getDefaultInstance()6977     public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDefaultInstance() {
6978       return DEFAULT_INSTANCE;
6979     }
6980 
6981     private static final com.google.protobuf.Parser<DynamicFacetSpec> PARSER =
6982         new com.google.protobuf.AbstractParser<DynamicFacetSpec>() {
6983           @java.lang.Override
6984           public DynamicFacetSpec parsePartialFrom(
6985               com.google.protobuf.CodedInputStream input,
6986               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
6987               throws com.google.protobuf.InvalidProtocolBufferException {
6988             Builder builder = newBuilder();
6989             try {
6990               builder.mergeFrom(input, extensionRegistry);
6991             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
6992               throw e.setUnfinishedMessage(builder.buildPartial());
6993             } catch (com.google.protobuf.UninitializedMessageException e) {
6994               throw e.asInvalidProtocolBufferException()
6995                   .setUnfinishedMessage(builder.buildPartial());
6996             } catch (java.io.IOException e) {
6997               throw new com.google.protobuf.InvalidProtocolBufferException(e)
6998                   .setUnfinishedMessage(builder.buildPartial());
6999             }
7000             return builder.buildPartial();
7001           }
7002         };
7003 
parser()7004     public static com.google.protobuf.Parser<DynamicFacetSpec> parser() {
7005       return PARSER;
7006     }
7007 
7008     @java.lang.Override
getParserForType()7009     public com.google.protobuf.Parser<DynamicFacetSpec> getParserForType() {
7010       return PARSER;
7011     }
7012 
7013     @java.lang.Override
getDefaultInstanceForType()7014     public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDefaultInstanceForType() {
7015       return DEFAULT_INSTANCE;
7016     }
7017   }
7018 
7019   public interface BoostSpecOrBuilder
7020       extends
7021       // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.BoostSpec)
7022       com.google.protobuf.MessageOrBuilder {
7023 
7024     /**
7025      *
7026      *
7027      * <pre>
7028      * Condition boost specifications. If a product matches multiple conditions
7029      * in the specifictions, boost scores from these specifications are all
7030      * applied and combined in a non-linear way. Maximum number of
7031      * specifications is 20.
7032      * </pre>
7033      *
7034      * <code>
7035      * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
7036      * </code>
7037      */
7038     java.util.List<com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec>
getConditionBoostSpecsList()7039         getConditionBoostSpecsList();
7040     /**
7041      *
7042      *
7043      * <pre>
7044      * Condition boost specifications. If a product matches multiple conditions
7045      * in the specifictions, boost scores from these specifications are all
7046      * applied and combined in a non-linear way. Maximum number of
7047      * specifications is 20.
7048      * </pre>
7049      *
7050      * <code>
7051      * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
7052      * </code>
7053      */
getConditionBoostSpecs( int index)7054     com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec getConditionBoostSpecs(
7055         int index);
7056     /**
7057      *
7058      *
7059      * <pre>
7060      * Condition boost specifications. If a product matches multiple conditions
7061      * in the specifictions, boost scores from these specifications are all
7062      * applied and combined in a non-linear way. Maximum number of
7063      * specifications is 20.
7064      * </pre>
7065      *
7066      * <code>
7067      * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
7068      * </code>
7069      */
getConditionBoostSpecsCount()7070     int getConditionBoostSpecsCount();
7071     /**
7072      *
7073      *
7074      * <pre>
7075      * Condition boost specifications. If a product matches multiple conditions
7076      * in the specifictions, boost scores from these specifications are all
7077      * applied and combined in a non-linear way. Maximum number of
7078      * specifications is 20.
7079      * </pre>
7080      *
7081      * <code>
7082      * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
7083      * </code>
7084      */
7085     java.util.List<
7086             ? extends
7087                 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder>
getConditionBoostSpecsOrBuilderList()7088         getConditionBoostSpecsOrBuilderList();
7089     /**
7090      *
7091      *
7092      * <pre>
7093      * Condition boost specifications. If a product matches multiple conditions
7094      * in the specifictions, boost scores from these specifications are all
7095      * applied and combined in a non-linear way. Maximum number of
7096      * specifications is 20.
7097      * </pre>
7098      *
7099      * <code>
7100      * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
7101      * </code>
7102      */
7103     com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder
getConditionBoostSpecsOrBuilder(int index)7104         getConditionBoostSpecsOrBuilder(int index);
7105 
7106     /**
7107      *
7108      *
7109      * <pre>
7110      * Whether to skip boostspec validation. If this field is set to true,
7111      * invalid
7112      * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
7113      * will be ignored and valid
7114      * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
7115      * will still be applied.
7116      * </pre>
7117      *
7118      * <code>optional bool skip_boost_spec_validation = 2;</code>
7119      *
7120      * @return Whether the skipBoostSpecValidation field is set.
7121      */
hasSkipBoostSpecValidation()7122     boolean hasSkipBoostSpecValidation();
7123     /**
7124      *
7125      *
7126      * <pre>
7127      * Whether to skip boostspec validation. If this field is set to true,
7128      * invalid
7129      * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
7130      * will be ignored and valid
7131      * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
7132      * will still be applied.
7133      * </pre>
7134      *
7135      * <code>optional bool skip_boost_spec_validation = 2;</code>
7136      *
7137      * @return The skipBoostSpecValidation.
7138      */
getSkipBoostSpecValidation()7139     boolean getSkipBoostSpecValidation();
7140   }
7141   /**
7142    *
7143    *
7144    * <pre>
7145    * Boost specification to boost certain items.
7146    * </pre>
7147    *
7148    * Protobuf type {@code google.cloud.retail.v2.SearchRequest.BoostSpec}
7149    */
7150   public static final class BoostSpec extends com.google.protobuf.GeneratedMessageV3
7151       implements
7152       // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.BoostSpec)
7153       BoostSpecOrBuilder {
7154     private static final long serialVersionUID = 0L;
7155     // Use BoostSpec.newBuilder() to construct.
BoostSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)7156     private BoostSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
7157       super(builder);
7158     }
7159 
BoostSpec()7160     private BoostSpec() {
7161       conditionBoostSpecs_ = java.util.Collections.emptyList();
7162     }
7163 
7164     @java.lang.Override
7165     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)7166     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
7167       return new BoostSpec();
7168     }
7169 
7170     @java.lang.Override
getUnknownFields()7171     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
7172       return this.unknownFields;
7173     }
7174 
getDescriptor()7175     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
7176       return com.google.cloud.retail.v2.SearchServiceProto
7177           .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_descriptor;
7178     }
7179 
7180     @java.lang.Override
7181     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()7182         internalGetFieldAccessorTable() {
7183       return com.google.cloud.retail.v2.SearchServiceProto
7184           .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_fieldAccessorTable
7185           .ensureFieldAccessorsInitialized(
7186               com.google.cloud.retail.v2.SearchRequest.BoostSpec.class,
7187               com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder.class);
7188     }
7189 
7190     public interface ConditionBoostSpecOrBuilder
7191         extends
7192         // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec)
7193         com.google.protobuf.MessageOrBuilder {
7194 
7195       /**
7196        *
7197        *
7198        * <pre>
7199        * An expression which specifies a boost condition. The syntax and
7200        * supported fields are the same as a filter expression. See
7201        * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
7202        * detail syntax and limitations.
7203        * Examples:
7204        * * To boost products with product ID "product_1" or "product_2", and
7205        * color
7206        *   "Red" or "Blue":
7207        *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
7208        *     ANY("Red","Blue"))
7209        * </pre>
7210        *
7211        * <code>string condition = 1;</code>
7212        *
7213        * @return The condition.
7214        */
getCondition()7215       java.lang.String getCondition();
7216       /**
7217        *
7218        *
7219        * <pre>
7220        * An expression which specifies a boost condition. The syntax and
7221        * supported fields are the same as a filter expression. See
7222        * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
7223        * detail syntax and limitations.
7224        * Examples:
7225        * * To boost products with product ID "product_1" or "product_2", and
7226        * color
7227        *   "Red" or "Blue":
7228        *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
7229        *     ANY("Red","Blue"))
7230        * </pre>
7231        *
7232        * <code>string condition = 1;</code>
7233        *
7234        * @return The bytes for condition.
7235        */
getConditionBytes()7236       com.google.protobuf.ByteString getConditionBytes();
7237 
7238       /**
7239        *
7240        *
7241        * <pre>
7242        * Strength of the condition boost, which should be in [-1, 1]. Negative
7243        * boost means demotion. Default is 0.0.
7244        * Setting to 1.0 gives the item a big promotion. However, it does not
7245        * necessarily mean that the boosted item will be the top result at all
7246        * times, nor that other items will be excluded. Results could still be
7247        * shown even when none of them matches the condition. And results that
7248        * are significantly more relevant to the search query can still trump
7249        * your heavily favored but irrelevant items.
7250        * Setting to -1.0 gives the item a big demotion. However, results that
7251        * are deeply relevant might still be shown. The item will have an
7252        * upstream battle to get a fairly high ranking, but it is not blocked out
7253        * completely.
7254        * Setting to 0.0 means no boost applied. The boosting condition is
7255        * ignored.
7256        * </pre>
7257        *
7258        * <code>float boost = 2;</code>
7259        *
7260        * @return The boost.
7261        */
getBoost()7262       float getBoost();
7263     }
7264     /**
7265      *
7266      *
7267      * <pre>
7268      * Boost applies to products which match a condition.
7269      * </pre>
7270      *
7271      * Protobuf type {@code google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec}
7272      */
7273     public static final class ConditionBoostSpec extends com.google.protobuf.GeneratedMessageV3
7274         implements
7275         // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec)
7276         ConditionBoostSpecOrBuilder {
7277       private static final long serialVersionUID = 0L;
7278       // Use ConditionBoostSpec.newBuilder() to construct.
ConditionBoostSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)7279       private ConditionBoostSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
7280         super(builder);
7281       }
7282 
ConditionBoostSpec()7283       private ConditionBoostSpec() {
7284         condition_ = "";
7285       }
7286 
7287       @java.lang.Override
7288       @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)7289       protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
7290         return new ConditionBoostSpec();
7291       }
7292 
7293       @java.lang.Override
getUnknownFields()7294       public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
7295         return this.unknownFields;
7296       }
7297 
getDescriptor()7298       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
7299         return com.google.cloud.retail.v2.SearchServiceProto
7300             .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor;
7301       }
7302 
7303       @java.lang.Override
7304       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()7305           internalGetFieldAccessorTable() {
7306         return com.google.cloud.retail.v2.SearchServiceProto
7307             .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable
7308             .ensureFieldAccessorsInitialized(
7309                 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.class,
7310                 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
7311                     .class);
7312       }
7313 
7314       public static final int CONDITION_FIELD_NUMBER = 1;
7315 
7316       @SuppressWarnings("serial")
7317       private volatile java.lang.Object condition_ = "";
7318       /**
7319        *
7320        *
7321        * <pre>
7322        * An expression which specifies a boost condition. The syntax and
7323        * supported fields are the same as a filter expression. See
7324        * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
7325        * detail syntax and limitations.
7326        * Examples:
7327        * * To boost products with product ID "product_1" or "product_2", and
7328        * color
7329        *   "Red" or "Blue":
7330        *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
7331        *     ANY("Red","Blue"))
7332        * </pre>
7333        *
7334        * <code>string condition = 1;</code>
7335        *
7336        * @return The condition.
7337        */
7338       @java.lang.Override
getCondition()7339       public java.lang.String getCondition() {
7340         java.lang.Object ref = condition_;
7341         if (ref instanceof java.lang.String) {
7342           return (java.lang.String) ref;
7343         } else {
7344           com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
7345           java.lang.String s = bs.toStringUtf8();
7346           condition_ = s;
7347           return s;
7348         }
7349       }
7350       /**
7351        *
7352        *
7353        * <pre>
7354        * An expression which specifies a boost condition. The syntax and
7355        * supported fields are the same as a filter expression. See
7356        * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
7357        * detail syntax and limitations.
7358        * Examples:
7359        * * To boost products with product ID "product_1" or "product_2", and
7360        * color
7361        *   "Red" or "Blue":
7362        *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
7363        *     ANY("Red","Blue"))
7364        * </pre>
7365        *
7366        * <code>string condition = 1;</code>
7367        *
7368        * @return The bytes for condition.
7369        */
7370       @java.lang.Override
getConditionBytes()7371       public com.google.protobuf.ByteString getConditionBytes() {
7372         java.lang.Object ref = condition_;
7373         if (ref instanceof java.lang.String) {
7374           com.google.protobuf.ByteString b =
7375               com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
7376           condition_ = b;
7377           return b;
7378         } else {
7379           return (com.google.protobuf.ByteString) ref;
7380         }
7381       }
7382 
7383       public static final int BOOST_FIELD_NUMBER = 2;
7384       private float boost_ = 0F;
7385       /**
7386        *
7387        *
7388        * <pre>
7389        * Strength of the condition boost, which should be in [-1, 1]. Negative
7390        * boost means demotion. Default is 0.0.
7391        * Setting to 1.0 gives the item a big promotion. However, it does not
7392        * necessarily mean that the boosted item will be the top result at all
7393        * times, nor that other items will be excluded. Results could still be
7394        * shown even when none of them matches the condition. And results that
7395        * are significantly more relevant to the search query can still trump
7396        * your heavily favored but irrelevant items.
7397        * Setting to -1.0 gives the item a big demotion. However, results that
7398        * are deeply relevant might still be shown. The item will have an
7399        * upstream battle to get a fairly high ranking, but it is not blocked out
7400        * completely.
7401        * Setting to 0.0 means no boost applied. The boosting condition is
7402        * ignored.
7403        * </pre>
7404        *
7405        * <code>float boost = 2;</code>
7406        *
7407        * @return The boost.
7408        */
7409       @java.lang.Override
getBoost()7410       public float getBoost() {
7411         return boost_;
7412       }
7413 
7414       private byte memoizedIsInitialized = -1;
7415 
7416       @java.lang.Override
isInitialized()7417       public final boolean isInitialized() {
7418         byte isInitialized = memoizedIsInitialized;
7419         if (isInitialized == 1) return true;
7420         if (isInitialized == 0) return false;
7421 
7422         memoizedIsInitialized = 1;
7423         return true;
7424       }
7425 
7426       @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)7427       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
7428         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(condition_)) {
7429           com.google.protobuf.GeneratedMessageV3.writeString(output, 1, condition_);
7430         }
7431         if (java.lang.Float.floatToRawIntBits(boost_) != 0) {
7432           output.writeFloat(2, boost_);
7433         }
7434         getUnknownFields().writeTo(output);
7435       }
7436 
7437       @java.lang.Override
getSerializedSize()7438       public int getSerializedSize() {
7439         int size = memoizedSize;
7440         if (size != -1) return size;
7441 
7442         size = 0;
7443         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(condition_)) {
7444           size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, condition_);
7445         }
7446         if (java.lang.Float.floatToRawIntBits(boost_) != 0) {
7447           size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, boost_);
7448         }
7449         size += getUnknownFields().getSerializedSize();
7450         memoizedSize = size;
7451         return size;
7452       }
7453 
7454       @java.lang.Override
equals(final java.lang.Object obj)7455       public boolean equals(final java.lang.Object obj) {
7456         if (obj == this) {
7457           return true;
7458         }
7459         if (!(obj
7460             instanceof com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec)) {
7461           return super.equals(obj);
7462         }
7463         com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec other =
7464             (com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) obj;
7465 
7466         if (!getCondition().equals(other.getCondition())) return false;
7467         if (java.lang.Float.floatToIntBits(getBoost())
7468             != java.lang.Float.floatToIntBits(other.getBoost())) return false;
7469         if (!getUnknownFields().equals(other.getUnknownFields())) return false;
7470         return true;
7471       }
7472 
7473       @java.lang.Override
hashCode()7474       public int hashCode() {
7475         if (memoizedHashCode != 0) {
7476           return memoizedHashCode;
7477         }
7478         int hash = 41;
7479         hash = (19 * hash) + getDescriptor().hashCode();
7480         hash = (37 * hash) + CONDITION_FIELD_NUMBER;
7481         hash = (53 * hash) + getCondition().hashCode();
7482         hash = (37 * hash) + BOOST_FIELD_NUMBER;
7483         hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost());
7484         hash = (29 * hash) + getUnknownFields().hashCode();
7485         memoizedHashCode = hash;
7486         return hash;
7487       }
7488 
parseFrom( java.nio.ByteBuffer data)7489       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(
7490           java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
7491         return PARSER.parseFrom(data);
7492       }
7493 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7494       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(
7495           java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
7496           throws com.google.protobuf.InvalidProtocolBufferException {
7497         return PARSER.parseFrom(data, extensionRegistry);
7498       }
7499 
parseFrom( com.google.protobuf.ByteString data)7500       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(
7501           com.google.protobuf.ByteString data)
7502           throws com.google.protobuf.InvalidProtocolBufferException {
7503         return PARSER.parseFrom(data);
7504       }
7505 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7506       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(
7507           com.google.protobuf.ByteString data,
7508           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
7509           throws com.google.protobuf.InvalidProtocolBufferException {
7510         return PARSER.parseFrom(data, extensionRegistry);
7511       }
7512 
parseFrom( byte[] data)7513       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(
7514           byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
7515         return PARSER.parseFrom(data);
7516       }
7517 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7518       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(
7519           byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
7520           throws com.google.protobuf.InvalidProtocolBufferException {
7521         return PARSER.parseFrom(data, extensionRegistry);
7522       }
7523 
parseFrom( java.io.InputStream input)7524       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(
7525           java.io.InputStream input) throws java.io.IOException {
7526         return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
7527       }
7528 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7529       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(
7530           java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
7531           throws java.io.IOException {
7532         return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
7533             PARSER, input, extensionRegistry);
7534       }
7535 
7536       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
parseDelimitedFrom(java.io.InputStream input)7537           parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
7538         return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
7539       }
7540 
7541       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7542           parseDelimitedFrom(
7543               java.io.InputStream input,
7544               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
7545               throws java.io.IOException {
7546         return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
7547             PARSER, input, extensionRegistry);
7548       }
7549 
parseFrom( com.google.protobuf.CodedInputStream input)7550       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(
7551           com.google.protobuf.CodedInputStream input) throws java.io.IOException {
7552         return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
7553       }
7554 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7555       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(
7556           com.google.protobuf.CodedInputStream input,
7557           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
7558           throws java.io.IOException {
7559         return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
7560             PARSER, input, extensionRegistry);
7561       }
7562 
7563       @java.lang.Override
newBuilderForType()7564       public Builder newBuilderForType() {
7565         return newBuilder();
7566       }
7567 
newBuilder()7568       public static Builder newBuilder() {
7569         return DEFAULT_INSTANCE.toBuilder();
7570       }
7571 
newBuilder( com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec prototype)7572       public static Builder newBuilder(
7573           com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec prototype) {
7574         return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
7575       }
7576 
7577       @java.lang.Override
toBuilder()7578       public Builder toBuilder() {
7579         return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
7580       }
7581 
7582       @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)7583       protected Builder newBuilderForType(
7584           com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
7585         Builder builder = new Builder(parent);
7586         return builder;
7587       }
7588       /**
7589        *
7590        *
7591        * <pre>
7592        * Boost applies to products which match a condition.
7593        * </pre>
7594        *
7595        * Protobuf type {@code google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec}
7596        */
7597       public static final class Builder
7598           extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
7599           implements
7600           // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec)
7601           com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder {
getDescriptor()7602         public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
7603           return com.google.cloud.retail.v2.SearchServiceProto
7604               .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor;
7605         }
7606 
7607         @java.lang.Override
7608         protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()7609             internalGetFieldAccessorTable() {
7610           return com.google.cloud.retail.v2.SearchServiceProto
7611               .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable
7612               .ensureFieldAccessorsInitialized(
7613                   com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.class,
7614                   com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
7615                       .class);
7616         }
7617 
7618         // Construct using
7619         // com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.newBuilder()
Builder()7620         private Builder() {}
7621 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)7622         private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
7623           super(parent);
7624         }
7625 
7626         @java.lang.Override
clear()7627         public Builder clear() {
7628           super.clear();
7629           bitField0_ = 0;
7630           condition_ = "";
7631           boost_ = 0F;
7632           return this;
7633         }
7634 
7635         @java.lang.Override
getDescriptorForType()7636         public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
7637           return com.google.cloud.retail.v2.SearchServiceProto
7638               .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor;
7639         }
7640 
7641         @java.lang.Override
7642         public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
getDefaultInstanceForType()7643             getDefaultInstanceForType() {
7644           return com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
7645               .getDefaultInstance();
7646         }
7647 
7648         @java.lang.Override
build()7649         public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec build() {
7650           com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec result =
7651               buildPartial();
7652           if (!result.isInitialized()) {
7653             throw newUninitializedMessageException(result);
7654           }
7655           return result;
7656         }
7657 
7658         @java.lang.Override
7659         public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
buildPartial()7660             buildPartial() {
7661           com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec result =
7662               new com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec(this);
7663           if (bitField0_ != 0) {
7664             buildPartial0(result);
7665           }
7666           onBuilt();
7667           return result;
7668         }
7669 
buildPartial0( com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec result)7670         private void buildPartial0(
7671             com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec result) {
7672           int from_bitField0_ = bitField0_;
7673           if (((from_bitField0_ & 0x00000001) != 0)) {
7674             result.condition_ = condition_;
7675           }
7676           if (((from_bitField0_ & 0x00000002) != 0)) {
7677             result.boost_ = boost_;
7678           }
7679         }
7680 
7681         @java.lang.Override
clone()7682         public Builder clone() {
7683           return super.clone();
7684         }
7685 
7686         @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)7687         public Builder setField(
7688             com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
7689           return super.setField(field, value);
7690         }
7691 
7692         @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)7693         public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
7694           return super.clearField(field);
7695         }
7696 
7697         @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)7698         public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
7699           return super.clearOneof(oneof);
7700         }
7701 
7702         @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)7703         public Builder setRepeatedField(
7704             com.google.protobuf.Descriptors.FieldDescriptor field,
7705             int index,
7706             java.lang.Object value) {
7707           return super.setRepeatedField(field, index, value);
7708         }
7709 
7710         @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)7711         public Builder addRepeatedField(
7712             com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
7713           return super.addRepeatedField(field, value);
7714         }
7715 
7716         @java.lang.Override
mergeFrom(com.google.protobuf.Message other)7717         public Builder mergeFrom(com.google.protobuf.Message other) {
7718           if (other
7719               instanceof com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) {
7720             return mergeFrom(
7721                 (com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) other);
7722           } else {
7723             super.mergeFrom(other);
7724             return this;
7725           }
7726         }
7727 
mergeFrom( com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec other)7728         public Builder mergeFrom(
7729             com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec other) {
7730           if (other
7731               == com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
7732                   .getDefaultInstance()) return this;
7733           if (!other.getCondition().isEmpty()) {
7734             condition_ = other.condition_;
7735             bitField0_ |= 0x00000001;
7736             onChanged();
7737           }
7738           if (other.getBoost() != 0F) {
7739             setBoost(other.getBoost());
7740           }
7741           this.mergeUnknownFields(other.getUnknownFields());
7742           onChanged();
7743           return this;
7744         }
7745 
7746         @java.lang.Override
isInitialized()7747         public final boolean isInitialized() {
7748           return true;
7749         }
7750 
7751         @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7752         public Builder mergeFrom(
7753             com.google.protobuf.CodedInputStream input,
7754             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
7755             throws java.io.IOException {
7756           if (extensionRegistry == null) {
7757             throw new java.lang.NullPointerException();
7758           }
7759           try {
7760             boolean done = false;
7761             while (!done) {
7762               int tag = input.readTag();
7763               switch (tag) {
7764                 case 0:
7765                   done = true;
7766                   break;
7767                 case 10:
7768                   {
7769                     condition_ = input.readStringRequireUtf8();
7770                     bitField0_ |= 0x00000001;
7771                     break;
7772                   } // case 10
7773                 case 21:
7774                   {
7775                     boost_ = input.readFloat();
7776                     bitField0_ |= 0x00000002;
7777                     break;
7778                   } // case 21
7779                 default:
7780                   {
7781                     if (!super.parseUnknownField(input, extensionRegistry, tag)) {
7782                       done = true; // was an endgroup tag
7783                     }
7784                     break;
7785                   } // default:
7786               } // switch (tag)
7787             } // while (!done)
7788           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
7789             throw e.unwrapIOException();
7790           } finally {
7791             onChanged();
7792           } // finally
7793           return this;
7794         }
7795 
7796         private int bitField0_;
7797 
7798         private java.lang.Object condition_ = "";
7799         /**
7800          *
7801          *
7802          * <pre>
7803          * An expression which specifies a boost condition. The syntax and
7804          * supported fields are the same as a filter expression. See
7805          * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
7806          * detail syntax and limitations.
7807          * Examples:
7808          * * To boost products with product ID "product_1" or "product_2", and
7809          * color
7810          *   "Red" or "Blue":
7811          *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
7812          *     ANY("Red","Blue"))
7813          * </pre>
7814          *
7815          * <code>string condition = 1;</code>
7816          *
7817          * @return The condition.
7818          */
getCondition()7819         public java.lang.String getCondition() {
7820           java.lang.Object ref = condition_;
7821           if (!(ref instanceof java.lang.String)) {
7822             com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
7823             java.lang.String s = bs.toStringUtf8();
7824             condition_ = s;
7825             return s;
7826           } else {
7827             return (java.lang.String) ref;
7828           }
7829         }
7830         /**
7831          *
7832          *
7833          * <pre>
7834          * An expression which specifies a boost condition. The syntax and
7835          * supported fields are the same as a filter expression. See
7836          * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
7837          * detail syntax and limitations.
7838          * Examples:
7839          * * To boost products with product ID "product_1" or "product_2", and
7840          * color
7841          *   "Red" or "Blue":
7842          *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
7843          *     ANY("Red","Blue"))
7844          * </pre>
7845          *
7846          * <code>string condition = 1;</code>
7847          *
7848          * @return The bytes for condition.
7849          */
getConditionBytes()7850         public com.google.protobuf.ByteString getConditionBytes() {
7851           java.lang.Object ref = condition_;
7852           if (ref instanceof String) {
7853             com.google.protobuf.ByteString b =
7854                 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
7855             condition_ = b;
7856             return b;
7857           } else {
7858             return (com.google.protobuf.ByteString) ref;
7859           }
7860         }
7861         /**
7862          *
7863          *
7864          * <pre>
7865          * An expression which specifies a boost condition. The syntax and
7866          * supported fields are the same as a filter expression. See
7867          * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
7868          * detail syntax and limitations.
7869          * Examples:
7870          * * To boost products with product ID "product_1" or "product_2", and
7871          * color
7872          *   "Red" or "Blue":
7873          *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
7874          *     ANY("Red","Blue"))
7875          * </pre>
7876          *
7877          * <code>string condition = 1;</code>
7878          *
7879          * @param value The condition to set.
7880          * @return This builder for chaining.
7881          */
setCondition(java.lang.String value)7882         public Builder setCondition(java.lang.String value) {
7883           if (value == null) {
7884             throw new NullPointerException();
7885           }
7886           condition_ = value;
7887           bitField0_ |= 0x00000001;
7888           onChanged();
7889           return this;
7890         }
7891         /**
7892          *
7893          *
7894          * <pre>
7895          * An expression which specifies a boost condition. The syntax and
7896          * supported fields are the same as a filter expression. See
7897          * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
7898          * detail syntax and limitations.
7899          * Examples:
7900          * * To boost products with product ID "product_1" or "product_2", and
7901          * color
7902          *   "Red" or "Blue":
7903          *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
7904          *     ANY("Red","Blue"))
7905          * </pre>
7906          *
7907          * <code>string condition = 1;</code>
7908          *
7909          * @return This builder for chaining.
7910          */
clearCondition()7911         public Builder clearCondition() {
7912           condition_ = getDefaultInstance().getCondition();
7913           bitField0_ = (bitField0_ & ~0x00000001);
7914           onChanged();
7915           return this;
7916         }
7917         /**
7918          *
7919          *
7920          * <pre>
7921          * An expression which specifies a boost condition. The syntax and
7922          * supported fields are the same as a filter expression. See
7923          * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
7924          * detail syntax and limitations.
7925          * Examples:
7926          * * To boost products with product ID "product_1" or "product_2", and
7927          * color
7928          *   "Red" or "Blue":
7929          *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
7930          *     ANY("Red","Blue"))
7931          * </pre>
7932          *
7933          * <code>string condition = 1;</code>
7934          *
7935          * @param value The bytes for condition to set.
7936          * @return This builder for chaining.
7937          */
setConditionBytes(com.google.protobuf.ByteString value)7938         public Builder setConditionBytes(com.google.protobuf.ByteString value) {
7939           if (value == null) {
7940             throw new NullPointerException();
7941           }
7942           checkByteStringIsUtf8(value);
7943           condition_ = value;
7944           bitField0_ |= 0x00000001;
7945           onChanged();
7946           return this;
7947         }
7948 
7949         private float boost_;
7950         /**
7951          *
7952          *
7953          * <pre>
7954          * Strength of the condition boost, which should be in [-1, 1]. Negative
7955          * boost means demotion. Default is 0.0.
7956          * Setting to 1.0 gives the item a big promotion. However, it does not
7957          * necessarily mean that the boosted item will be the top result at all
7958          * times, nor that other items will be excluded. Results could still be
7959          * shown even when none of them matches the condition. And results that
7960          * are significantly more relevant to the search query can still trump
7961          * your heavily favored but irrelevant items.
7962          * Setting to -1.0 gives the item a big demotion. However, results that
7963          * are deeply relevant might still be shown. The item will have an
7964          * upstream battle to get a fairly high ranking, but it is not blocked out
7965          * completely.
7966          * Setting to 0.0 means no boost applied. The boosting condition is
7967          * ignored.
7968          * </pre>
7969          *
7970          * <code>float boost = 2;</code>
7971          *
7972          * @return The boost.
7973          */
7974         @java.lang.Override
getBoost()7975         public float getBoost() {
7976           return boost_;
7977         }
7978         /**
7979          *
7980          *
7981          * <pre>
7982          * Strength of the condition boost, which should be in [-1, 1]. Negative
7983          * boost means demotion. Default is 0.0.
7984          * Setting to 1.0 gives the item a big promotion. However, it does not
7985          * necessarily mean that the boosted item will be the top result at all
7986          * times, nor that other items will be excluded. Results could still be
7987          * shown even when none of them matches the condition. And results that
7988          * are significantly more relevant to the search query can still trump
7989          * your heavily favored but irrelevant items.
7990          * Setting to -1.0 gives the item a big demotion. However, results that
7991          * are deeply relevant might still be shown. The item will have an
7992          * upstream battle to get a fairly high ranking, but it is not blocked out
7993          * completely.
7994          * Setting to 0.0 means no boost applied. The boosting condition is
7995          * ignored.
7996          * </pre>
7997          *
7998          * <code>float boost = 2;</code>
7999          *
8000          * @param value The boost to set.
8001          * @return This builder for chaining.
8002          */
setBoost(float value)8003         public Builder setBoost(float value) {
8004 
8005           boost_ = value;
8006           bitField0_ |= 0x00000002;
8007           onChanged();
8008           return this;
8009         }
8010         /**
8011          *
8012          *
8013          * <pre>
8014          * Strength of the condition boost, which should be in [-1, 1]. Negative
8015          * boost means demotion. Default is 0.0.
8016          * Setting to 1.0 gives the item a big promotion. However, it does not
8017          * necessarily mean that the boosted item will be the top result at all
8018          * times, nor that other items will be excluded. Results could still be
8019          * shown even when none of them matches the condition. And results that
8020          * are significantly more relevant to the search query can still trump
8021          * your heavily favored but irrelevant items.
8022          * Setting to -1.0 gives the item a big demotion. However, results that
8023          * are deeply relevant might still be shown. The item will have an
8024          * upstream battle to get a fairly high ranking, but it is not blocked out
8025          * completely.
8026          * Setting to 0.0 means no boost applied. The boosting condition is
8027          * ignored.
8028          * </pre>
8029          *
8030          * <code>float boost = 2;</code>
8031          *
8032          * @return This builder for chaining.
8033          */
clearBoost()8034         public Builder clearBoost() {
8035           bitField0_ = (bitField0_ & ~0x00000002);
8036           boost_ = 0F;
8037           onChanged();
8038           return this;
8039         }
8040 
8041         @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)8042         public final Builder setUnknownFields(
8043             final com.google.protobuf.UnknownFieldSet unknownFields) {
8044           return super.setUnknownFields(unknownFields);
8045         }
8046 
8047         @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)8048         public final Builder mergeUnknownFields(
8049             final com.google.protobuf.UnknownFieldSet unknownFields) {
8050           return super.mergeUnknownFields(unknownFields);
8051         }
8052 
8053         // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec)
8054       }
8055 
8056       // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec)
8057       private static final com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
8058           DEFAULT_INSTANCE;
8059 
8060       static {
8061         DEFAULT_INSTANCE =
8062             new com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec();
8063       }
8064 
8065       public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
getDefaultInstance()8066           getDefaultInstance() {
8067         return DEFAULT_INSTANCE;
8068       }
8069 
8070       private static final com.google.protobuf.Parser<ConditionBoostSpec> PARSER =
8071           new com.google.protobuf.AbstractParser<ConditionBoostSpec>() {
8072             @java.lang.Override
8073             public ConditionBoostSpec parsePartialFrom(
8074                 com.google.protobuf.CodedInputStream input,
8075                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
8076                 throws com.google.protobuf.InvalidProtocolBufferException {
8077               Builder builder = newBuilder();
8078               try {
8079                 builder.mergeFrom(input, extensionRegistry);
8080               } catch (com.google.protobuf.InvalidProtocolBufferException e) {
8081                 throw e.setUnfinishedMessage(builder.buildPartial());
8082               } catch (com.google.protobuf.UninitializedMessageException e) {
8083                 throw e.asInvalidProtocolBufferException()
8084                     .setUnfinishedMessage(builder.buildPartial());
8085               } catch (java.io.IOException e) {
8086                 throw new com.google.protobuf.InvalidProtocolBufferException(e)
8087                     .setUnfinishedMessage(builder.buildPartial());
8088               }
8089               return builder.buildPartial();
8090             }
8091           };
8092 
parser()8093       public static com.google.protobuf.Parser<ConditionBoostSpec> parser() {
8094         return PARSER;
8095       }
8096 
8097       @java.lang.Override
getParserForType()8098       public com.google.protobuf.Parser<ConditionBoostSpec> getParserForType() {
8099         return PARSER;
8100       }
8101 
8102       @java.lang.Override
8103       public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
getDefaultInstanceForType()8104           getDefaultInstanceForType() {
8105         return DEFAULT_INSTANCE;
8106       }
8107     }
8108 
8109     private int bitField0_;
8110     public static final int CONDITION_BOOST_SPECS_FIELD_NUMBER = 1;
8111 
8112     @SuppressWarnings("serial")
8113     private java.util.List<com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec>
8114         conditionBoostSpecs_;
8115     /**
8116      *
8117      *
8118      * <pre>
8119      * Condition boost specifications. If a product matches multiple conditions
8120      * in the specifictions, boost scores from these specifications are all
8121      * applied and combined in a non-linear way. Maximum number of
8122      * specifications is 20.
8123      * </pre>
8124      *
8125      * <code>
8126      * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8127      * </code>
8128      */
8129     @java.lang.Override
8130     public java.util.List<com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec>
getConditionBoostSpecsList()8131         getConditionBoostSpecsList() {
8132       return conditionBoostSpecs_;
8133     }
8134     /**
8135      *
8136      *
8137      * <pre>
8138      * Condition boost specifications. If a product matches multiple conditions
8139      * in the specifictions, boost scores from these specifications are all
8140      * applied and combined in a non-linear way. Maximum number of
8141      * specifications is 20.
8142      * </pre>
8143      *
8144      * <code>
8145      * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8146      * </code>
8147      */
8148     @java.lang.Override
8149     public java.util.List<
8150             ? extends
8151                 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder>
getConditionBoostSpecsOrBuilderList()8152         getConditionBoostSpecsOrBuilderList() {
8153       return conditionBoostSpecs_;
8154     }
8155     /**
8156      *
8157      *
8158      * <pre>
8159      * Condition boost specifications. If a product matches multiple conditions
8160      * in the specifictions, boost scores from these specifications are all
8161      * applied and combined in a non-linear way. Maximum number of
8162      * specifications is 20.
8163      * </pre>
8164      *
8165      * <code>
8166      * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8167      * </code>
8168      */
8169     @java.lang.Override
getConditionBoostSpecsCount()8170     public int getConditionBoostSpecsCount() {
8171       return conditionBoostSpecs_.size();
8172     }
8173     /**
8174      *
8175      *
8176      * <pre>
8177      * Condition boost specifications. If a product matches multiple conditions
8178      * in the specifictions, boost scores from these specifications are all
8179      * applied and combined in a non-linear way. Maximum number of
8180      * specifications is 20.
8181      * </pre>
8182      *
8183      * <code>
8184      * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8185      * </code>
8186      */
8187     @java.lang.Override
8188     public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
getConditionBoostSpecs(int index)8189         getConditionBoostSpecs(int index) {
8190       return conditionBoostSpecs_.get(index);
8191     }
8192     /**
8193      *
8194      *
8195      * <pre>
8196      * Condition boost specifications. If a product matches multiple conditions
8197      * in the specifictions, boost scores from these specifications are all
8198      * applied and combined in a non-linear way. Maximum number of
8199      * specifications is 20.
8200      * </pre>
8201      *
8202      * <code>
8203      * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8204      * </code>
8205      */
8206     @java.lang.Override
8207     public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder
getConditionBoostSpecsOrBuilder(int index)8208         getConditionBoostSpecsOrBuilder(int index) {
8209       return conditionBoostSpecs_.get(index);
8210     }
8211 
8212     public static final int SKIP_BOOST_SPEC_VALIDATION_FIELD_NUMBER = 2;
8213     private boolean skipBoostSpecValidation_ = false;
8214     /**
8215      *
8216      *
8217      * <pre>
8218      * Whether to skip boostspec validation. If this field is set to true,
8219      * invalid
8220      * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
8221      * will be ignored and valid
8222      * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
8223      * will still be applied.
8224      * </pre>
8225      *
8226      * <code>optional bool skip_boost_spec_validation = 2;</code>
8227      *
8228      * @return Whether the skipBoostSpecValidation field is set.
8229      */
8230     @java.lang.Override
hasSkipBoostSpecValidation()8231     public boolean hasSkipBoostSpecValidation() {
8232       return ((bitField0_ & 0x00000001) != 0);
8233     }
8234     /**
8235      *
8236      *
8237      * <pre>
8238      * Whether to skip boostspec validation. If this field is set to true,
8239      * invalid
8240      * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
8241      * will be ignored and valid
8242      * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
8243      * will still be applied.
8244      * </pre>
8245      *
8246      * <code>optional bool skip_boost_spec_validation = 2;</code>
8247      *
8248      * @return The skipBoostSpecValidation.
8249      */
8250     @java.lang.Override
getSkipBoostSpecValidation()8251     public boolean getSkipBoostSpecValidation() {
8252       return skipBoostSpecValidation_;
8253     }
8254 
8255     private byte memoizedIsInitialized = -1;
8256 
8257     @java.lang.Override
isInitialized()8258     public final boolean isInitialized() {
8259       byte isInitialized = memoizedIsInitialized;
8260       if (isInitialized == 1) return true;
8261       if (isInitialized == 0) return false;
8262 
8263       memoizedIsInitialized = 1;
8264       return true;
8265     }
8266 
8267     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)8268     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
8269       for (int i = 0; i < conditionBoostSpecs_.size(); i++) {
8270         output.writeMessage(1, conditionBoostSpecs_.get(i));
8271       }
8272       if (((bitField0_ & 0x00000001) != 0)) {
8273         output.writeBool(2, skipBoostSpecValidation_);
8274       }
8275       getUnknownFields().writeTo(output);
8276     }
8277 
8278     @java.lang.Override
getSerializedSize()8279     public int getSerializedSize() {
8280       int size = memoizedSize;
8281       if (size != -1) return size;
8282 
8283       size = 0;
8284       for (int i = 0; i < conditionBoostSpecs_.size(); i++) {
8285         size +=
8286             com.google.protobuf.CodedOutputStream.computeMessageSize(
8287                 1, conditionBoostSpecs_.get(i));
8288       }
8289       if (((bitField0_ & 0x00000001) != 0)) {
8290         size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, skipBoostSpecValidation_);
8291       }
8292       size += getUnknownFields().getSerializedSize();
8293       memoizedSize = size;
8294       return size;
8295     }
8296 
8297     @java.lang.Override
equals(final java.lang.Object obj)8298     public boolean equals(final java.lang.Object obj) {
8299       if (obj == this) {
8300         return true;
8301       }
8302       if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.BoostSpec)) {
8303         return super.equals(obj);
8304       }
8305       com.google.cloud.retail.v2.SearchRequest.BoostSpec other =
8306           (com.google.cloud.retail.v2.SearchRequest.BoostSpec) obj;
8307 
8308       if (!getConditionBoostSpecsList().equals(other.getConditionBoostSpecsList())) return false;
8309       if (hasSkipBoostSpecValidation() != other.hasSkipBoostSpecValidation()) return false;
8310       if (hasSkipBoostSpecValidation()) {
8311         if (getSkipBoostSpecValidation() != other.getSkipBoostSpecValidation()) return false;
8312       }
8313       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
8314       return true;
8315     }
8316 
8317     @java.lang.Override
hashCode()8318     public int hashCode() {
8319       if (memoizedHashCode != 0) {
8320         return memoizedHashCode;
8321       }
8322       int hash = 41;
8323       hash = (19 * hash) + getDescriptor().hashCode();
8324       if (getConditionBoostSpecsCount() > 0) {
8325         hash = (37 * hash) + CONDITION_BOOST_SPECS_FIELD_NUMBER;
8326         hash = (53 * hash) + getConditionBoostSpecsList().hashCode();
8327       }
8328       if (hasSkipBoostSpecValidation()) {
8329         hash = (37 * hash) + SKIP_BOOST_SPEC_VALIDATION_FIELD_NUMBER;
8330         hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipBoostSpecValidation());
8331       }
8332       hash = (29 * hash) + getUnknownFields().hashCode();
8333       memoizedHashCode = hash;
8334       return hash;
8335     }
8336 
parseFrom( java.nio.ByteBuffer data)8337     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(
8338         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
8339       return PARSER.parseFrom(data);
8340     }
8341 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)8342     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(
8343         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
8344         throws com.google.protobuf.InvalidProtocolBufferException {
8345       return PARSER.parseFrom(data, extensionRegistry);
8346     }
8347 
parseFrom( com.google.protobuf.ByteString data)8348     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(
8349         com.google.protobuf.ByteString data)
8350         throws com.google.protobuf.InvalidProtocolBufferException {
8351       return PARSER.parseFrom(data);
8352     }
8353 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)8354     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(
8355         com.google.protobuf.ByteString data,
8356         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
8357         throws com.google.protobuf.InvalidProtocolBufferException {
8358       return PARSER.parseFrom(data, extensionRegistry);
8359     }
8360 
parseFrom(byte[] data)8361     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(byte[] data)
8362         throws com.google.protobuf.InvalidProtocolBufferException {
8363       return PARSER.parseFrom(data);
8364     }
8365 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)8366     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(
8367         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
8368         throws com.google.protobuf.InvalidProtocolBufferException {
8369       return PARSER.parseFrom(data, extensionRegistry);
8370     }
8371 
parseFrom( java.io.InputStream input)8372     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(
8373         java.io.InputStream input) throws java.io.IOException {
8374       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
8375     }
8376 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)8377     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(
8378         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
8379         throws java.io.IOException {
8380       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
8381           PARSER, input, extensionRegistry);
8382     }
8383 
parseDelimitedFrom( java.io.InputStream input)8384     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseDelimitedFrom(
8385         java.io.InputStream input) throws java.io.IOException {
8386       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
8387     }
8388 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)8389     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseDelimitedFrom(
8390         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
8391         throws java.io.IOException {
8392       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
8393           PARSER, input, extensionRegistry);
8394     }
8395 
parseFrom( com.google.protobuf.CodedInputStream input)8396     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(
8397         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
8398       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
8399     }
8400 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)8401     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(
8402         com.google.protobuf.CodedInputStream input,
8403         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
8404         throws java.io.IOException {
8405       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
8406           PARSER, input, extensionRegistry);
8407     }
8408 
8409     @java.lang.Override
newBuilderForType()8410     public Builder newBuilderForType() {
8411       return newBuilder();
8412     }
8413 
newBuilder()8414     public static Builder newBuilder() {
8415       return DEFAULT_INSTANCE.toBuilder();
8416     }
8417 
newBuilder(com.google.cloud.retail.v2.SearchRequest.BoostSpec prototype)8418     public static Builder newBuilder(com.google.cloud.retail.v2.SearchRequest.BoostSpec prototype) {
8419       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
8420     }
8421 
8422     @java.lang.Override
toBuilder()8423     public Builder toBuilder() {
8424       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
8425     }
8426 
8427     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)8428     protected Builder newBuilderForType(
8429         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
8430       Builder builder = new Builder(parent);
8431       return builder;
8432     }
8433     /**
8434      *
8435      *
8436      * <pre>
8437      * Boost specification to boost certain items.
8438      * </pre>
8439      *
8440      * Protobuf type {@code google.cloud.retail.v2.SearchRequest.BoostSpec}
8441      */
8442     public static final class Builder
8443         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
8444         implements
8445         // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.BoostSpec)
8446         com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder {
getDescriptor()8447       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
8448         return com.google.cloud.retail.v2.SearchServiceProto
8449             .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_descriptor;
8450       }
8451 
8452       @java.lang.Override
8453       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()8454           internalGetFieldAccessorTable() {
8455         return com.google.cloud.retail.v2.SearchServiceProto
8456             .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_fieldAccessorTable
8457             .ensureFieldAccessorsInitialized(
8458                 com.google.cloud.retail.v2.SearchRequest.BoostSpec.class,
8459                 com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder.class);
8460       }
8461 
8462       // Construct using com.google.cloud.retail.v2.SearchRequest.BoostSpec.newBuilder()
Builder()8463       private Builder() {}
8464 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)8465       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
8466         super(parent);
8467       }
8468 
8469       @java.lang.Override
clear()8470       public Builder clear() {
8471         super.clear();
8472         bitField0_ = 0;
8473         if (conditionBoostSpecsBuilder_ == null) {
8474           conditionBoostSpecs_ = java.util.Collections.emptyList();
8475         } else {
8476           conditionBoostSpecs_ = null;
8477           conditionBoostSpecsBuilder_.clear();
8478         }
8479         bitField0_ = (bitField0_ & ~0x00000001);
8480         skipBoostSpecValidation_ = false;
8481         return this;
8482       }
8483 
8484       @java.lang.Override
getDescriptorForType()8485       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
8486         return com.google.cloud.retail.v2.SearchServiceProto
8487             .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_descriptor;
8488       }
8489 
8490       @java.lang.Override
getDefaultInstanceForType()8491       public com.google.cloud.retail.v2.SearchRequest.BoostSpec getDefaultInstanceForType() {
8492         return com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance();
8493       }
8494 
8495       @java.lang.Override
build()8496       public com.google.cloud.retail.v2.SearchRequest.BoostSpec build() {
8497         com.google.cloud.retail.v2.SearchRequest.BoostSpec result = buildPartial();
8498         if (!result.isInitialized()) {
8499           throw newUninitializedMessageException(result);
8500         }
8501         return result;
8502       }
8503 
8504       @java.lang.Override
buildPartial()8505       public com.google.cloud.retail.v2.SearchRequest.BoostSpec buildPartial() {
8506         com.google.cloud.retail.v2.SearchRequest.BoostSpec result =
8507             new com.google.cloud.retail.v2.SearchRequest.BoostSpec(this);
8508         buildPartialRepeatedFields(result);
8509         if (bitField0_ != 0) {
8510           buildPartial0(result);
8511         }
8512         onBuilt();
8513         return result;
8514       }
8515 
buildPartialRepeatedFields( com.google.cloud.retail.v2.SearchRequest.BoostSpec result)8516       private void buildPartialRepeatedFields(
8517           com.google.cloud.retail.v2.SearchRequest.BoostSpec result) {
8518         if (conditionBoostSpecsBuilder_ == null) {
8519           if (((bitField0_ & 0x00000001) != 0)) {
8520             conditionBoostSpecs_ = java.util.Collections.unmodifiableList(conditionBoostSpecs_);
8521             bitField0_ = (bitField0_ & ~0x00000001);
8522           }
8523           result.conditionBoostSpecs_ = conditionBoostSpecs_;
8524         } else {
8525           result.conditionBoostSpecs_ = conditionBoostSpecsBuilder_.build();
8526         }
8527       }
8528 
buildPartial0(com.google.cloud.retail.v2.SearchRequest.BoostSpec result)8529       private void buildPartial0(com.google.cloud.retail.v2.SearchRequest.BoostSpec result) {
8530         int from_bitField0_ = bitField0_;
8531         int to_bitField0_ = 0;
8532         if (((from_bitField0_ & 0x00000002) != 0)) {
8533           result.skipBoostSpecValidation_ = skipBoostSpecValidation_;
8534           to_bitField0_ |= 0x00000001;
8535         }
8536         result.bitField0_ |= to_bitField0_;
8537       }
8538 
8539       @java.lang.Override
clone()8540       public Builder clone() {
8541         return super.clone();
8542       }
8543 
8544       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)8545       public Builder setField(
8546           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
8547         return super.setField(field, value);
8548       }
8549 
8550       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)8551       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
8552         return super.clearField(field);
8553       }
8554 
8555       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)8556       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
8557         return super.clearOneof(oneof);
8558       }
8559 
8560       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)8561       public Builder setRepeatedField(
8562           com.google.protobuf.Descriptors.FieldDescriptor field,
8563           int index,
8564           java.lang.Object value) {
8565         return super.setRepeatedField(field, index, value);
8566       }
8567 
8568       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)8569       public Builder addRepeatedField(
8570           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
8571         return super.addRepeatedField(field, value);
8572       }
8573 
8574       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)8575       public Builder mergeFrom(com.google.protobuf.Message other) {
8576         if (other instanceof com.google.cloud.retail.v2.SearchRequest.BoostSpec) {
8577           return mergeFrom((com.google.cloud.retail.v2.SearchRequest.BoostSpec) other);
8578         } else {
8579           super.mergeFrom(other);
8580           return this;
8581         }
8582       }
8583 
mergeFrom(com.google.cloud.retail.v2.SearchRequest.BoostSpec other)8584       public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest.BoostSpec other) {
8585         if (other == com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance())
8586           return this;
8587         if (conditionBoostSpecsBuilder_ == null) {
8588           if (!other.conditionBoostSpecs_.isEmpty()) {
8589             if (conditionBoostSpecs_.isEmpty()) {
8590               conditionBoostSpecs_ = other.conditionBoostSpecs_;
8591               bitField0_ = (bitField0_ & ~0x00000001);
8592             } else {
8593               ensureConditionBoostSpecsIsMutable();
8594               conditionBoostSpecs_.addAll(other.conditionBoostSpecs_);
8595             }
8596             onChanged();
8597           }
8598         } else {
8599           if (!other.conditionBoostSpecs_.isEmpty()) {
8600             if (conditionBoostSpecsBuilder_.isEmpty()) {
8601               conditionBoostSpecsBuilder_.dispose();
8602               conditionBoostSpecsBuilder_ = null;
8603               conditionBoostSpecs_ = other.conditionBoostSpecs_;
8604               bitField0_ = (bitField0_ & ~0x00000001);
8605               conditionBoostSpecsBuilder_ =
8606                   com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
8607                       ? getConditionBoostSpecsFieldBuilder()
8608                       : null;
8609             } else {
8610               conditionBoostSpecsBuilder_.addAllMessages(other.conditionBoostSpecs_);
8611             }
8612           }
8613         }
8614         if (other.hasSkipBoostSpecValidation()) {
8615           setSkipBoostSpecValidation(other.getSkipBoostSpecValidation());
8616         }
8617         this.mergeUnknownFields(other.getUnknownFields());
8618         onChanged();
8619         return this;
8620       }
8621 
8622       @java.lang.Override
isInitialized()8623       public final boolean isInitialized() {
8624         return true;
8625       }
8626 
8627       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)8628       public Builder mergeFrom(
8629           com.google.protobuf.CodedInputStream input,
8630           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
8631           throws java.io.IOException {
8632         if (extensionRegistry == null) {
8633           throw new java.lang.NullPointerException();
8634         }
8635         try {
8636           boolean done = false;
8637           while (!done) {
8638             int tag = input.readTag();
8639             switch (tag) {
8640               case 0:
8641                 done = true;
8642                 break;
8643               case 10:
8644                 {
8645                   com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec m =
8646                       input.readMessage(
8647                           com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
8648                               .parser(),
8649                           extensionRegistry);
8650                   if (conditionBoostSpecsBuilder_ == null) {
8651                     ensureConditionBoostSpecsIsMutable();
8652                     conditionBoostSpecs_.add(m);
8653                   } else {
8654                     conditionBoostSpecsBuilder_.addMessage(m);
8655                   }
8656                   break;
8657                 } // case 10
8658               case 16:
8659                 {
8660                   skipBoostSpecValidation_ = input.readBool();
8661                   bitField0_ |= 0x00000002;
8662                   break;
8663                 } // case 16
8664               default:
8665                 {
8666                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
8667                     done = true; // was an endgroup tag
8668                   }
8669                   break;
8670                 } // default:
8671             } // switch (tag)
8672           } // while (!done)
8673         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
8674           throw e.unwrapIOException();
8675         } finally {
8676           onChanged();
8677         } // finally
8678         return this;
8679       }
8680 
8681       private int bitField0_;
8682 
8683       private java.util.List<com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec>
8684           conditionBoostSpecs_ = java.util.Collections.emptyList();
8685 
ensureConditionBoostSpecsIsMutable()8686       private void ensureConditionBoostSpecsIsMutable() {
8687         if (!((bitField0_ & 0x00000001) != 0)) {
8688           conditionBoostSpecs_ =
8689               new java.util.ArrayList<
8690                   com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec>(
8691                   conditionBoostSpecs_);
8692           bitField0_ |= 0x00000001;
8693         }
8694       }
8695 
8696       private com.google.protobuf.RepeatedFieldBuilderV3<
8697               com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec,
8698               com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder,
8699               com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder>
8700           conditionBoostSpecsBuilder_;
8701 
8702       /**
8703        *
8704        *
8705        * <pre>
8706        * Condition boost specifications. If a product matches multiple conditions
8707        * in the specifictions, boost scores from these specifications are all
8708        * applied and combined in a non-linear way. Maximum number of
8709        * specifications is 20.
8710        * </pre>
8711        *
8712        * <code>
8713        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8714        * </code>
8715        */
8716       public java.util.List<com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec>
getConditionBoostSpecsList()8717           getConditionBoostSpecsList() {
8718         if (conditionBoostSpecsBuilder_ == null) {
8719           return java.util.Collections.unmodifiableList(conditionBoostSpecs_);
8720         } else {
8721           return conditionBoostSpecsBuilder_.getMessageList();
8722         }
8723       }
8724       /**
8725        *
8726        *
8727        * <pre>
8728        * Condition boost specifications. If a product matches multiple conditions
8729        * in the specifictions, boost scores from these specifications are all
8730        * applied and combined in a non-linear way. Maximum number of
8731        * specifications is 20.
8732        * </pre>
8733        *
8734        * <code>
8735        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8736        * </code>
8737        */
getConditionBoostSpecsCount()8738       public int getConditionBoostSpecsCount() {
8739         if (conditionBoostSpecsBuilder_ == null) {
8740           return conditionBoostSpecs_.size();
8741         } else {
8742           return conditionBoostSpecsBuilder_.getCount();
8743         }
8744       }
8745       /**
8746        *
8747        *
8748        * <pre>
8749        * Condition boost specifications. If a product matches multiple conditions
8750        * in the specifictions, boost scores from these specifications are all
8751        * applied and combined in a non-linear way. Maximum number of
8752        * specifications is 20.
8753        * </pre>
8754        *
8755        * <code>
8756        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8757        * </code>
8758        */
8759       public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
getConditionBoostSpecs(int index)8760           getConditionBoostSpecs(int index) {
8761         if (conditionBoostSpecsBuilder_ == null) {
8762           return conditionBoostSpecs_.get(index);
8763         } else {
8764           return conditionBoostSpecsBuilder_.getMessage(index);
8765         }
8766       }
8767       /**
8768        *
8769        *
8770        * <pre>
8771        * Condition boost specifications. If a product matches multiple conditions
8772        * in the specifictions, boost scores from these specifications are all
8773        * applied and combined in a non-linear way. Maximum number of
8774        * specifications is 20.
8775        * </pre>
8776        *
8777        * <code>
8778        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8779        * </code>
8780        */
setConditionBoostSpecs( int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value)8781       public Builder setConditionBoostSpecs(
8782           int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value) {
8783         if (conditionBoostSpecsBuilder_ == null) {
8784           if (value == null) {
8785             throw new NullPointerException();
8786           }
8787           ensureConditionBoostSpecsIsMutable();
8788           conditionBoostSpecs_.set(index, value);
8789           onChanged();
8790         } else {
8791           conditionBoostSpecsBuilder_.setMessage(index, value);
8792         }
8793         return this;
8794       }
8795       /**
8796        *
8797        *
8798        * <pre>
8799        * Condition boost specifications. If a product matches multiple conditions
8800        * in the specifictions, boost scores from these specifications are all
8801        * applied and combined in a non-linear way. Maximum number of
8802        * specifications is 20.
8803        * </pre>
8804        *
8805        * <code>
8806        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8807        * </code>
8808        */
setConditionBoostSpecs( int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder builderForValue)8809       public Builder setConditionBoostSpecs(
8810           int index,
8811           com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
8812               builderForValue) {
8813         if (conditionBoostSpecsBuilder_ == null) {
8814           ensureConditionBoostSpecsIsMutable();
8815           conditionBoostSpecs_.set(index, builderForValue.build());
8816           onChanged();
8817         } else {
8818           conditionBoostSpecsBuilder_.setMessage(index, builderForValue.build());
8819         }
8820         return this;
8821       }
8822       /**
8823        *
8824        *
8825        * <pre>
8826        * Condition boost specifications. If a product matches multiple conditions
8827        * in the specifictions, boost scores from these specifications are all
8828        * applied and combined in a non-linear way. Maximum number of
8829        * specifications is 20.
8830        * </pre>
8831        *
8832        * <code>
8833        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8834        * </code>
8835        */
addConditionBoostSpecs( com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value)8836       public Builder addConditionBoostSpecs(
8837           com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value) {
8838         if (conditionBoostSpecsBuilder_ == null) {
8839           if (value == null) {
8840             throw new NullPointerException();
8841           }
8842           ensureConditionBoostSpecsIsMutable();
8843           conditionBoostSpecs_.add(value);
8844           onChanged();
8845         } else {
8846           conditionBoostSpecsBuilder_.addMessage(value);
8847         }
8848         return this;
8849       }
8850       /**
8851        *
8852        *
8853        * <pre>
8854        * Condition boost specifications. If a product matches multiple conditions
8855        * in the specifictions, boost scores from these specifications are all
8856        * applied and combined in a non-linear way. Maximum number of
8857        * specifications is 20.
8858        * </pre>
8859        *
8860        * <code>
8861        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8862        * </code>
8863        */
addConditionBoostSpecs( int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value)8864       public Builder addConditionBoostSpecs(
8865           int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value) {
8866         if (conditionBoostSpecsBuilder_ == null) {
8867           if (value == null) {
8868             throw new NullPointerException();
8869           }
8870           ensureConditionBoostSpecsIsMutable();
8871           conditionBoostSpecs_.add(index, value);
8872           onChanged();
8873         } else {
8874           conditionBoostSpecsBuilder_.addMessage(index, value);
8875         }
8876         return this;
8877       }
8878       /**
8879        *
8880        *
8881        * <pre>
8882        * Condition boost specifications. If a product matches multiple conditions
8883        * in the specifictions, boost scores from these specifications are all
8884        * applied and combined in a non-linear way. Maximum number of
8885        * specifications is 20.
8886        * </pre>
8887        *
8888        * <code>
8889        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8890        * </code>
8891        */
addConditionBoostSpecs( com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder builderForValue)8892       public Builder addConditionBoostSpecs(
8893           com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
8894               builderForValue) {
8895         if (conditionBoostSpecsBuilder_ == null) {
8896           ensureConditionBoostSpecsIsMutable();
8897           conditionBoostSpecs_.add(builderForValue.build());
8898           onChanged();
8899         } else {
8900           conditionBoostSpecsBuilder_.addMessage(builderForValue.build());
8901         }
8902         return this;
8903       }
8904       /**
8905        *
8906        *
8907        * <pre>
8908        * Condition boost specifications. If a product matches multiple conditions
8909        * in the specifictions, boost scores from these specifications are all
8910        * applied and combined in a non-linear way. Maximum number of
8911        * specifications is 20.
8912        * </pre>
8913        *
8914        * <code>
8915        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8916        * </code>
8917        */
addConditionBoostSpecs( int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder builderForValue)8918       public Builder addConditionBoostSpecs(
8919           int index,
8920           com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
8921               builderForValue) {
8922         if (conditionBoostSpecsBuilder_ == null) {
8923           ensureConditionBoostSpecsIsMutable();
8924           conditionBoostSpecs_.add(index, builderForValue.build());
8925           onChanged();
8926         } else {
8927           conditionBoostSpecsBuilder_.addMessage(index, builderForValue.build());
8928         }
8929         return this;
8930       }
8931       /**
8932        *
8933        *
8934        * <pre>
8935        * Condition boost specifications. If a product matches multiple conditions
8936        * in the specifictions, boost scores from these specifications are all
8937        * applied and combined in a non-linear way. Maximum number of
8938        * specifications is 20.
8939        * </pre>
8940        *
8941        * <code>
8942        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8943        * </code>
8944        */
addAllConditionBoostSpecs( java.lang.Iterable< ? extends com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec> values)8945       public Builder addAllConditionBoostSpecs(
8946           java.lang.Iterable<
8947                   ? extends com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec>
8948               values) {
8949         if (conditionBoostSpecsBuilder_ == null) {
8950           ensureConditionBoostSpecsIsMutable();
8951           com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditionBoostSpecs_);
8952           onChanged();
8953         } else {
8954           conditionBoostSpecsBuilder_.addAllMessages(values);
8955         }
8956         return this;
8957       }
8958       /**
8959        *
8960        *
8961        * <pre>
8962        * Condition boost specifications. If a product matches multiple conditions
8963        * in the specifictions, boost scores from these specifications are all
8964        * applied and combined in a non-linear way. Maximum number of
8965        * specifications is 20.
8966        * </pre>
8967        *
8968        * <code>
8969        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8970        * </code>
8971        */
clearConditionBoostSpecs()8972       public Builder clearConditionBoostSpecs() {
8973         if (conditionBoostSpecsBuilder_ == null) {
8974           conditionBoostSpecs_ = java.util.Collections.emptyList();
8975           bitField0_ = (bitField0_ & ~0x00000001);
8976           onChanged();
8977         } else {
8978           conditionBoostSpecsBuilder_.clear();
8979         }
8980         return this;
8981       }
8982       /**
8983        *
8984        *
8985        * <pre>
8986        * Condition boost specifications. If a product matches multiple conditions
8987        * in the specifictions, boost scores from these specifications are all
8988        * applied and combined in a non-linear way. Maximum number of
8989        * specifications is 20.
8990        * </pre>
8991        *
8992        * <code>
8993        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
8994        * </code>
8995        */
removeConditionBoostSpecs(int index)8996       public Builder removeConditionBoostSpecs(int index) {
8997         if (conditionBoostSpecsBuilder_ == null) {
8998           ensureConditionBoostSpecsIsMutable();
8999           conditionBoostSpecs_.remove(index);
9000           onChanged();
9001         } else {
9002           conditionBoostSpecsBuilder_.remove(index);
9003         }
9004         return this;
9005       }
9006       /**
9007        *
9008        *
9009        * <pre>
9010        * Condition boost specifications. If a product matches multiple conditions
9011        * in the specifictions, boost scores from these specifications are all
9012        * applied and combined in a non-linear way. Maximum number of
9013        * specifications is 20.
9014        * </pre>
9015        *
9016        * <code>
9017        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
9018        * </code>
9019        */
9020       public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
getConditionBoostSpecsBuilder(int index)9021           getConditionBoostSpecsBuilder(int index) {
9022         return getConditionBoostSpecsFieldBuilder().getBuilder(index);
9023       }
9024       /**
9025        *
9026        *
9027        * <pre>
9028        * Condition boost specifications. If a product matches multiple conditions
9029        * in the specifictions, boost scores from these specifications are all
9030        * applied and combined in a non-linear way. Maximum number of
9031        * specifications is 20.
9032        * </pre>
9033        *
9034        * <code>
9035        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
9036        * </code>
9037        */
9038       public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder
getConditionBoostSpecsOrBuilder(int index)9039           getConditionBoostSpecsOrBuilder(int index) {
9040         if (conditionBoostSpecsBuilder_ == null) {
9041           return conditionBoostSpecs_.get(index);
9042         } else {
9043           return conditionBoostSpecsBuilder_.getMessageOrBuilder(index);
9044         }
9045       }
9046       /**
9047        *
9048        *
9049        * <pre>
9050        * Condition boost specifications. If a product matches multiple conditions
9051        * in the specifictions, boost scores from these specifications are all
9052        * applied and combined in a non-linear way. Maximum number of
9053        * specifications is 20.
9054        * </pre>
9055        *
9056        * <code>
9057        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
9058        * </code>
9059        */
9060       public java.util.List<
9061               ? extends
9062                   com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder>
getConditionBoostSpecsOrBuilderList()9063           getConditionBoostSpecsOrBuilderList() {
9064         if (conditionBoostSpecsBuilder_ != null) {
9065           return conditionBoostSpecsBuilder_.getMessageOrBuilderList();
9066         } else {
9067           return java.util.Collections.unmodifiableList(conditionBoostSpecs_);
9068         }
9069       }
9070       /**
9071        *
9072        *
9073        * <pre>
9074        * Condition boost specifications. If a product matches multiple conditions
9075        * in the specifictions, boost scores from these specifications are all
9076        * applied and combined in a non-linear way. Maximum number of
9077        * specifications is 20.
9078        * </pre>
9079        *
9080        * <code>
9081        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
9082        * </code>
9083        */
9084       public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
addConditionBoostSpecsBuilder()9085           addConditionBoostSpecsBuilder() {
9086         return getConditionBoostSpecsFieldBuilder()
9087             .addBuilder(
9088                 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
9089                     .getDefaultInstance());
9090       }
9091       /**
9092        *
9093        *
9094        * <pre>
9095        * Condition boost specifications. If a product matches multiple conditions
9096        * in the specifictions, boost scores from these specifications are all
9097        * applied and combined in a non-linear way. Maximum number of
9098        * specifications is 20.
9099        * </pre>
9100        *
9101        * <code>
9102        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
9103        * </code>
9104        */
9105       public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
addConditionBoostSpecsBuilder(int index)9106           addConditionBoostSpecsBuilder(int index) {
9107         return getConditionBoostSpecsFieldBuilder()
9108             .addBuilder(
9109                 index,
9110                 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
9111                     .getDefaultInstance());
9112       }
9113       /**
9114        *
9115        *
9116        * <pre>
9117        * Condition boost specifications. If a product matches multiple conditions
9118        * in the specifictions, boost scores from these specifications are all
9119        * applied and combined in a non-linear way. Maximum number of
9120        * specifications is 20.
9121        * </pre>
9122        *
9123        * <code>
9124        * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
9125        * </code>
9126        */
9127       public java.util.List<
9128               com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder>
getConditionBoostSpecsBuilderList()9129           getConditionBoostSpecsBuilderList() {
9130         return getConditionBoostSpecsFieldBuilder().getBuilderList();
9131       }
9132 
9133       private com.google.protobuf.RepeatedFieldBuilderV3<
9134               com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec,
9135               com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder,
9136               com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder>
getConditionBoostSpecsFieldBuilder()9137           getConditionBoostSpecsFieldBuilder() {
9138         if (conditionBoostSpecsBuilder_ == null) {
9139           conditionBoostSpecsBuilder_ =
9140               new com.google.protobuf.RepeatedFieldBuilderV3<
9141                   com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec,
9142                   com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder,
9143                   com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder>(
9144                   conditionBoostSpecs_,
9145                   ((bitField0_ & 0x00000001) != 0),
9146                   getParentForChildren(),
9147                   isClean());
9148           conditionBoostSpecs_ = null;
9149         }
9150         return conditionBoostSpecsBuilder_;
9151       }
9152 
9153       private boolean skipBoostSpecValidation_;
9154       /**
9155        *
9156        *
9157        * <pre>
9158        * Whether to skip boostspec validation. If this field is set to true,
9159        * invalid
9160        * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
9161        * will be ignored and valid
9162        * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
9163        * will still be applied.
9164        * </pre>
9165        *
9166        * <code>optional bool skip_boost_spec_validation = 2;</code>
9167        *
9168        * @return Whether the skipBoostSpecValidation field is set.
9169        */
9170       @java.lang.Override
hasSkipBoostSpecValidation()9171       public boolean hasSkipBoostSpecValidation() {
9172         return ((bitField0_ & 0x00000002) != 0);
9173       }
9174       /**
9175        *
9176        *
9177        * <pre>
9178        * Whether to skip boostspec validation. If this field is set to true,
9179        * invalid
9180        * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
9181        * will be ignored and valid
9182        * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
9183        * will still be applied.
9184        * </pre>
9185        *
9186        * <code>optional bool skip_boost_spec_validation = 2;</code>
9187        *
9188        * @return The skipBoostSpecValidation.
9189        */
9190       @java.lang.Override
getSkipBoostSpecValidation()9191       public boolean getSkipBoostSpecValidation() {
9192         return skipBoostSpecValidation_;
9193       }
9194       /**
9195        *
9196        *
9197        * <pre>
9198        * Whether to skip boostspec validation. If this field is set to true,
9199        * invalid
9200        * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
9201        * will be ignored and valid
9202        * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
9203        * will still be applied.
9204        * </pre>
9205        *
9206        * <code>optional bool skip_boost_spec_validation = 2;</code>
9207        *
9208        * @param value The skipBoostSpecValidation to set.
9209        * @return This builder for chaining.
9210        */
setSkipBoostSpecValidation(boolean value)9211       public Builder setSkipBoostSpecValidation(boolean value) {
9212 
9213         skipBoostSpecValidation_ = value;
9214         bitField0_ |= 0x00000002;
9215         onChanged();
9216         return this;
9217       }
9218       /**
9219        *
9220        *
9221        * <pre>
9222        * Whether to skip boostspec validation. If this field is set to true,
9223        * invalid
9224        * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
9225        * will be ignored and valid
9226        * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
9227        * will still be applied.
9228        * </pre>
9229        *
9230        * <code>optional bool skip_boost_spec_validation = 2;</code>
9231        *
9232        * @return This builder for chaining.
9233        */
clearSkipBoostSpecValidation()9234       public Builder clearSkipBoostSpecValidation() {
9235         bitField0_ = (bitField0_ & ~0x00000002);
9236         skipBoostSpecValidation_ = false;
9237         onChanged();
9238         return this;
9239       }
9240 
9241       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)9242       public final Builder setUnknownFields(
9243           final com.google.protobuf.UnknownFieldSet unknownFields) {
9244         return super.setUnknownFields(unknownFields);
9245       }
9246 
9247       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)9248       public final Builder mergeUnknownFields(
9249           final com.google.protobuf.UnknownFieldSet unknownFields) {
9250         return super.mergeUnknownFields(unknownFields);
9251       }
9252 
9253       // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.BoostSpec)
9254     }
9255 
9256     // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.BoostSpec)
9257     private static final com.google.cloud.retail.v2.SearchRequest.BoostSpec DEFAULT_INSTANCE;
9258 
9259     static {
9260       DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.BoostSpec();
9261     }
9262 
getDefaultInstance()9263     public static com.google.cloud.retail.v2.SearchRequest.BoostSpec getDefaultInstance() {
9264       return DEFAULT_INSTANCE;
9265     }
9266 
9267     private static final com.google.protobuf.Parser<BoostSpec> PARSER =
9268         new com.google.protobuf.AbstractParser<BoostSpec>() {
9269           @java.lang.Override
9270           public BoostSpec parsePartialFrom(
9271               com.google.protobuf.CodedInputStream input,
9272               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
9273               throws com.google.protobuf.InvalidProtocolBufferException {
9274             Builder builder = newBuilder();
9275             try {
9276               builder.mergeFrom(input, extensionRegistry);
9277             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
9278               throw e.setUnfinishedMessage(builder.buildPartial());
9279             } catch (com.google.protobuf.UninitializedMessageException e) {
9280               throw e.asInvalidProtocolBufferException()
9281                   .setUnfinishedMessage(builder.buildPartial());
9282             } catch (java.io.IOException e) {
9283               throw new com.google.protobuf.InvalidProtocolBufferException(e)
9284                   .setUnfinishedMessage(builder.buildPartial());
9285             }
9286             return builder.buildPartial();
9287           }
9288         };
9289 
parser()9290     public static com.google.protobuf.Parser<BoostSpec> parser() {
9291       return PARSER;
9292     }
9293 
9294     @java.lang.Override
getParserForType()9295     public com.google.protobuf.Parser<BoostSpec> getParserForType() {
9296       return PARSER;
9297     }
9298 
9299     @java.lang.Override
getDefaultInstanceForType()9300     public com.google.cloud.retail.v2.SearchRequest.BoostSpec getDefaultInstanceForType() {
9301       return DEFAULT_INSTANCE;
9302     }
9303   }
9304 
9305   public interface QueryExpansionSpecOrBuilder
9306       extends
9307       // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec)
9308       com.google.protobuf.MessageOrBuilder {
9309 
9310     /**
9311      *
9312      *
9313      * <pre>
9314      * The condition under which query expansion should occur. Default to
9315      * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
9316      * </pre>
9317      *
9318      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1;
9319      * </code>
9320      *
9321      * @return The enum numeric value on the wire for condition.
9322      */
getConditionValue()9323     int getConditionValue();
9324     /**
9325      *
9326      *
9327      * <pre>
9328      * The condition under which query expansion should occur. Default to
9329      * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
9330      * </pre>
9331      *
9332      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1;
9333      * </code>
9334      *
9335      * @return The condition.
9336      */
getCondition()9337     com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition getCondition();
9338 
9339     /**
9340      *
9341      *
9342      * <pre>
9343      * Whether to pin unexpanded results. If this field is set to true,
9344      * unexpanded products are always at the top of the search results, followed
9345      * by the expanded results.
9346      * </pre>
9347      *
9348      * <code>bool pin_unexpanded_results = 2;</code>
9349      *
9350      * @return The pinUnexpandedResults.
9351      */
getPinUnexpandedResults()9352     boolean getPinUnexpandedResults();
9353   }
9354   /**
9355    *
9356    *
9357    * <pre>
9358    * Specification to determine under which conditions query expansion should
9359    * occur.
9360    * </pre>
9361    *
9362    * Protobuf type {@code google.cloud.retail.v2.SearchRequest.QueryExpansionSpec}
9363    */
9364   public static final class QueryExpansionSpec extends com.google.protobuf.GeneratedMessageV3
9365       implements
9366       // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec)
9367       QueryExpansionSpecOrBuilder {
9368     private static final long serialVersionUID = 0L;
9369     // Use QueryExpansionSpec.newBuilder() to construct.
QueryExpansionSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)9370     private QueryExpansionSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
9371       super(builder);
9372     }
9373 
QueryExpansionSpec()9374     private QueryExpansionSpec() {
9375       condition_ = 0;
9376     }
9377 
9378     @java.lang.Override
9379     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)9380     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
9381       return new QueryExpansionSpec();
9382     }
9383 
9384     @java.lang.Override
getUnknownFields()9385     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
9386       return this.unknownFields;
9387     }
9388 
getDescriptor()9389     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
9390       return com.google.cloud.retail.v2.SearchServiceProto
9391           .internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_descriptor;
9392     }
9393 
9394     @java.lang.Override
9395     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()9396         internalGetFieldAccessorTable() {
9397       return com.google.cloud.retail.v2.SearchServiceProto
9398           .internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_fieldAccessorTable
9399           .ensureFieldAccessorsInitialized(
9400               com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.class,
9401               com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder.class);
9402     }
9403 
9404     /**
9405      *
9406      *
9407      * <pre>
9408      * Enum describing under which condition query expansion should occur.
9409      * </pre>
9410      *
9411      * Protobuf enum {@code google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition}
9412      */
9413     public enum Condition implements com.google.protobuf.ProtocolMessageEnum {
9414       /**
9415        *
9416        *
9417        * <pre>
9418        * Unspecified query expansion condition. In this case, server behavior
9419        * defaults to
9420        * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
9421        * </pre>
9422        *
9423        * <code>CONDITION_UNSPECIFIED = 0;</code>
9424        */
9425       CONDITION_UNSPECIFIED(0),
9426       /**
9427        *
9428        *
9429        * <pre>
9430        * Disabled query expansion. Only the exact search query is used, even if
9431        * [SearchResponse.total_size][google.cloud.retail.v2.SearchResponse.total_size]
9432        * is zero.
9433        * </pre>
9434        *
9435        * <code>DISABLED = 1;</code>
9436        */
9437       DISABLED(1),
9438       /**
9439        *
9440        *
9441        * <pre>
9442        * Automatic query expansion built by Google Retail Search.
9443        * </pre>
9444        *
9445        * <code>AUTO = 3;</code>
9446        */
9447       AUTO(3),
9448       UNRECOGNIZED(-1),
9449       ;
9450 
9451       /**
9452        *
9453        *
9454        * <pre>
9455        * Unspecified query expansion condition. In this case, server behavior
9456        * defaults to
9457        * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
9458        * </pre>
9459        *
9460        * <code>CONDITION_UNSPECIFIED = 0;</code>
9461        */
9462       public static final int CONDITION_UNSPECIFIED_VALUE = 0;
9463       /**
9464        *
9465        *
9466        * <pre>
9467        * Disabled query expansion. Only the exact search query is used, even if
9468        * [SearchResponse.total_size][google.cloud.retail.v2.SearchResponse.total_size]
9469        * is zero.
9470        * </pre>
9471        *
9472        * <code>DISABLED = 1;</code>
9473        */
9474       public static final int DISABLED_VALUE = 1;
9475       /**
9476        *
9477        *
9478        * <pre>
9479        * Automatic query expansion built by Google Retail Search.
9480        * </pre>
9481        *
9482        * <code>AUTO = 3;</code>
9483        */
9484       public static final int AUTO_VALUE = 3;
9485 
getNumber()9486       public final int getNumber() {
9487         if (this == UNRECOGNIZED) {
9488           throw new java.lang.IllegalArgumentException(
9489               "Can't get the number of an unknown enum value.");
9490         }
9491         return value;
9492       }
9493 
9494       /**
9495        * @param value The numeric wire value of the corresponding enum entry.
9496        * @return The enum associated with the given numeric wire value.
9497        * @deprecated Use {@link #forNumber(int)} instead.
9498        */
9499       @java.lang.Deprecated
valueOf(int value)9500       public static Condition valueOf(int value) {
9501         return forNumber(value);
9502       }
9503 
9504       /**
9505        * @param value The numeric wire value of the corresponding enum entry.
9506        * @return The enum associated with the given numeric wire value.
9507        */
forNumber(int value)9508       public static Condition forNumber(int value) {
9509         switch (value) {
9510           case 0:
9511             return CONDITION_UNSPECIFIED;
9512           case 1:
9513             return DISABLED;
9514           case 3:
9515             return AUTO;
9516           default:
9517             return null;
9518         }
9519       }
9520 
internalGetValueMap()9521       public static com.google.protobuf.Internal.EnumLiteMap<Condition> internalGetValueMap() {
9522         return internalValueMap;
9523       }
9524 
9525       private static final com.google.protobuf.Internal.EnumLiteMap<Condition> internalValueMap =
9526           new com.google.protobuf.Internal.EnumLiteMap<Condition>() {
9527             public Condition findValueByNumber(int number) {
9528               return Condition.forNumber(number);
9529             }
9530           };
9531 
getValueDescriptor()9532       public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
9533         if (this == UNRECOGNIZED) {
9534           throw new java.lang.IllegalStateException(
9535               "Can't get the descriptor of an unrecognized enum value.");
9536         }
9537         return getDescriptor().getValues().get(ordinal());
9538       }
9539 
getDescriptorForType()9540       public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
9541         return getDescriptor();
9542       }
9543 
getDescriptor()9544       public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
9545         return com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDescriptor()
9546             .getEnumTypes()
9547             .get(0);
9548       }
9549 
9550       private static final Condition[] VALUES = values();
9551 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)9552       public static Condition valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
9553         if (desc.getType() != getDescriptor()) {
9554           throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
9555         }
9556         if (desc.getIndex() == -1) {
9557           return UNRECOGNIZED;
9558         }
9559         return VALUES[desc.getIndex()];
9560       }
9561 
9562       private final int value;
9563 
Condition(int value)9564       private Condition(int value) {
9565         this.value = value;
9566       }
9567 
9568       // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition)
9569     }
9570 
9571     public static final int CONDITION_FIELD_NUMBER = 1;
9572     private int condition_ = 0;
9573     /**
9574      *
9575      *
9576      * <pre>
9577      * The condition under which query expansion should occur. Default to
9578      * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
9579      * </pre>
9580      *
9581      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1;
9582      * </code>
9583      *
9584      * @return The enum numeric value on the wire for condition.
9585      */
9586     @java.lang.Override
getConditionValue()9587     public int getConditionValue() {
9588       return condition_;
9589     }
9590     /**
9591      *
9592      *
9593      * <pre>
9594      * The condition under which query expansion should occur. Default to
9595      * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
9596      * </pre>
9597      *
9598      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1;
9599      * </code>
9600      *
9601      * @return The condition.
9602      */
9603     @java.lang.Override
getCondition()9604     public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition getCondition() {
9605       com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition result =
9606           com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.forNumber(
9607               condition_);
9608       return result == null
9609           ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.UNRECOGNIZED
9610           : result;
9611     }
9612 
9613     public static final int PIN_UNEXPANDED_RESULTS_FIELD_NUMBER = 2;
9614     private boolean pinUnexpandedResults_ = false;
9615     /**
9616      *
9617      *
9618      * <pre>
9619      * Whether to pin unexpanded results. If this field is set to true,
9620      * unexpanded products are always at the top of the search results, followed
9621      * by the expanded results.
9622      * </pre>
9623      *
9624      * <code>bool pin_unexpanded_results = 2;</code>
9625      *
9626      * @return The pinUnexpandedResults.
9627      */
9628     @java.lang.Override
getPinUnexpandedResults()9629     public boolean getPinUnexpandedResults() {
9630       return pinUnexpandedResults_;
9631     }
9632 
9633     private byte memoizedIsInitialized = -1;
9634 
9635     @java.lang.Override
isInitialized()9636     public final boolean isInitialized() {
9637       byte isInitialized = memoizedIsInitialized;
9638       if (isInitialized == 1) return true;
9639       if (isInitialized == 0) return false;
9640 
9641       memoizedIsInitialized = 1;
9642       return true;
9643     }
9644 
9645     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)9646     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
9647       if (condition_
9648           != com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition
9649               .CONDITION_UNSPECIFIED
9650               .getNumber()) {
9651         output.writeEnum(1, condition_);
9652       }
9653       if (pinUnexpandedResults_ != false) {
9654         output.writeBool(2, pinUnexpandedResults_);
9655       }
9656       getUnknownFields().writeTo(output);
9657     }
9658 
9659     @java.lang.Override
getSerializedSize()9660     public int getSerializedSize() {
9661       int size = memoizedSize;
9662       if (size != -1) return size;
9663 
9664       size = 0;
9665       if (condition_
9666           != com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition
9667               .CONDITION_UNSPECIFIED
9668               .getNumber()) {
9669         size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, condition_);
9670       }
9671       if (pinUnexpandedResults_ != false) {
9672         size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, pinUnexpandedResults_);
9673       }
9674       size += getUnknownFields().getSerializedSize();
9675       memoizedSize = size;
9676       return size;
9677     }
9678 
9679     @java.lang.Override
equals(final java.lang.Object obj)9680     public boolean equals(final java.lang.Object obj) {
9681       if (obj == this) {
9682         return true;
9683       }
9684       if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec)) {
9685         return super.equals(obj);
9686       }
9687       com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec other =
9688           (com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) obj;
9689 
9690       if (condition_ != other.condition_) return false;
9691       if (getPinUnexpandedResults() != other.getPinUnexpandedResults()) return false;
9692       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
9693       return true;
9694     }
9695 
9696     @java.lang.Override
hashCode()9697     public int hashCode() {
9698       if (memoizedHashCode != 0) {
9699         return memoizedHashCode;
9700       }
9701       int hash = 41;
9702       hash = (19 * hash) + getDescriptor().hashCode();
9703       hash = (37 * hash) + CONDITION_FIELD_NUMBER;
9704       hash = (53 * hash) + condition_;
9705       hash = (37 * hash) + PIN_UNEXPANDED_RESULTS_FIELD_NUMBER;
9706       hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPinUnexpandedResults());
9707       hash = (29 * hash) + getUnknownFields().hashCode();
9708       memoizedHashCode = hash;
9709       return hash;
9710     }
9711 
parseFrom( java.nio.ByteBuffer data)9712     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(
9713         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
9714       return PARSER.parseFrom(data);
9715     }
9716 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)9717     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(
9718         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
9719         throws com.google.protobuf.InvalidProtocolBufferException {
9720       return PARSER.parseFrom(data, extensionRegistry);
9721     }
9722 
parseFrom( com.google.protobuf.ByteString data)9723     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(
9724         com.google.protobuf.ByteString data)
9725         throws com.google.protobuf.InvalidProtocolBufferException {
9726       return PARSER.parseFrom(data);
9727     }
9728 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)9729     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(
9730         com.google.protobuf.ByteString data,
9731         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
9732         throws com.google.protobuf.InvalidProtocolBufferException {
9733       return PARSER.parseFrom(data, extensionRegistry);
9734     }
9735 
parseFrom(byte[] data)9736     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(byte[] data)
9737         throws com.google.protobuf.InvalidProtocolBufferException {
9738       return PARSER.parseFrom(data);
9739     }
9740 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)9741     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(
9742         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
9743         throws com.google.protobuf.InvalidProtocolBufferException {
9744       return PARSER.parseFrom(data, extensionRegistry);
9745     }
9746 
parseFrom( java.io.InputStream input)9747     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(
9748         java.io.InputStream input) throws java.io.IOException {
9749       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
9750     }
9751 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)9752     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(
9753         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
9754         throws java.io.IOException {
9755       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
9756           PARSER, input, extensionRegistry);
9757     }
9758 
parseDelimitedFrom( java.io.InputStream input)9759     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseDelimitedFrom(
9760         java.io.InputStream input) throws java.io.IOException {
9761       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
9762     }
9763 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)9764     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseDelimitedFrom(
9765         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
9766         throws java.io.IOException {
9767       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
9768           PARSER, input, extensionRegistry);
9769     }
9770 
parseFrom( com.google.protobuf.CodedInputStream input)9771     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(
9772         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
9773       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
9774     }
9775 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)9776     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(
9777         com.google.protobuf.CodedInputStream input,
9778         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
9779         throws java.io.IOException {
9780       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
9781           PARSER, input, extensionRegistry);
9782     }
9783 
9784     @java.lang.Override
newBuilderForType()9785     public Builder newBuilderForType() {
9786       return newBuilder();
9787     }
9788 
newBuilder()9789     public static Builder newBuilder() {
9790       return DEFAULT_INSTANCE.toBuilder();
9791     }
9792 
newBuilder( com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec prototype)9793     public static Builder newBuilder(
9794         com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec prototype) {
9795       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
9796     }
9797 
9798     @java.lang.Override
toBuilder()9799     public Builder toBuilder() {
9800       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
9801     }
9802 
9803     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)9804     protected Builder newBuilderForType(
9805         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
9806       Builder builder = new Builder(parent);
9807       return builder;
9808     }
9809     /**
9810      *
9811      *
9812      * <pre>
9813      * Specification to determine under which conditions query expansion should
9814      * occur.
9815      * </pre>
9816      *
9817      * Protobuf type {@code google.cloud.retail.v2.SearchRequest.QueryExpansionSpec}
9818      */
9819     public static final class Builder
9820         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
9821         implements
9822         // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec)
9823         com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder {
getDescriptor()9824       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
9825         return com.google.cloud.retail.v2.SearchServiceProto
9826             .internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_descriptor;
9827       }
9828 
9829       @java.lang.Override
9830       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()9831           internalGetFieldAccessorTable() {
9832         return com.google.cloud.retail.v2.SearchServiceProto
9833             .internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_fieldAccessorTable
9834             .ensureFieldAccessorsInitialized(
9835                 com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.class,
9836                 com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder.class);
9837       }
9838 
9839       // Construct using com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.newBuilder()
Builder()9840       private Builder() {}
9841 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)9842       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
9843         super(parent);
9844       }
9845 
9846       @java.lang.Override
clear()9847       public Builder clear() {
9848         super.clear();
9849         bitField0_ = 0;
9850         condition_ = 0;
9851         pinUnexpandedResults_ = false;
9852         return this;
9853       }
9854 
9855       @java.lang.Override
getDescriptorForType()9856       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
9857         return com.google.cloud.retail.v2.SearchServiceProto
9858             .internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_descriptor;
9859       }
9860 
9861       @java.lang.Override
9862       public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec
getDefaultInstanceForType()9863           getDefaultInstanceForType() {
9864         return com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance();
9865       }
9866 
9867       @java.lang.Override
build()9868       public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec build() {
9869         com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec result = buildPartial();
9870         if (!result.isInitialized()) {
9871           throw newUninitializedMessageException(result);
9872         }
9873         return result;
9874       }
9875 
9876       @java.lang.Override
buildPartial()9877       public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec buildPartial() {
9878         com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec result =
9879             new com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec(this);
9880         if (bitField0_ != 0) {
9881           buildPartial0(result);
9882         }
9883         onBuilt();
9884         return result;
9885       }
9886 
buildPartial0( com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec result)9887       private void buildPartial0(
9888           com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec result) {
9889         int from_bitField0_ = bitField0_;
9890         if (((from_bitField0_ & 0x00000001) != 0)) {
9891           result.condition_ = condition_;
9892         }
9893         if (((from_bitField0_ & 0x00000002) != 0)) {
9894           result.pinUnexpandedResults_ = pinUnexpandedResults_;
9895         }
9896       }
9897 
9898       @java.lang.Override
clone()9899       public Builder clone() {
9900         return super.clone();
9901       }
9902 
9903       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)9904       public Builder setField(
9905           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
9906         return super.setField(field, value);
9907       }
9908 
9909       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)9910       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
9911         return super.clearField(field);
9912       }
9913 
9914       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)9915       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
9916         return super.clearOneof(oneof);
9917       }
9918 
9919       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)9920       public Builder setRepeatedField(
9921           com.google.protobuf.Descriptors.FieldDescriptor field,
9922           int index,
9923           java.lang.Object value) {
9924         return super.setRepeatedField(field, index, value);
9925       }
9926 
9927       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)9928       public Builder addRepeatedField(
9929           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
9930         return super.addRepeatedField(field, value);
9931       }
9932 
9933       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)9934       public Builder mergeFrom(com.google.protobuf.Message other) {
9935         if (other instanceof com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) {
9936           return mergeFrom((com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) other);
9937         } else {
9938           super.mergeFrom(other);
9939           return this;
9940         }
9941       }
9942 
mergeFrom(com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec other)9943       public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec other) {
9944         if (other
9945             == com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance())
9946           return this;
9947         if (other.condition_ != 0) {
9948           setConditionValue(other.getConditionValue());
9949         }
9950         if (other.getPinUnexpandedResults() != false) {
9951           setPinUnexpandedResults(other.getPinUnexpandedResults());
9952         }
9953         this.mergeUnknownFields(other.getUnknownFields());
9954         onChanged();
9955         return this;
9956       }
9957 
9958       @java.lang.Override
isInitialized()9959       public final boolean isInitialized() {
9960         return true;
9961       }
9962 
9963       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)9964       public Builder mergeFrom(
9965           com.google.protobuf.CodedInputStream input,
9966           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
9967           throws java.io.IOException {
9968         if (extensionRegistry == null) {
9969           throw new java.lang.NullPointerException();
9970         }
9971         try {
9972           boolean done = false;
9973           while (!done) {
9974             int tag = input.readTag();
9975             switch (tag) {
9976               case 0:
9977                 done = true;
9978                 break;
9979               case 8:
9980                 {
9981                   condition_ = input.readEnum();
9982                   bitField0_ |= 0x00000001;
9983                   break;
9984                 } // case 8
9985               case 16:
9986                 {
9987                   pinUnexpandedResults_ = input.readBool();
9988                   bitField0_ |= 0x00000002;
9989                   break;
9990                 } // case 16
9991               default:
9992                 {
9993                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
9994                     done = true; // was an endgroup tag
9995                   }
9996                   break;
9997                 } // default:
9998             } // switch (tag)
9999           } // while (!done)
10000         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
10001           throw e.unwrapIOException();
10002         } finally {
10003           onChanged();
10004         } // finally
10005         return this;
10006       }
10007 
10008       private int bitField0_;
10009 
10010       private int condition_ = 0;
10011       /**
10012        *
10013        *
10014        * <pre>
10015        * The condition under which query expansion should occur. Default to
10016        * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
10017        * </pre>
10018        *
10019        * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1;
10020        * </code>
10021        *
10022        * @return The enum numeric value on the wire for condition.
10023        */
10024       @java.lang.Override
getConditionValue()10025       public int getConditionValue() {
10026         return condition_;
10027       }
10028       /**
10029        *
10030        *
10031        * <pre>
10032        * The condition under which query expansion should occur. Default to
10033        * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
10034        * </pre>
10035        *
10036        * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1;
10037        * </code>
10038        *
10039        * @param value The enum numeric value on the wire for condition to set.
10040        * @return This builder for chaining.
10041        */
setConditionValue(int value)10042       public Builder setConditionValue(int value) {
10043         condition_ = value;
10044         bitField0_ |= 0x00000001;
10045         onChanged();
10046         return this;
10047       }
10048       /**
10049        *
10050        *
10051        * <pre>
10052        * The condition under which query expansion should occur. Default to
10053        * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
10054        * </pre>
10055        *
10056        * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1;
10057        * </code>
10058        *
10059        * @return The condition.
10060        */
10061       @java.lang.Override
getCondition()10062       public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition getCondition() {
10063         com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition result =
10064             com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.forNumber(
10065                 condition_);
10066         return result == null
10067             ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.UNRECOGNIZED
10068             : result;
10069       }
10070       /**
10071        *
10072        *
10073        * <pre>
10074        * The condition under which query expansion should occur. Default to
10075        * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
10076        * </pre>
10077        *
10078        * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1;
10079        * </code>
10080        *
10081        * @param value The condition to set.
10082        * @return This builder for chaining.
10083        */
setCondition( com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition value)10084       public Builder setCondition(
10085           com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition value) {
10086         if (value == null) {
10087           throw new NullPointerException();
10088         }
10089         bitField0_ |= 0x00000001;
10090         condition_ = value.getNumber();
10091         onChanged();
10092         return this;
10093       }
10094       /**
10095        *
10096        *
10097        * <pre>
10098        * The condition under which query expansion should occur. Default to
10099        * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
10100        * </pre>
10101        *
10102        * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1;
10103        * </code>
10104        *
10105        * @return This builder for chaining.
10106        */
clearCondition()10107       public Builder clearCondition() {
10108         bitField0_ = (bitField0_ & ~0x00000001);
10109         condition_ = 0;
10110         onChanged();
10111         return this;
10112       }
10113 
10114       private boolean pinUnexpandedResults_;
10115       /**
10116        *
10117        *
10118        * <pre>
10119        * Whether to pin unexpanded results. If this field is set to true,
10120        * unexpanded products are always at the top of the search results, followed
10121        * by the expanded results.
10122        * </pre>
10123        *
10124        * <code>bool pin_unexpanded_results = 2;</code>
10125        *
10126        * @return The pinUnexpandedResults.
10127        */
10128       @java.lang.Override
getPinUnexpandedResults()10129       public boolean getPinUnexpandedResults() {
10130         return pinUnexpandedResults_;
10131       }
10132       /**
10133        *
10134        *
10135        * <pre>
10136        * Whether to pin unexpanded results. If this field is set to true,
10137        * unexpanded products are always at the top of the search results, followed
10138        * by the expanded results.
10139        * </pre>
10140        *
10141        * <code>bool pin_unexpanded_results = 2;</code>
10142        *
10143        * @param value The pinUnexpandedResults to set.
10144        * @return This builder for chaining.
10145        */
setPinUnexpandedResults(boolean value)10146       public Builder setPinUnexpandedResults(boolean value) {
10147 
10148         pinUnexpandedResults_ = value;
10149         bitField0_ |= 0x00000002;
10150         onChanged();
10151         return this;
10152       }
10153       /**
10154        *
10155        *
10156        * <pre>
10157        * Whether to pin unexpanded results. If this field is set to true,
10158        * unexpanded products are always at the top of the search results, followed
10159        * by the expanded results.
10160        * </pre>
10161        *
10162        * <code>bool pin_unexpanded_results = 2;</code>
10163        *
10164        * @return This builder for chaining.
10165        */
clearPinUnexpandedResults()10166       public Builder clearPinUnexpandedResults() {
10167         bitField0_ = (bitField0_ & ~0x00000002);
10168         pinUnexpandedResults_ = false;
10169         onChanged();
10170         return this;
10171       }
10172 
10173       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)10174       public final Builder setUnknownFields(
10175           final com.google.protobuf.UnknownFieldSet unknownFields) {
10176         return super.setUnknownFields(unknownFields);
10177       }
10178 
10179       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)10180       public final Builder mergeUnknownFields(
10181           final com.google.protobuf.UnknownFieldSet unknownFields) {
10182         return super.mergeUnknownFields(unknownFields);
10183       }
10184 
10185       // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec)
10186     }
10187 
10188     // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec)
10189     private static final com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec
10190         DEFAULT_INSTANCE;
10191 
10192     static {
10193       DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec();
10194     }
10195 
getDefaultInstance()10196     public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec getDefaultInstance() {
10197       return DEFAULT_INSTANCE;
10198     }
10199 
10200     private static final com.google.protobuf.Parser<QueryExpansionSpec> PARSER =
10201         new com.google.protobuf.AbstractParser<QueryExpansionSpec>() {
10202           @java.lang.Override
10203           public QueryExpansionSpec parsePartialFrom(
10204               com.google.protobuf.CodedInputStream input,
10205               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
10206               throws com.google.protobuf.InvalidProtocolBufferException {
10207             Builder builder = newBuilder();
10208             try {
10209               builder.mergeFrom(input, extensionRegistry);
10210             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
10211               throw e.setUnfinishedMessage(builder.buildPartial());
10212             } catch (com.google.protobuf.UninitializedMessageException e) {
10213               throw e.asInvalidProtocolBufferException()
10214                   .setUnfinishedMessage(builder.buildPartial());
10215             } catch (java.io.IOException e) {
10216               throw new com.google.protobuf.InvalidProtocolBufferException(e)
10217                   .setUnfinishedMessage(builder.buildPartial());
10218             }
10219             return builder.buildPartial();
10220           }
10221         };
10222 
parser()10223     public static com.google.protobuf.Parser<QueryExpansionSpec> parser() {
10224       return PARSER;
10225     }
10226 
10227     @java.lang.Override
getParserForType()10228     public com.google.protobuf.Parser<QueryExpansionSpec> getParserForType() {
10229       return PARSER;
10230     }
10231 
10232     @java.lang.Override
getDefaultInstanceForType()10233     public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec getDefaultInstanceForType() {
10234       return DEFAULT_INSTANCE;
10235     }
10236   }
10237 
10238   public interface PersonalizationSpecOrBuilder
10239       extends
10240       // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.PersonalizationSpec)
10241       com.google.protobuf.MessageOrBuilder {
10242 
10243     /**
10244      *
10245      *
10246      * <pre>
10247      * Defaults to
10248      * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10249      * </pre>
10250      *
10251      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1;</code>
10252      *
10253      * @return The enum numeric value on the wire for mode.
10254      */
getModeValue()10255     int getModeValue();
10256     /**
10257      *
10258      *
10259      * <pre>
10260      * Defaults to
10261      * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10262      * </pre>
10263      *
10264      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1;</code>
10265      *
10266      * @return The mode.
10267      */
getMode()10268     com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode getMode();
10269   }
10270   /**
10271    *
10272    *
10273    * <pre>
10274    * The specification for personalization.
10275    * </pre>
10276    *
10277    * Protobuf type {@code google.cloud.retail.v2.SearchRequest.PersonalizationSpec}
10278    */
10279   public static final class PersonalizationSpec extends com.google.protobuf.GeneratedMessageV3
10280       implements
10281       // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.PersonalizationSpec)
10282       PersonalizationSpecOrBuilder {
10283     private static final long serialVersionUID = 0L;
10284     // Use PersonalizationSpec.newBuilder() to construct.
PersonalizationSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)10285     private PersonalizationSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
10286       super(builder);
10287     }
10288 
PersonalizationSpec()10289     private PersonalizationSpec() {
10290       mode_ = 0;
10291     }
10292 
10293     @java.lang.Override
10294     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)10295     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
10296       return new PersonalizationSpec();
10297     }
10298 
10299     @java.lang.Override
getUnknownFields()10300     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
10301       return this.unknownFields;
10302     }
10303 
getDescriptor()10304     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
10305       return com.google.cloud.retail.v2.SearchServiceProto
10306           .internal_static_google_cloud_retail_v2_SearchRequest_PersonalizationSpec_descriptor;
10307     }
10308 
10309     @java.lang.Override
10310     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()10311         internalGetFieldAccessorTable() {
10312       return com.google.cloud.retail.v2.SearchServiceProto
10313           .internal_static_google_cloud_retail_v2_SearchRequest_PersonalizationSpec_fieldAccessorTable
10314           .ensureFieldAccessorsInitialized(
10315               com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.class,
10316               com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Builder.class);
10317     }
10318 
10319     /**
10320      *
10321      *
10322      * <pre>
10323      * The personalization mode of each search request.
10324      * </pre>
10325      *
10326      * Protobuf enum {@code google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode}
10327      */
10328     public enum Mode implements com.google.protobuf.ProtocolMessageEnum {
10329       /**
10330        *
10331        *
10332        * <pre>
10333        * Default value. In this case, server behavior defaults to
10334        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10335        * </pre>
10336        *
10337        * <code>MODE_UNSPECIFIED = 0;</code>
10338        */
10339       MODE_UNSPECIFIED(0),
10340       /**
10341        *
10342        *
10343        * <pre>
10344        * Let CRS decide whether to use personalization based on quality of user
10345        * event data.
10346        * </pre>
10347        *
10348        * <code>AUTO = 1;</code>
10349        */
10350       AUTO(1),
10351       /**
10352        *
10353        *
10354        * <pre>
10355        * Disable personalization.
10356        * </pre>
10357        *
10358        * <code>DISABLED = 2;</code>
10359        */
10360       DISABLED(2),
10361       UNRECOGNIZED(-1),
10362       ;
10363 
10364       /**
10365        *
10366        *
10367        * <pre>
10368        * Default value. In this case, server behavior defaults to
10369        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10370        * </pre>
10371        *
10372        * <code>MODE_UNSPECIFIED = 0;</code>
10373        */
10374       public static final int MODE_UNSPECIFIED_VALUE = 0;
10375       /**
10376        *
10377        *
10378        * <pre>
10379        * Let CRS decide whether to use personalization based on quality of user
10380        * event data.
10381        * </pre>
10382        *
10383        * <code>AUTO = 1;</code>
10384        */
10385       public static final int AUTO_VALUE = 1;
10386       /**
10387        *
10388        *
10389        * <pre>
10390        * Disable personalization.
10391        * </pre>
10392        *
10393        * <code>DISABLED = 2;</code>
10394        */
10395       public static final int DISABLED_VALUE = 2;
10396 
getNumber()10397       public final int getNumber() {
10398         if (this == UNRECOGNIZED) {
10399           throw new java.lang.IllegalArgumentException(
10400               "Can't get the number of an unknown enum value.");
10401         }
10402         return value;
10403       }
10404 
10405       /**
10406        * @param value The numeric wire value of the corresponding enum entry.
10407        * @return The enum associated with the given numeric wire value.
10408        * @deprecated Use {@link #forNumber(int)} instead.
10409        */
10410       @java.lang.Deprecated
valueOf(int value)10411       public static Mode valueOf(int value) {
10412         return forNumber(value);
10413       }
10414 
10415       /**
10416        * @param value The numeric wire value of the corresponding enum entry.
10417        * @return The enum associated with the given numeric wire value.
10418        */
forNumber(int value)10419       public static Mode forNumber(int value) {
10420         switch (value) {
10421           case 0:
10422             return MODE_UNSPECIFIED;
10423           case 1:
10424             return AUTO;
10425           case 2:
10426             return DISABLED;
10427           default:
10428             return null;
10429         }
10430       }
10431 
internalGetValueMap()10432       public static com.google.protobuf.Internal.EnumLiteMap<Mode> internalGetValueMap() {
10433         return internalValueMap;
10434       }
10435 
10436       private static final com.google.protobuf.Internal.EnumLiteMap<Mode> internalValueMap =
10437           new com.google.protobuf.Internal.EnumLiteMap<Mode>() {
10438             public Mode findValueByNumber(int number) {
10439               return Mode.forNumber(number);
10440             }
10441           };
10442 
getValueDescriptor()10443       public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
10444         if (this == UNRECOGNIZED) {
10445           throw new java.lang.IllegalStateException(
10446               "Can't get the descriptor of an unrecognized enum value.");
10447         }
10448         return getDescriptor().getValues().get(ordinal());
10449       }
10450 
getDescriptorForType()10451       public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
10452         return getDescriptor();
10453       }
10454 
getDescriptor()10455       public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
10456         return com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.getDescriptor()
10457             .getEnumTypes()
10458             .get(0);
10459       }
10460 
10461       private static final Mode[] VALUES = values();
10462 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)10463       public static Mode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
10464         if (desc.getType() != getDescriptor()) {
10465           throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
10466         }
10467         if (desc.getIndex() == -1) {
10468           return UNRECOGNIZED;
10469         }
10470         return VALUES[desc.getIndex()];
10471       }
10472 
10473       private final int value;
10474 
Mode(int value)10475       private Mode(int value) {
10476         this.value = value;
10477       }
10478 
10479       // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode)
10480     }
10481 
10482     public static final int MODE_FIELD_NUMBER = 1;
10483     private int mode_ = 0;
10484     /**
10485      *
10486      *
10487      * <pre>
10488      * Defaults to
10489      * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10490      * </pre>
10491      *
10492      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1;</code>
10493      *
10494      * @return The enum numeric value on the wire for mode.
10495      */
10496     @java.lang.Override
getModeValue()10497     public int getModeValue() {
10498       return mode_;
10499     }
10500     /**
10501      *
10502      *
10503      * <pre>
10504      * Defaults to
10505      * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10506      * </pre>
10507      *
10508      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1;</code>
10509      *
10510      * @return The mode.
10511      */
10512     @java.lang.Override
getMode()10513     public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode getMode() {
10514       com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode result =
10515           com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.forNumber(mode_);
10516       return result == null
10517           ? com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.UNRECOGNIZED
10518           : result;
10519     }
10520 
10521     private byte memoizedIsInitialized = -1;
10522 
10523     @java.lang.Override
isInitialized()10524     public final boolean isInitialized() {
10525       byte isInitialized = memoizedIsInitialized;
10526       if (isInitialized == 1) return true;
10527       if (isInitialized == 0) return false;
10528 
10529       memoizedIsInitialized = 1;
10530       return true;
10531     }
10532 
10533     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)10534     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
10535       if (mode_
10536           != com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.MODE_UNSPECIFIED
10537               .getNumber()) {
10538         output.writeEnum(1, mode_);
10539       }
10540       getUnknownFields().writeTo(output);
10541     }
10542 
10543     @java.lang.Override
getSerializedSize()10544     public int getSerializedSize() {
10545       int size = memoizedSize;
10546       if (size != -1) return size;
10547 
10548       size = 0;
10549       if (mode_
10550           != com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.MODE_UNSPECIFIED
10551               .getNumber()) {
10552         size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_);
10553       }
10554       size += getUnknownFields().getSerializedSize();
10555       memoizedSize = size;
10556       return size;
10557     }
10558 
10559     @java.lang.Override
equals(final java.lang.Object obj)10560     public boolean equals(final java.lang.Object obj) {
10561       if (obj == this) {
10562         return true;
10563       }
10564       if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec)) {
10565         return super.equals(obj);
10566       }
10567       com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec other =
10568           (com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec) obj;
10569 
10570       if (mode_ != other.mode_) return false;
10571       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
10572       return true;
10573     }
10574 
10575     @java.lang.Override
hashCode()10576     public int hashCode() {
10577       if (memoizedHashCode != 0) {
10578         return memoizedHashCode;
10579       }
10580       int hash = 41;
10581       hash = (19 * hash) + getDescriptor().hashCode();
10582       hash = (37 * hash) + MODE_FIELD_NUMBER;
10583       hash = (53 * hash) + mode_;
10584       hash = (29 * hash) + getUnknownFields().hashCode();
10585       memoizedHashCode = hash;
10586       return hash;
10587     }
10588 
parseFrom( java.nio.ByteBuffer data)10589     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseFrom(
10590         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
10591       return PARSER.parseFrom(data);
10592     }
10593 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)10594     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseFrom(
10595         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
10596         throws com.google.protobuf.InvalidProtocolBufferException {
10597       return PARSER.parseFrom(data, extensionRegistry);
10598     }
10599 
parseFrom( com.google.protobuf.ByteString data)10600     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseFrom(
10601         com.google.protobuf.ByteString data)
10602         throws com.google.protobuf.InvalidProtocolBufferException {
10603       return PARSER.parseFrom(data);
10604     }
10605 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)10606     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseFrom(
10607         com.google.protobuf.ByteString data,
10608         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
10609         throws com.google.protobuf.InvalidProtocolBufferException {
10610       return PARSER.parseFrom(data, extensionRegistry);
10611     }
10612 
parseFrom( byte[] data)10613     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseFrom(
10614         byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
10615       return PARSER.parseFrom(data);
10616     }
10617 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)10618     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseFrom(
10619         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
10620         throws com.google.protobuf.InvalidProtocolBufferException {
10621       return PARSER.parseFrom(data, extensionRegistry);
10622     }
10623 
parseFrom( java.io.InputStream input)10624     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseFrom(
10625         java.io.InputStream input) throws java.io.IOException {
10626       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
10627     }
10628 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)10629     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseFrom(
10630         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
10631         throws java.io.IOException {
10632       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
10633           PARSER, input, extensionRegistry);
10634     }
10635 
parseDelimitedFrom( java.io.InputStream input)10636     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseDelimitedFrom(
10637         java.io.InputStream input) throws java.io.IOException {
10638       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
10639     }
10640 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)10641     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseDelimitedFrom(
10642         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
10643         throws java.io.IOException {
10644       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
10645           PARSER, input, extensionRegistry);
10646     }
10647 
parseFrom( com.google.protobuf.CodedInputStream input)10648     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseFrom(
10649         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
10650       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
10651     }
10652 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)10653     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec parseFrom(
10654         com.google.protobuf.CodedInputStream input,
10655         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
10656         throws java.io.IOException {
10657       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
10658           PARSER, input, extensionRegistry);
10659     }
10660 
10661     @java.lang.Override
newBuilderForType()10662     public Builder newBuilderForType() {
10663       return newBuilder();
10664     }
10665 
newBuilder()10666     public static Builder newBuilder() {
10667       return DEFAULT_INSTANCE.toBuilder();
10668     }
10669 
newBuilder( com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec prototype)10670     public static Builder newBuilder(
10671         com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec prototype) {
10672       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
10673     }
10674 
10675     @java.lang.Override
toBuilder()10676     public Builder toBuilder() {
10677       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
10678     }
10679 
10680     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)10681     protected Builder newBuilderForType(
10682         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
10683       Builder builder = new Builder(parent);
10684       return builder;
10685     }
10686     /**
10687      *
10688      *
10689      * <pre>
10690      * The specification for personalization.
10691      * </pre>
10692      *
10693      * Protobuf type {@code google.cloud.retail.v2.SearchRequest.PersonalizationSpec}
10694      */
10695     public static final class Builder
10696         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
10697         implements
10698         // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.PersonalizationSpec)
10699         com.google.cloud.retail.v2.SearchRequest.PersonalizationSpecOrBuilder {
getDescriptor()10700       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
10701         return com.google.cloud.retail.v2.SearchServiceProto
10702             .internal_static_google_cloud_retail_v2_SearchRequest_PersonalizationSpec_descriptor;
10703       }
10704 
10705       @java.lang.Override
10706       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()10707           internalGetFieldAccessorTable() {
10708         return com.google.cloud.retail.v2.SearchServiceProto
10709             .internal_static_google_cloud_retail_v2_SearchRequest_PersonalizationSpec_fieldAccessorTable
10710             .ensureFieldAccessorsInitialized(
10711                 com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.class,
10712                 com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Builder.class);
10713       }
10714 
10715       // Construct using com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.newBuilder()
Builder()10716       private Builder() {}
10717 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)10718       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
10719         super(parent);
10720       }
10721 
10722       @java.lang.Override
clear()10723       public Builder clear() {
10724         super.clear();
10725         bitField0_ = 0;
10726         mode_ = 0;
10727         return this;
10728       }
10729 
10730       @java.lang.Override
getDescriptorForType()10731       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
10732         return com.google.cloud.retail.v2.SearchServiceProto
10733             .internal_static_google_cloud_retail_v2_SearchRequest_PersonalizationSpec_descriptor;
10734       }
10735 
10736       @java.lang.Override
10737       public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec
getDefaultInstanceForType()10738           getDefaultInstanceForType() {
10739         return com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.getDefaultInstance();
10740       }
10741 
10742       @java.lang.Override
build()10743       public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec build() {
10744         com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec result = buildPartial();
10745         if (!result.isInitialized()) {
10746           throw newUninitializedMessageException(result);
10747         }
10748         return result;
10749       }
10750 
10751       @java.lang.Override
buildPartial()10752       public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec buildPartial() {
10753         com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec result =
10754             new com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec(this);
10755         if (bitField0_ != 0) {
10756           buildPartial0(result);
10757         }
10758         onBuilt();
10759         return result;
10760       }
10761 
buildPartial0( com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec result)10762       private void buildPartial0(
10763           com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec result) {
10764         int from_bitField0_ = bitField0_;
10765         if (((from_bitField0_ & 0x00000001) != 0)) {
10766           result.mode_ = mode_;
10767         }
10768       }
10769 
10770       @java.lang.Override
clone()10771       public Builder clone() {
10772         return super.clone();
10773       }
10774 
10775       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)10776       public Builder setField(
10777           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
10778         return super.setField(field, value);
10779       }
10780 
10781       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)10782       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
10783         return super.clearField(field);
10784       }
10785 
10786       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)10787       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
10788         return super.clearOneof(oneof);
10789       }
10790 
10791       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)10792       public Builder setRepeatedField(
10793           com.google.protobuf.Descriptors.FieldDescriptor field,
10794           int index,
10795           java.lang.Object value) {
10796         return super.setRepeatedField(field, index, value);
10797       }
10798 
10799       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)10800       public Builder addRepeatedField(
10801           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
10802         return super.addRepeatedField(field, value);
10803       }
10804 
10805       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)10806       public Builder mergeFrom(com.google.protobuf.Message other) {
10807         if (other instanceof com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec) {
10808           return mergeFrom((com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec) other);
10809         } else {
10810           super.mergeFrom(other);
10811           return this;
10812         }
10813       }
10814 
mergeFrom(com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec other)10815       public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec other) {
10816         if (other
10817             == com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.getDefaultInstance())
10818           return this;
10819         if (other.mode_ != 0) {
10820           setModeValue(other.getModeValue());
10821         }
10822         this.mergeUnknownFields(other.getUnknownFields());
10823         onChanged();
10824         return this;
10825       }
10826 
10827       @java.lang.Override
isInitialized()10828       public final boolean isInitialized() {
10829         return true;
10830       }
10831 
10832       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)10833       public Builder mergeFrom(
10834           com.google.protobuf.CodedInputStream input,
10835           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
10836           throws java.io.IOException {
10837         if (extensionRegistry == null) {
10838           throw new java.lang.NullPointerException();
10839         }
10840         try {
10841           boolean done = false;
10842           while (!done) {
10843             int tag = input.readTag();
10844             switch (tag) {
10845               case 0:
10846                 done = true;
10847                 break;
10848               case 8:
10849                 {
10850                   mode_ = input.readEnum();
10851                   bitField0_ |= 0x00000001;
10852                   break;
10853                 } // case 8
10854               default:
10855                 {
10856                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
10857                     done = true; // was an endgroup tag
10858                   }
10859                   break;
10860                 } // default:
10861             } // switch (tag)
10862           } // while (!done)
10863         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
10864           throw e.unwrapIOException();
10865         } finally {
10866           onChanged();
10867         } // finally
10868         return this;
10869       }
10870 
10871       private int bitField0_;
10872 
10873       private int mode_ = 0;
10874       /**
10875        *
10876        *
10877        * <pre>
10878        * Defaults to
10879        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10880        * </pre>
10881        *
10882        * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1;</code>
10883        *
10884        * @return The enum numeric value on the wire for mode.
10885        */
10886       @java.lang.Override
getModeValue()10887       public int getModeValue() {
10888         return mode_;
10889       }
10890       /**
10891        *
10892        *
10893        * <pre>
10894        * Defaults to
10895        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10896        * </pre>
10897        *
10898        * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1;</code>
10899        *
10900        * @param value The enum numeric value on the wire for mode to set.
10901        * @return This builder for chaining.
10902        */
setModeValue(int value)10903       public Builder setModeValue(int value) {
10904         mode_ = value;
10905         bitField0_ |= 0x00000001;
10906         onChanged();
10907         return this;
10908       }
10909       /**
10910        *
10911        *
10912        * <pre>
10913        * Defaults to
10914        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10915        * </pre>
10916        *
10917        * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1;</code>
10918        *
10919        * @return The mode.
10920        */
10921       @java.lang.Override
getMode()10922       public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode getMode() {
10923         com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode result =
10924             com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.forNumber(mode_);
10925         return result == null
10926             ? com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.UNRECOGNIZED
10927             : result;
10928       }
10929       /**
10930        *
10931        *
10932        * <pre>
10933        * Defaults to
10934        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10935        * </pre>
10936        *
10937        * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1;</code>
10938        *
10939        * @param value The mode to set.
10940        * @return This builder for chaining.
10941        */
setMode( com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode value)10942       public Builder setMode(
10943           com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode value) {
10944         if (value == null) {
10945           throw new NullPointerException();
10946         }
10947         bitField0_ |= 0x00000001;
10948         mode_ = value.getNumber();
10949         onChanged();
10950         return this;
10951       }
10952       /**
10953        *
10954        *
10955        * <pre>
10956        * Defaults to
10957        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO].
10958        * </pre>
10959        *
10960        * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode mode = 1;</code>
10961        *
10962        * @return This builder for chaining.
10963        */
clearMode()10964       public Builder clearMode() {
10965         bitField0_ = (bitField0_ & ~0x00000001);
10966         mode_ = 0;
10967         onChanged();
10968         return this;
10969       }
10970 
10971       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)10972       public final Builder setUnknownFields(
10973           final com.google.protobuf.UnknownFieldSet unknownFields) {
10974         return super.setUnknownFields(unknownFields);
10975       }
10976 
10977       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)10978       public final Builder mergeUnknownFields(
10979           final com.google.protobuf.UnknownFieldSet unknownFields) {
10980         return super.mergeUnknownFields(unknownFields);
10981       }
10982 
10983       // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.PersonalizationSpec)
10984     }
10985 
10986     // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.PersonalizationSpec)
10987     private static final com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec
10988         DEFAULT_INSTANCE;
10989 
10990     static {
10991       DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec();
10992     }
10993 
10994     public static com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec
getDefaultInstance()10995         getDefaultInstance() {
10996       return DEFAULT_INSTANCE;
10997     }
10998 
10999     private static final com.google.protobuf.Parser<PersonalizationSpec> PARSER =
11000         new com.google.protobuf.AbstractParser<PersonalizationSpec>() {
11001           @java.lang.Override
11002           public PersonalizationSpec parsePartialFrom(
11003               com.google.protobuf.CodedInputStream input,
11004               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
11005               throws com.google.protobuf.InvalidProtocolBufferException {
11006             Builder builder = newBuilder();
11007             try {
11008               builder.mergeFrom(input, extensionRegistry);
11009             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
11010               throw e.setUnfinishedMessage(builder.buildPartial());
11011             } catch (com.google.protobuf.UninitializedMessageException e) {
11012               throw e.asInvalidProtocolBufferException()
11013                   .setUnfinishedMessage(builder.buildPartial());
11014             } catch (java.io.IOException e) {
11015               throw new com.google.protobuf.InvalidProtocolBufferException(e)
11016                   .setUnfinishedMessage(builder.buildPartial());
11017             }
11018             return builder.buildPartial();
11019           }
11020         };
11021 
parser()11022     public static com.google.protobuf.Parser<PersonalizationSpec> parser() {
11023       return PARSER;
11024     }
11025 
11026     @java.lang.Override
getParserForType()11027     public com.google.protobuf.Parser<PersonalizationSpec> getParserForType() {
11028       return PARSER;
11029     }
11030 
11031     @java.lang.Override
11032     public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec
getDefaultInstanceForType()11033         getDefaultInstanceForType() {
11034       return DEFAULT_INSTANCE;
11035     }
11036   }
11037 
11038   public interface SpellCorrectionSpecOrBuilder
11039       extends
11040       // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec)
11041       com.google.protobuf.MessageOrBuilder {
11042 
11043     /**
11044      *
11045      *
11046      * <pre>
11047      * The mode under which spell correction should take effect to
11048      * replace the original search query. Default to
11049      * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11050      * </pre>
11051      *
11052      * <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
11053      *
11054      * @return The enum numeric value on the wire for mode.
11055      */
getModeValue()11056     int getModeValue();
11057     /**
11058      *
11059      *
11060      * <pre>
11061      * The mode under which spell correction should take effect to
11062      * replace the original search query. Default to
11063      * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11064      * </pre>
11065      *
11066      * <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
11067      *
11068      * @return The mode.
11069      */
getMode()11070     com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode getMode();
11071   }
11072   /**
11073    *
11074    *
11075    * <pre>
11076    * The specification for query spell correction.
11077    * </pre>
11078    *
11079    * Protobuf type {@code google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec}
11080    */
11081   public static final class SpellCorrectionSpec extends com.google.protobuf.GeneratedMessageV3
11082       implements
11083       // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec)
11084       SpellCorrectionSpecOrBuilder {
11085     private static final long serialVersionUID = 0L;
11086     // Use SpellCorrectionSpec.newBuilder() to construct.
SpellCorrectionSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)11087     private SpellCorrectionSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
11088       super(builder);
11089     }
11090 
SpellCorrectionSpec()11091     private SpellCorrectionSpec() {
11092       mode_ = 0;
11093     }
11094 
11095     @java.lang.Override
11096     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)11097     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
11098       return new SpellCorrectionSpec();
11099     }
11100 
11101     @java.lang.Override
getUnknownFields()11102     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
11103       return this.unknownFields;
11104     }
11105 
getDescriptor()11106     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
11107       return com.google.cloud.retail.v2.SearchServiceProto
11108           .internal_static_google_cloud_retail_v2_SearchRequest_SpellCorrectionSpec_descriptor;
11109     }
11110 
11111     @java.lang.Override
11112     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()11113         internalGetFieldAccessorTable() {
11114       return com.google.cloud.retail.v2.SearchServiceProto
11115           .internal_static_google_cloud_retail_v2_SearchRequest_SpellCorrectionSpec_fieldAccessorTable
11116           .ensureFieldAccessorsInitialized(
11117               com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.class,
11118               com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Builder.class);
11119     }
11120 
11121     /**
11122      *
11123      *
11124      * <pre>
11125      * Enum describing under which mode spell correction should occur.
11126      * </pre>
11127      *
11128      * Protobuf enum {@code google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode}
11129      */
11130     public enum Mode implements com.google.protobuf.ProtocolMessageEnum {
11131       /**
11132        *
11133        *
11134        * <pre>
11135        * Unspecified spell correction mode. In this case, server behavior
11136        * defaults to
11137        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11138        * </pre>
11139        *
11140        * <code>MODE_UNSPECIFIED = 0;</code>
11141        */
11142       MODE_UNSPECIFIED(0),
11143       /**
11144        *
11145        *
11146        * <pre>
11147        * Google Retail Search will try to find a spell suggestion if there
11148        * is any and put in the
11149        * [SearchResponse.corrected_query][google.cloud.retail.v2.SearchResponse.corrected_query].
11150        * The spell suggestion will not be used as the search query.
11151        * </pre>
11152        *
11153        * <code>SUGGESTION_ONLY = 1;</code>
11154        */
11155       SUGGESTION_ONLY(1),
11156       /**
11157        *
11158        *
11159        * <pre>
11160        * Automatic spell correction built by Google Retail Search. Search will
11161        * be based on the corrected query if found.
11162        * </pre>
11163        *
11164        * <code>AUTO = 2;</code>
11165        */
11166       AUTO(2),
11167       UNRECOGNIZED(-1),
11168       ;
11169 
11170       /**
11171        *
11172        *
11173        * <pre>
11174        * Unspecified spell correction mode. In this case, server behavior
11175        * defaults to
11176        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11177        * </pre>
11178        *
11179        * <code>MODE_UNSPECIFIED = 0;</code>
11180        */
11181       public static final int MODE_UNSPECIFIED_VALUE = 0;
11182       /**
11183        *
11184        *
11185        * <pre>
11186        * Google Retail Search will try to find a spell suggestion if there
11187        * is any and put in the
11188        * [SearchResponse.corrected_query][google.cloud.retail.v2.SearchResponse.corrected_query].
11189        * The spell suggestion will not be used as the search query.
11190        * </pre>
11191        *
11192        * <code>SUGGESTION_ONLY = 1;</code>
11193        */
11194       public static final int SUGGESTION_ONLY_VALUE = 1;
11195       /**
11196        *
11197        *
11198        * <pre>
11199        * Automatic spell correction built by Google Retail Search. Search will
11200        * be based on the corrected query if found.
11201        * </pre>
11202        *
11203        * <code>AUTO = 2;</code>
11204        */
11205       public static final int AUTO_VALUE = 2;
11206 
getNumber()11207       public final int getNumber() {
11208         if (this == UNRECOGNIZED) {
11209           throw new java.lang.IllegalArgumentException(
11210               "Can't get the number of an unknown enum value.");
11211         }
11212         return value;
11213       }
11214 
11215       /**
11216        * @param value The numeric wire value of the corresponding enum entry.
11217        * @return The enum associated with the given numeric wire value.
11218        * @deprecated Use {@link #forNumber(int)} instead.
11219        */
11220       @java.lang.Deprecated
valueOf(int value)11221       public static Mode valueOf(int value) {
11222         return forNumber(value);
11223       }
11224 
11225       /**
11226        * @param value The numeric wire value of the corresponding enum entry.
11227        * @return The enum associated with the given numeric wire value.
11228        */
forNumber(int value)11229       public static Mode forNumber(int value) {
11230         switch (value) {
11231           case 0:
11232             return MODE_UNSPECIFIED;
11233           case 1:
11234             return SUGGESTION_ONLY;
11235           case 2:
11236             return AUTO;
11237           default:
11238             return null;
11239         }
11240       }
11241 
internalGetValueMap()11242       public static com.google.protobuf.Internal.EnumLiteMap<Mode> internalGetValueMap() {
11243         return internalValueMap;
11244       }
11245 
11246       private static final com.google.protobuf.Internal.EnumLiteMap<Mode> internalValueMap =
11247           new com.google.protobuf.Internal.EnumLiteMap<Mode>() {
11248             public Mode findValueByNumber(int number) {
11249               return Mode.forNumber(number);
11250             }
11251           };
11252 
getValueDescriptor()11253       public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
11254         if (this == UNRECOGNIZED) {
11255           throw new java.lang.IllegalStateException(
11256               "Can't get the descriptor of an unrecognized enum value.");
11257         }
11258         return getDescriptor().getValues().get(ordinal());
11259       }
11260 
getDescriptorForType()11261       public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
11262         return getDescriptor();
11263       }
11264 
getDescriptor()11265       public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
11266         return com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.getDescriptor()
11267             .getEnumTypes()
11268             .get(0);
11269       }
11270 
11271       private static final Mode[] VALUES = values();
11272 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)11273       public static Mode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
11274         if (desc.getType() != getDescriptor()) {
11275           throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
11276         }
11277         if (desc.getIndex() == -1) {
11278           return UNRECOGNIZED;
11279         }
11280         return VALUES[desc.getIndex()];
11281       }
11282 
11283       private final int value;
11284 
Mode(int value)11285       private Mode(int value) {
11286         this.value = value;
11287       }
11288 
11289       // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode)
11290     }
11291 
11292     public static final int MODE_FIELD_NUMBER = 1;
11293     private int mode_ = 0;
11294     /**
11295      *
11296      *
11297      * <pre>
11298      * The mode under which spell correction should take effect to
11299      * replace the original search query. Default to
11300      * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11301      * </pre>
11302      *
11303      * <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
11304      *
11305      * @return The enum numeric value on the wire for mode.
11306      */
11307     @java.lang.Override
getModeValue()11308     public int getModeValue() {
11309       return mode_;
11310     }
11311     /**
11312      *
11313      *
11314      * <pre>
11315      * The mode under which spell correction should take effect to
11316      * replace the original search query. Default to
11317      * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11318      * </pre>
11319      *
11320      * <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
11321      *
11322      * @return The mode.
11323      */
11324     @java.lang.Override
getMode()11325     public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode getMode() {
11326       com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode result =
11327           com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.forNumber(mode_);
11328       return result == null
11329           ? com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.UNRECOGNIZED
11330           : result;
11331     }
11332 
11333     private byte memoizedIsInitialized = -1;
11334 
11335     @java.lang.Override
isInitialized()11336     public final boolean isInitialized() {
11337       byte isInitialized = memoizedIsInitialized;
11338       if (isInitialized == 1) return true;
11339       if (isInitialized == 0) return false;
11340 
11341       memoizedIsInitialized = 1;
11342       return true;
11343     }
11344 
11345     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)11346     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
11347       if (mode_
11348           != com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.MODE_UNSPECIFIED
11349               .getNumber()) {
11350         output.writeEnum(1, mode_);
11351       }
11352       getUnknownFields().writeTo(output);
11353     }
11354 
11355     @java.lang.Override
getSerializedSize()11356     public int getSerializedSize() {
11357       int size = memoizedSize;
11358       if (size != -1) return size;
11359 
11360       size = 0;
11361       if (mode_
11362           != com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.MODE_UNSPECIFIED
11363               .getNumber()) {
11364         size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_);
11365       }
11366       size += getUnknownFields().getSerializedSize();
11367       memoizedSize = size;
11368       return size;
11369     }
11370 
11371     @java.lang.Override
equals(final java.lang.Object obj)11372     public boolean equals(final java.lang.Object obj) {
11373       if (obj == this) {
11374         return true;
11375       }
11376       if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec)) {
11377         return super.equals(obj);
11378       }
11379       com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec other =
11380           (com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec) obj;
11381 
11382       if (mode_ != other.mode_) return false;
11383       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
11384       return true;
11385     }
11386 
11387     @java.lang.Override
hashCode()11388     public int hashCode() {
11389       if (memoizedHashCode != 0) {
11390         return memoizedHashCode;
11391       }
11392       int hash = 41;
11393       hash = (19 * hash) + getDescriptor().hashCode();
11394       hash = (37 * hash) + MODE_FIELD_NUMBER;
11395       hash = (53 * hash) + mode_;
11396       hash = (29 * hash) + getUnknownFields().hashCode();
11397       memoizedHashCode = hash;
11398       return hash;
11399     }
11400 
parseFrom( java.nio.ByteBuffer data)11401     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseFrom(
11402         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
11403       return PARSER.parseFrom(data);
11404     }
11405 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)11406     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseFrom(
11407         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
11408         throws com.google.protobuf.InvalidProtocolBufferException {
11409       return PARSER.parseFrom(data, extensionRegistry);
11410     }
11411 
parseFrom( com.google.protobuf.ByteString data)11412     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseFrom(
11413         com.google.protobuf.ByteString data)
11414         throws com.google.protobuf.InvalidProtocolBufferException {
11415       return PARSER.parseFrom(data);
11416     }
11417 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)11418     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseFrom(
11419         com.google.protobuf.ByteString data,
11420         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
11421         throws com.google.protobuf.InvalidProtocolBufferException {
11422       return PARSER.parseFrom(data, extensionRegistry);
11423     }
11424 
parseFrom( byte[] data)11425     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseFrom(
11426         byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
11427       return PARSER.parseFrom(data);
11428     }
11429 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)11430     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseFrom(
11431         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
11432         throws com.google.protobuf.InvalidProtocolBufferException {
11433       return PARSER.parseFrom(data, extensionRegistry);
11434     }
11435 
parseFrom( java.io.InputStream input)11436     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseFrom(
11437         java.io.InputStream input) throws java.io.IOException {
11438       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
11439     }
11440 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)11441     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseFrom(
11442         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
11443         throws java.io.IOException {
11444       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
11445           PARSER, input, extensionRegistry);
11446     }
11447 
parseDelimitedFrom( java.io.InputStream input)11448     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseDelimitedFrom(
11449         java.io.InputStream input) throws java.io.IOException {
11450       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
11451     }
11452 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)11453     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseDelimitedFrom(
11454         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
11455         throws java.io.IOException {
11456       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
11457           PARSER, input, extensionRegistry);
11458     }
11459 
parseFrom( com.google.protobuf.CodedInputStream input)11460     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseFrom(
11461         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
11462       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
11463     }
11464 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)11465     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec parseFrom(
11466         com.google.protobuf.CodedInputStream input,
11467         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
11468         throws java.io.IOException {
11469       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
11470           PARSER, input, extensionRegistry);
11471     }
11472 
11473     @java.lang.Override
newBuilderForType()11474     public Builder newBuilderForType() {
11475       return newBuilder();
11476     }
11477 
newBuilder()11478     public static Builder newBuilder() {
11479       return DEFAULT_INSTANCE.toBuilder();
11480     }
11481 
newBuilder( com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec prototype)11482     public static Builder newBuilder(
11483         com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec prototype) {
11484       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
11485     }
11486 
11487     @java.lang.Override
toBuilder()11488     public Builder toBuilder() {
11489       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
11490     }
11491 
11492     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)11493     protected Builder newBuilderForType(
11494         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
11495       Builder builder = new Builder(parent);
11496       return builder;
11497     }
11498     /**
11499      *
11500      *
11501      * <pre>
11502      * The specification for query spell correction.
11503      * </pre>
11504      *
11505      * Protobuf type {@code google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec}
11506      */
11507     public static final class Builder
11508         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
11509         implements
11510         // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec)
11511         com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpecOrBuilder {
getDescriptor()11512       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
11513         return com.google.cloud.retail.v2.SearchServiceProto
11514             .internal_static_google_cloud_retail_v2_SearchRequest_SpellCorrectionSpec_descriptor;
11515       }
11516 
11517       @java.lang.Override
11518       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()11519           internalGetFieldAccessorTable() {
11520         return com.google.cloud.retail.v2.SearchServiceProto
11521             .internal_static_google_cloud_retail_v2_SearchRequest_SpellCorrectionSpec_fieldAccessorTable
11522             .ensureFieldAccessorsInitialized(
11523                 com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.class,
11524                 com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Builder.class);
11525       }
11526 
11527       // Construct using com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.newBuilder()
Builder()11528       private Builder() {}
11529 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)11530       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
11531         super(parent);
11532       }
11533 
11534       @java.lang.Override
clear()11535       public Builder clear() {
11536         super.clear();
11537         bitField0_ = 0;
11538         mode_ = 0;
11539         return this;
11540       }
11541 
11542       @java.lang.Override
getDescriptorForType()11543       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
11544         return com.google.cloud.retail.v2.SearchServiceProto
11545             .internal_static_google_cloud_retail_v2_SearchRequest_SpellCorrectionSpec_descriptor;
11546       }
11547 
11548       @java.lang.Override
11549       public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec
getDefaultInstanceForType()11550           getDefaultInstanceForType() {
11551         return com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.getDefaultInstance();
11552       }
11553 
11554       @java.lang.Override
build()11555       public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec build() {
11556         com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec result = buildPartial();
11557         if (!result.isInitialized()) {
11558           throw newUninitializedMessageException(result);
11559         }
11560         return result;
11561       }
11562 
11563       @java.lang.Override
buildPartial()11564       public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec buildPartial() {
11565         com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec result =
11566             new com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec(this);
11567         if (bitField0_ != 0) {
11568           buildPartial0(result);
11569         }
11570         onBuilt();
11571         return result;
11572       }
11573 
buildPartial0( com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec result)11574       private void buildPartial0(
11575           com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec result) {
11576         int from_bitField0_ = bitField0_;
11577         if (((from_bitField0_ & 0x00000001) != 0)) {
11578           result.mode_ = mode_;
11579         }
11580       }
11581 
11582       @java.lang.Override
clone()11583       public Builder clone() {
11584         return super.clone();
11585       }
11586 
11587       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)11588       public Builder setField(
11589           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
11590         return super.setField(field, value);
11591       }
11592 
11593       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)11594       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
11595         return super.clearField(field);
11596       }
11597 
11598       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)11599       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
11600         return super.clearOneof(oneof);
11601       }
11602 
11603       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)11604       public Builder setRepeatedField(
11605           com.google.protobuf.Descriptors.FieldDescriptor field,
11606           int index,
11607           java.lang.Object value) {
11608         return super.setRepeatedField(field, index, value);
11609       }
11610 
11611       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)11612       public Builder addRepeatedField(
11613           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
11614         return super.addRepeatedField(field, value);
11615       }
11616 
11617       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)11618       public Builder mergeFrom(com.google.protobuf.Message other) {
11619         if (other instanceof com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec) {
11620           return mergeFrom((com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec) other);
11621         } else {
11622           super.mergeFrom(other);
11623           return this;
11624         }
11625       }
11626 
mergeFrom(com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec other)11627       public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec other) {
11628         if (other
11629             == com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.getDefaultInstance())
11630           return this;
11631         if (other.mode_ != 0) {
11632           setModeValue(other.getModeValue());
11633         }
11634         this.mergeUnknownFields(other.getUnknownFields());
11635         onChanged();
11636         return this;
11637       }
11638 
11639       @java.lang.Override
isInitialized()11640       public final boolean isInitialized() {
11641         return true;
11642       }
11643 
11644       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)11645       public Builder mergeFrom(
11646           com.google.protobuf.CodedInputStream input,
11647           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
11648           throws java.io.IOException {
11649         if (extensionRegistry == null) {
11650           throw new java.lang.NullPointerException();
11651         }
11652         try {
11653           boolean done = false;
11654           while (!done) {
11655             int tag = input.readTag();
11656             switch (tag) {
11657               case 0:
11658                 done = true;
11659                 break;
11660               case 8:
11661                 {
11662                   mode_ = input.readEnum();
11663                   bitField0_ |= 0x00000001;
11664                   break;
11665                 } // case 8
11666               default:
11667                 {
11668                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
11669                     done = true; // was an endgroup tag
11670                   }
11671                   break;
11672                 } // default:
11673             } // switch (tag)
11674           } // while (!done)
11675         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
11676           throw e.unwrapIOException();
11677         } finally {
11678           onChanged();
11679         } // finally
11680         return this;
11681       }
11682 
11683       private int bitField0_;
11684 
11685       private int mode_ = 0;
11686       /**
11687        *
11688        *
11689        * <pre>
11690        * The mode under which spell correction should take effect to
11691        * replace the original search query. Default to
11692        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11693        * </pre>
11694        *
11695        * <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
11696        *
11697        * @return The enum numeric value on the wire for mode.
11698        */
11699       @java.lang.Override
getModeValue()11700       public int getModeValue() {
11701         return mode_;
11702       }
11703       /**
11704        *
11705        *
11706        * <pre>
11707        * The mode under which spell correction should take effect to
11708        * replace the original search query. Default to
11709        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11710        * </pre>
11711        *
11712        * <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
11713        *
11714        * @param value The enum numeric value on the wire for mode to set.
11715        * @return This builder for chaining.
11716        */
setModeValue(int value)11717       public Builder setModeValue(int value) {
11718         mode_ = value;
11719         bitField0_ |= 0x00000001;
11720         onChanged();
11721         return this;
11722       }
11723       /**
11724        *
11725        *
11726        * <pre>
11727        * The mode under which spell correction should take effect to
11728        * replace the original search query. Default to
11729        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11730        * </pre>
11731        *
11732        * <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
11733        *
11734        * @return The mode.
11735        */
11736       @java.lang.Override
getMode()11737       public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode getMode() {
11738         com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode result =
11739             com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.forNumber(mode_);
11740         return result == null
11741             ? com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.UNRECOGNIZED
11742             : result;
11743       }
11744       /**
11745        *
11746        *
11747        * <pre>
11748        * The mode under which spell correction should take effect to
11749        * replace the original search query. Default to
11750        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11751        * </pre>
11752        *
11753        * <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
11754        *
11755        * @param value The mode to set.
11756        * @return This builder for chaining.
11757        */
setMode( com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode value)11758       public Builder setMode(
11759           com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode value) {
11760         if (value == null) {
11761           throw new NullPointerException();
11762         }
11763         bitField0_ |= 0x00000001;
11764         mode_ = value.getNumber();
11765         onChanged();
11766         return this;
11767       }
11768       /**
11769        *
11770        *
11771        * <pre>
11772        * The mode under which spell correction should take effect to
11773        * replace the original search query. Default to
11774        * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
11775        * </pre>
11776        *
11777        * <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
11778        *
11779        * @return This builder for chaining.
11780        */
clearMode()11781       public Builder clearMode() {
11782         bitField0_ = (bitField0_ & ~0x00000001);
11783         mode_ = 0;
11784         onChanged();
11785         return this;
11786       }
11787 
11788       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)11789       public final Builder setUnknownFields(
11790           final com.google.protobuf.UnknownFieldSet unknownFields) {
11791         return super.setUnknownFields(unknownFields);
11792       }
11793 
11794       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)11795       public final Builder mergeUnknownFields(
11796           final com.google.protobuf.UnknownFieldSet unknownFields) {
11797         return super.mergeUnknownFields(unknownFields);
11798       }
11799 
11800       // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec)
11801     }
11802 
11803     // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec)
11804     private static final com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec
11805         DEFAULT_INSTANCE;
11806 
11807     static {
11808       DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec();
11809     }
11810 
11811     public static com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec
getDefaultInstance()11812         getDefaultInstance() {
11813       return DEFAULT_INSTANCE;
11814     }
11815 
11816     private static final com.google.protobuf.Parser<SpellCorrectionSpec> PARSER =
11817         new com.google.protobuf.AbstractParser<SpellCorrectionSpec>() {
11818           @java.lang.Override
11819           public SpellCorrectionSpec parsePartialFrom(
11820               com.google.protobuf.CodedInputStream input,
11821               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
11822               throws com.google.protobuf.InvalidProtocolBufferException {
11823             Builder builder = newBuilder();
11824             try {
11825               builder.mergeFrom(input, extensionRegistry);
11826             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
11827               throw e.setUnfinishedMessage(builder.buildPartial());
11828             } catch (com.google.protobuf.UninitializedMessageException e) {
11829               throw e.asInvalidProtocolBufferException()
11830                   .setUnfinishedMessage(builder.buildPartial());
11831             } catch (java.io.IOException e) {
11832               throw new com.google.protobuf.InvalidProtocolBufferException(e)
11833                   .setUnfinishedMessage(builder.buildPartial());
11834             }
11835             return builder.buildPartial();
11836           }
11837         };
11838 
parser()11839     public static com.google.protobuf.Parser<SpellCorrectionSpec> parser() {
11840       return PARSER;
11841     }
11842 
11843     @java.lang.Override
getParserForType()11844     public com.google.protobuf.Parser<SpellCorrectionSpec> getParserForType() {
11845       return PARSER;
11846     }
11847 
11848     @java.lang.Override
11849     public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec
getDefaultInstanceForType()11850         getDefaultInstanceForType() {
11851       return DEFAULT_INSTANCE;
11852     }
11853   }
11854 
11855   private int bitField0_;
11856   public static final int PLACEMENT_FIELD_NUMBER = 1;
11857 
11858   @SuppressWarnings("serial")
11859   private volatile java.lang.Object placement_ = "";
11860   /**
11861    *
11862    *
11863    * <pre>
11864    * Required. The resource name of the Retail Search serving config, such as
11865    * `projects/&#42;&#47;locations/global/catalogs/default_catalog/servingConfigs/default_serving_config`
11866    * or the name of the legacy placement resource, such as
11867    * `projects/&#42;&#47;locations/global/catalogs/default_catalog/placements/default_search`.
11868    * This field is used to identify the serving config name and the set
11869    * of models that will be used to make the search.
11870    * </pre>
11871    *
11872    * <code>string placement = 1 [(.google.api.field_behavior) = REQUIRED];</code>
11873    *
11874    * @return The placement.
11875    */
11876   @java.lang.Override
getPlacement()11877   public java.lang.String getPlacement() {
11878     java.lang.Object ref = placement_;
11879     if (ref instanceof java.lang.String) {
11880       return (java.lang.String) ref;
11881     } else {
11882       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
11883       java.lang.String s = bs.toStringUtf8();
11884       placement_ = s;
11885       return s;
11886     }
11887   }
11888   /**
11889    *
11890    *
11891    * <pre>
11892    * Required. The resource name of the Retail Search serving config, such as
11893    * `projects/&#42;&#47;locations/global/catalogs/default_catalog/servingConfigs/default_serving_config`
11894    * or the name of the legacy placement resource, such as
11895    * `projects/&#42;&#47;locations/global/catalogs/default_catalog/placements/default_search`.
11896    * This field is used to identify the serving config name and the set
11897    * of models that will be used to make the search.
11898    * </pre>
11899    *
11900    * <code>string placement = 1 [(.google.api.field_behavior) = REQUIRED];</code>
11901    *
11902    * @return The bytes for placement.
11903    */
11904   @java.lang.Override
getPlacementBytes()11905   public com.google.protobuf.ByteString getPlacementBytes() {
11906     java.lang.Object ref = placement_;
11907     if (ref instanceof java.lang.String) {
11908       com.google.protobuf.ByteString b =
11909           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
11910       placement_ = b;
11911       return b;
11912     } else {
11913       return (com.google.protobuf.ByteString) ref;
11914     }
11915   }
11916 
11917   public static final int BRANCH_FIELD_NUMBER = 2;
11918 
11919   @SuppressWarnings("serial")
11920   private volatile java.lang.Object branch_ = "";
11921   /**
11922    *
11923    *
11924    * <pre>
11925    * The branch resource name, such as
11926    * `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/0`.
11927    * Use "default_branch" as the branch ID or leave this field empty, to search
11928    * products under the default branch.
11929    * </pre>
11930    *
11931    * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
11932    *
11933    * @return The branch.
11934    */
11935   @java.lang.Override
getBranch()11936   public java.lang.String getBranch() {
11937     java.lang.Object ref = branch_;
11938     if (ref instanceof java.lang.String) {
11939       return (java.lang.String) ref;
11940     } else {
11941       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
11942       java.lang.String s = bs.toStringUtf8();
11943       branch_ = s;
11944       return s;
11945     }
11946   }
11947   /**
11948    *
11949    *
11950    * <pre>
11951    * The branch resource name, such as
11952    * `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/0`.
11953    * Use "default_branch" as the branch ID or leave this field empty, to search
11954    * products under the default branch.
11955    * </pre>
11956    *
11957    * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
11958    *
11959    * @return The bytes for branch.
11960    */
11961   @java.lang.Override
getBranchBytes()11962   public com.google.protobuf.ByteString getBranchBytes() {
11963     java.lang.Object ref = branch_;
11964     if (ref instanceof java.lang.String) {
11965       com.google.protobuf.ByteString b =
11966           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
11967       branch_ = b;
11968       return b;
11969     } else {
11970       return (com.google.protobuf.ByteString) ref;
11971     }
11972   }
11973 
11974   public static final int QUERY_FIELD_NUMBER = 3;
11975 
11976   @SuppressWarnings("serial")
11977   private volatile java.lang.Object query_ = "";
11978   /**
11979    *
11980    *
11981    * <pre>
11982    * Raw search query.
11983    * If this field is empty, the request is considered a category browsing
11984    * request and returned results are based on
11985    * [filter][google.cloud.retail.v2.SearchRequest.filter] and
11986    * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories].
11987    * </pre>
11988    *
11989    * <code>string query = 3;</code>
11990    *
11991    * @return The query.
11992    */
11993   @java.lang.Override
getQuery()11994   public java.lang.String getQuery() {
11995     java.lang.Object ref = query_;
11996     if (ref instanceof java.lang.String) {
11997       return (java.lang.String) ref;
11998     } else {
11999       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
12000       java.lang.String s = bs.toStringUtf8();
12001       query_ = s;
12002       return s;
12003     }
12004   }
12005   /**
12006    *
12007    *
12008    * <pre>
12009    * Raw search query.
12010    * If this field is empty, the request is considered a category browsing
12011    * request and returned results are based on
12012    * [filter][google.cloud.retail.v2.SearchRequest.filter] and
12013    * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories].
12014    * </pre>
12015    *
12016    * <code>string query = 3;</code>
12017    *
12018    * @return The bytes for query.
12019    */
12020   @java.lang.Override
getQueryBytes()12021   public com.google.protobuf.ByteString getQueryBytes() {
12022     java.lang.Object ref = query_;
12023     if (ref instanceof java.lang.String) {
12024       com.google.protobuf.ByteString b =
12025           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
12026       query_ = b;
12027       return b;
12028     } else {
12029       return (com.google.protobuf.ByteString) ref;
12030     }
12031   }
12032 
12033   public static final int VISITOR_ID_FIELD_NUMBER = 4;
12034 
12035   @SuppressWarnings("serial")
12036   private volatile java.lang.Object visitorId_ = "";
12037   /**
12038    *
12039    *
12040    * <pre>
12041    * Required. A unique identifier for tracking visitors. For example, this
12042    * could be implemented with an HTTP cookie, which should be able to uniquely
12043    * identify a visitor on a single device. This unique identifier should not
12044    * change if the visitor logs in or out of the website.
12045    * This should be the same identifier as
12046    * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id].
12047    * The field must be a UTF-8 encoded string with a length limit of 128
12048    * characters. Otherwise, an INVALID_ARGUMENT error is returned.
12049    * </pre>
12050    *
12051    * <code>string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
12052    *
12053    * @return The visitorId.
12054    */
12055   @java.lang.Override
getVisitorId()12056   public java.lang.String getVisitorId() {
12057     java.lang.Object ref = visitorId_;
12058     if (ref instanceof java.lang.String) {
12059       return (java.lang.String) ref;
12060     } else {
12061       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
12062       java.lang.String s = bs.toStringUtf8();
12063       visitorId_ = s;
12064       return s;
12065     }
12066   }
12067   /**
12068    *
12069    *
12070    * <pre>
12071    * Required. A unique identifier for tracking visitors. For example, this
12072    * could be implemented with an HTTP cookie, which should be able to uniquely
12073    * identify a visitor on a single device. This unique identifier should not
12074    * change if the visitor logs in or out of the website.
12075    * This should be the same identifier as
12076    * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id].
12077    * The field must be a UTF-8 encoded string with a length limit of 128
12078    * characters. Otherwise, an INVALID_ARGUMENT error is returned.
12079    * </pre>
12080    *
12081    * <code>string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
12082    *
12083    * @return The bytes for visitorId.
12084    */
12085   @java.lang.Override
getVisitorIdBytes()12086   public com.google.protobuf.ByteString getVisitorIdBytes() {
12087     java.lang.Object ref = visitorId_;
12088     if (ref instanceof java.lang.String) {
12089       com.google.protobuf.ByteString b =
12090           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
12091       visitorId_ = b;
12092       return b;
12093     } else {
12094       return (com.google.protobuf.ByteString) ref;
12095     }
12096   }
12097 
12098   public static final int USER_INFO_FIELD_NUMBER = 5;
12099   private com.google.cloud.retail.v2.UserInfo userInfo_;
12100   /**
12101    *
12102    *
12103    * <pre>
12104    * User information.
12105    * </pre>
12106    *
12107    * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
12108    *
12109    * @return Whether the userInfo field is set.
12110    */
12111   @java.lang.Override
hasUserInfo()12112   public boolean hasUserInfo() {
12113     return userInfo_ != null;
12114   }
12115   /**
12116    *
12117    *
12118    * <pre>
12119    * User information.
12120    * </pre>
12121    *
12122    * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
12123    *
12124    * @return The userInfo.
12125    */
12126   @java.lang.Override
getUserInfo()12127   public com.google.cloud.retail.v2.UserInfo getUserInfo() {
12128     return userInfo_ == null ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance() : userInfo_;
12129   }
12130   /**
12131    *
12132    *
12133    * <pre>
12134    * User information.
12135    * </pre>
12136    *
12137    * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
12138    */
12139   @java.lang.Override
getUserInfoOrBuilder()12140   public com.google.cloud.retail.v2.UserInfoOrBuilder getUserInfoOrBuilder() {
12141     return userInfo_ == null ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance() : userInfo_;
12142   }
12143 
12144   public static final int PAGE_SIZE_FIELD_NUMBER = 7;
12145   private int pageSize_ = 0;
12146   /**
12147    *
12148    *
12149    * <pre>
12150    * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
12151    * unspecified, defaults to a reasonable value. The maximum allowed value is
12152    * 120. Values above 120 will be coerced to 120.
12153    * If this field is negative, an INVALID_ARGUMENT is returned.
12154    * </pre>
12155    *
12156    * <code>int32 page_size = 7;</code>
12157    *
12158    * @return The pageSize.
12159    */
12160   @java.lang.Override
getPageSize()12161   public int getPageSize() {
12162     return pageSize_;
12163   }
12164 
12165   public static final int PAGE_TOKEN_FIELD_NUMBER = 8;
12166 
12167   @SuppressWarnings("serial")
12168   private volatile java.lang.Object pageToken_ = "";
12169   /**
12170    *
12171    *
12172    * <pre>
12173    * A page token
12174    * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
12175    * received from a previous
12176    * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
12177    * Provide this to retrieve the subsequent page.
12178    * When paginating, all other parameters provided to
12179    * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
12180    * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
12181    * error is returned.
12182    * </pre>
12183    *
12184    * <code>string page_token = 8;</code>
12185    *
12186    * @return The pageToken.
12187    */
12188   @java.lang.Override
getPageToken()12189   public java.lang.String getPageToken() {
12190     java.lang.Object ref = pageToken_;
12191     if (ref instanceof java.lang.String) {
12192       return (java.lang.String) ref;
12193     } else {
12194       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
12195       java.lang.String s = bs.toStringUtf8();
12196       pageToken_ = s;
12197       return s;
12198     }
12199   }
12200   /**
12201    *
12202    *
12203    * <pre>
12204    * A page token
12205    * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
12206    * received from a previous
12207    * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
12208    * Provide this to retrieve the subsequent page.
12209    * When paginating, all other parameters provided to
12210    * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
12211    * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
12212    * error is returned.
12213    * </pre>
12214    *
12215    * <code>string page_token = 8;</code>
12216    *
12217    * @return The bytes for pageToken.
12218    */
12219   @java.lang.Override
getPageTokenBytes()12220   public com.google.protobuf.ByteString getPageTokenBytes() {
12221     java.lang.Object ref = pageToken_;
12222     if (ref instanceof java.lang.String) {
12223       com.google.protobuf.ByteString b =
12224           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
12225       pageToken_ = b;
12226       return b;
12227     } else {
12228       return (com.google.protobuf.ByteString) ref;
12229     }
12230   }
12231 
12232   public static final int OFFSET_FIELD_NUMBER = 9;
12233   private int offset_ = 0;
12234   /**
12235    *
12236    *
12237    * <pre>
12238    * A 0-indexed integer that specifies the current offset (that is, starting
12239    * result location, amongst the [Product][google.cloud.retail.v2.Product]s
12240    * deemed by the API as relevant) in search results. This field is only
12241    * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token]
12242    * is unset.
12243    * If this field is negative, an INVALID_ARGUMENT is returned.
12244    * </pre>
12245    *
12246    * <code>int32 offset = 9;</code>
12247    *
12248    * @return The offset.
12249    */
12250   @java.lang.Override
getOffset()12251   public int getOffset() {
12252     return offset_;
12253   }
12254 
12255   public static final int FILTER_FIELD_NUMBER = 10;
12256 
12257   @SuppressWarnings("serial")
12258   private volatile java.lang.Object filter_ = "";
12259   /**
12260    *
12261    *
12262    * <pre>
12263    * The filter syntax consists of an expression language for constructing a
12264    * predicate from one or more fields of the products being filtered. Filter
12265    * expression is case-sensitive. See more details at this [user
12266    * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
12267    * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
12268    * </pre>
12269    *
12270    * <code>string filter = 10;</code>
12271    *
12272    * @return The filter.
12273    */
12274   @java.lang.Override
getFilter()12275   public java.lang.String getFilter() {
12276     java.lang.Object ref = filter_;
12277     if (ref instanceof java.lang.String) {
12278       return (java.lang.String) ref;
12279     } else {
12280       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
12281       java.lang.String s = bs.toStringUtf8();
12282       filter_ = s;
12283       return s;
12284     }
12285   }
12286   /**
12287    *
12288    *
12289    * <pre>
12290    * The filter syntax consists of an expression language for constructing a
12291    * predicate from one or more fields of the products being filtered. Filter
12292    * expression is case-sensitive. See more details at this [user
12293    * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
12294    * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
12295    * </pre>
12296    *
12297    * <code>string filter = 10;</code>
12298    *
12299    * @return The bytes for filter.
12300    */
12301   @java.lang.Override
getFilterBytes()12302   public com.google.protobuf.ByteString getFilterBytes() {
12303     java.lang.Object ref = filter_;
12304     if (ref instanceof java.lang.String) {
12305       com.google.protobuf.ByteString b =
12306           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
12307       filter_ = b;
12308       return b;
12309     } else {
12310       return (com.google.protobuf.ByteString) ref;
12311     }
12312   }
12313 
12314   public static final int CANONICAL_FILTER_FIELD_NUMBER = 28;
12315 
12316   @SuppressWarnings("serial")
12317   private volatile java.lang.Object canonicalFilter_ = "";
12318   /**
12319    *
12320    *
12321    * <pre>
12322    * The default filter that is applied when a user performs a search without
12323    * checking any filters on the search page.
12324    * The filter applied to every search request when quality improvement such as
12325    * query expansion is needed. For example, if a query does not have enough
12326    * results, an expanded query with
12327    * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
12328    * will be returned as a supplement of the original query. This field is
12329    * strongly recommended to achieve high search quality.
12330    * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
12331    * more details about filter syntax.
12332    * </pre>
12333    *
12334    * <code>string canonical_filter = 28;</code>
12335    *
12336    * @return The canonicalFilter.
12337    */
12338   @java.lang.Override
getCanonicalFilter()12339   public java.lang.String getCanonicalFilter() {
12340     java.lang.Object ref = canonicalFilter_;
12341     if (ref instanceof java.lang.String) {
12342       return (java.lang.String) ref;
12343     } else {
12344       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
12345       java.lang.String s = bs.toStringUtf8();
12346       canonicalFilter_ = s;
12347       return s;
12348     }
12349   }
12350   /**
12351    *
12352    *
12353    * <pre>
12354    * The default filter that is applied when a user performs a search without
12355    * checking any filters on the search page.
12356    * The filter applied to every search request when quality improvement such as
12357    * query expansion is needed. For example, if a query does not have enough
12358    * results, an expanded query with
12359    * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
12360    * will be returned as a supplement of the original query. This field is
12361    * strongly recommended to achieve high search quality.
12362    * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
12363    * more details about filter syntax.
12364    * </pre>
12365    *
12366    * <code>string canonical_filter = 28;</code>
12367    *
12368    * @return The bytes for canonicalFilter.
12369    */
12370   @java.lang.Override
getCanonicalFilterBytes()12371   public com.google.protobuf.ByteString getCanonicalFilterBytes() {
12372     java.lang.Object ref = canonicalFilter_;
12373     if (ref instanceof java.lang.String) {
12374       com.google.protobuf.ByteString b =
12375           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
12376       canonicalFilter_ = b;
12377       return b;
12378     } else {
12379       return (com.google.protobuf.ByteString) ref;
12380     }
12381   }
12382 
12383   public static final int ORDER_BY_FIELD_NUMBER = 11;
12384 
12385   @SuppressWarnings("serial")
12386   private volatile java.lang.Object orderBy_ = "";
12387   /**
12388    *
12389    *
12390    * <pre>
12391    * The order in which products are returned. Products can be ordered by
12392    * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
12393    * unset if ordered by relevance. OrderBy expression is case-sensitive. See
12394    * more details at this [user
12395    * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
12396    * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
12397    * </pre>
12398    *
12399    * <code>string order_by = 11;</code>
12400    *
12401    * @return The orderBy.
12402    */
12403   @java.lang.Override
getOrderBy()12404   public java.lang.String getOrderBy() {
12405     java.lang.Object ref = orderBy_;
12406     if (ref instanceof java.lang.String) {
12407       return (java.lang.String) ref;
12408     } else {
12409       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
12410       java.lang.String s = bs.toStringUtf8();
12411       orderBy_ = s;
12412       return s;
12413     }
12414   }
12415   /**
12416    *
12417    *
12418    * <pre>
12419    * The order in which products are returned. Products can be ordered by
12420    * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
12421    * unset if ordered by relevance. OrderBy expression is case-sensitive. See
12422    * more details at this [user
12423    * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
12424    * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
12425    * </pre>
12426    *
12427    * <code>string order_by = 11;</code>
12428    *
12429    * @return The bytes for orderBy.
12430    */
12431   @java.lang.Override
getOrderByBytes()12432   public com.google.protobuf.ByteString getOrderByBytes() {
12433     java.lang.Object ref = orderBy_;
12434     if (ref instanceof java.lang.String) {
12435       com.google.protobuf.ByteString b =
12436           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
12437       orderBy_ = b;
12438       return b;
12439     } else {
12440       return (com.google.protobuf.ByteString) ref;
12441     }
12442   }
12443 
12444   public static final int FACET_SPECS_FIELD_NUMBER = 12;
12445 
12446   @SuppressWarnings("serial")
12447   private java.util.List<com.google.cloud.retail.v2.SearchRequest.FacetSpec> facetSpecs_;
12448   /**
12449    *
12450    *
12451    * <pre>
12452    * Facet specifications for faceted search. If empty, no facets are returned.
12453    * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
12454    * is returned.
12455    * </pre>
12456    *
12457    * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
12458    */
12459   @java.lang.Override
getFacetSpecsList()12460   public java.util.List<com.google.cloud.retail.v2.SearchRequest.FacetSpec> getFacetSpecsList() {
12461     return facetSpecs_;
12462   }
12463   /**
12464    *
12465    *
12466    * <pre>
12467    * Facet specifications for faceted search. If empty, no facets are returned.
12468    * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
12469    * is returned.
12470    * </pre>
12471    *
12472    * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
12473    */
12474   @java.lang.Override
12475   public java.util.List<? extends com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder>
getFacetSpecsOrBuilderList()12476       getFacetSpecsOrBuilderList() {
12477     return facetSpecs_;
12478   }
12479   /**
12480    *
12481    *
12482    * <pre>
12483    * Facet specifications for faceted search. If empty, no facets are returned.
12484    * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
12485    * is returned.
12486    * </pre>
12487    *
12488    * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
12489    */
12490   @java.lang.Override
getFacetSpecsCount()12491   public int getFacetSpecsCount() {
12492     return facetSpecs_.size();
12493   }
12494   /**
12495    *
12496    *
12497    * <pre>
12498    * Facet specifications for faceted search. If empty, no facets are returned.
12499    * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
12500    * is returned.
12501    * </pre>
12502    *
12503    * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
12504    */
12505   @java.lang.Override
getFacetSpecs(int index)12506   public com.google.cloud.retail.v2.SearchRequest.FacetSpec getFacetSpecs(int index) {
12507     return facetSpecs_.get(index);
12508   }
12509   /**
12510    *
12511    *
12512    * <pre>
12513    * Facet specifications for faceted search. If empty, no facets are returned.
12514    * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
12515    * is returned.
12516    * </pre>
12517    *
12518    * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
12519    */
12520   @java.lang.Override
getFacetSpecsOrBuilder( int index)12521   public com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder(
12522       int index) {
12523     return facetSpecs_.get(index);
12524   }
12525 
12526   public static final int DYNAMIC_FACET_SPEC_FIELD_NUMBER = 21;
12527   private com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamicFacetSpec_;
12528   /**
12529    *
12530    *
12531    * <pre>
12532    * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
12533    * to enable dynamic facets. Do not set this field.
12534    * The specification for dynamically generated facets. Notice that only
12535    * textual facets can be dynamically generated.
12536    * </pre>
12537    *
12538    * <code>
12539    * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
12540    * </code>
12541    *
12542    * @deprecated google.cloud.retail.v2.SearchRequest.dynamic_facet_spec is deprecated. See
12543    *     google/cloud/retail/v2/search_service.proto;l=596
12544    * @return Whether the dynamicFacetSpec field is set.
12545    */
12546   @java.lang.Override
12547   @java.lang.Deprecated
hasDynamicFacetSpec()12548   public boolean hasDynamicFacetSpec() {
12549     return dynamicFacetSpec_ != null;
12550   }
12551   /**
12552    *
12553    *
12554    * <pre>
12555    * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
12556    * to enable dynamic facets. Do not set this field.
12557    * The specification for dynamically generated facets. Notice that only
12558    * textual facets can be dynamically generated.
12559    * </pre>
12560    *
12561    * <code>
12562    * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
12563    * </code>
12564    *
12565    * @deprecated google.cloud.retail.v2.SearchRequest.dynamic_facet_spec is deprecated. See
12566    *     google/cloud/retail/v2/search_service.proto;l=596
12567    * @return The dynamicFacetSpec.
12568    */
12569   @java.lang.Override
12570   @java.lang.Deprecated
getDynamicFacetSpec()12571   public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() {
12572     return dynamicFacetSpec_ == null
12573         ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance()
12574         : dynamicFacetSpec_;
12575   }
12576   /**
12577    *
12578    *
12579    * <pre>
12580    * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
12581    * to enable dynamic facets. Do not set this field.
12582    * The specification for dynamically generated facets. Notice that only
12583    * textual facets can be dynamically generated.
12584    * </pre>
12585    *
12586    * <code>
12587    * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
12588    * </code>
12589    */
12590   @java.lang.Override
12591   @java.lang.Deprecated
12592   public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder
getDynamicFacetSpecOrBuilder()12593       getDynamicFacetSpecOrBuilder() {
12594     return dynamicFacetSpec_ == null
12595         ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance()
12596         : dynamicFacetSpec_;
12597   }
12598 
12599   public static final int BOOST_SPEC_FIELD_NUMBER = 13;
12600   private com.google.cloud.retail.v2.SearchRequest.BoostSpec boostSpec_;
12601   /**
12602    *
12603    *
12604    * <pre>
12605    * Boost specification to boost certain products. See more details at this
12606    * [user guide](https://cloud.google.com/retail/docs/boosting).
12607    * Notice that if both
12608    * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
12609    * and
12610    * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
12611    * are set, the boost conditions from both places are evaluated. If a search
12612    * request matches multiple boost conditions, the final boost score is equal
12613    * to the sum of the boost scores from all matched boost conditions.
12614    * </pre>
12615    *
12616    * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
12617    *
12618    * @return Whether the boostSpec field is set.
12619    */
12620   @java.lang.Override
hasBoostSpec()12621   public boolean hasBoostSpec() {
12622     return boostSpec_ != null;
12623   }
12624   /**
12625    *
12626    *
12627    * <pre>
12628    * Boost specification to boost certain products. See more details at this
12629    * [user guide](https://cloud.google.com/retail/docs/boosting).
12630    * Notice that if both
12631    * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
12632    * and
12633    * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
12634    * are set, the boost conditions from both places are evaluated. If a search
12635    * request matches multiple boost conditions, the final boost score is equal
12636    * to the sum of the boost scores from all matched boost conditions.
12637    * </pre>
12638    *
12639    * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
12640    *
12641    * @return The boostSpec.
12642    */
12643   @java.lang.Override
getBoostSpec()12644   public com.google.cloud.retail.v2.SearchRequest.BoostSpec getBoostSpec() {
12645     return boostSpec_ == null
12646         ? com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance()
12647         : boostSpec_;
12648   }
12649   /**
12650    *
12651    *
12652    * <pre>
12653    * Boost specification to boost certain products. See more details at this
12654    * [user guide](https://cloud.google.com/retail/docs/boosting).
12655    * Notice that if both
12656    * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
12657    * and
12658    * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
12659    * are set, the boost conditions from both places are evaluated. If a search
12660    * request matches multiple boost conditions, the final boost score is equal
12661    * to the sum of the boost scores from all matched boost conditions.
12662    * </pre>
12663    *
12664    * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
12665    */
12666   @java.lang.Override
getBoostSpecOrBuilder()12667   public com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder() {
12668     return boostSpec_ == null
12669         ? com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance()
12670         : boostSpec_;
12671   }
12672 
12673   public static final int QUERY_EXPANSION_SPEC_FIELD_NUMBER = 14;
12674   private com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec queryExpansionSpec_;
12675   /**
12676    *
12677    *
12678    * <pre>
12679    * The query expansion specification that specifies the conditions under which
12680    * query expansion will occur. See more details at this [user
12681    * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
12682    * </pre>
12683    *
12684    * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
12685    * </code>
12686    *
12687    * @return Whether the queryExpansionSpec field is set.
12688    */
12689   @java.lang.Override
hasQueryExpansionSpec()12690   public boolean hasQueryExpansionSpec() {
12691     return queryExpansionSpec_ != null;
12692   }
12693   /**
12694    *
12695    *
12696    * <pre>
12697    * The query expansion specification that specifies the conditions under which
12698    * query expansion will occur. See more details at this [user
12699    * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
12700    * </pre>
12701    *
12702    * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
12703    * </code>
12704    *
12705    * @return The queryExpansionSpec.
12706    */
12707   @java.lang.Override
getQueryExpansionSpec()12708   public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec getQueryExpansionSpec() {
12709     return queryExpansionSpec_ == null
12710         ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance()
12711         : queryExpansionSpec_;
12712   }
12713   /**
12714    *
12715    *
12716    * <pre>
12717    * The query expansion specification that specifies the conditions under which
12718    * query expansion will occur. See more details at this [user
12719    * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
12720    * </pre>
12721    *
12722    * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
12723    * </code>
12724    */
12725   @java.lang.Override
12726   public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder
getQueryExpansionSpecOrBuilder()12727       getQueryExpansionSpecOrBuilder() {
12728     return queryExpansionSpec_ == null
12729         ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance()
12730         : queryExpansionSpec_;
12731   }
12732 
12733   public static final int VARIANT_ROLLUP_KEYS_FIELD_NUMBER = 17;
12734 
12735   @SuppressWarnings("serial")
12736   private com.google.protobuf.LazyStringList variantRollupKeys_;
12737   /**
12738    *
12739    *
12740    * <pre>
12741    * The keys to fetch and rollup the matching
12742    * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
12743    * [Product][google.cloud.retail.v2.Product]s attributes,
12744    * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
12745    * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
12746    * attributes from all the matching
12747    * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
12748    * [Product][google.cloud.retail.v2.Product]s or
12749    * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
12750    * de-duplicated. Notice that rollup attributes will lead to extra query
12751    * latency. Maximum number of keys is 30.
12752    * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
12753    * fulfillment type and a fulfillment ID must be provided in the format of
12754    * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
12755    * "pickupInStore" is fulfillment type and "store123" is the store ID.
12756    * Supported keys are:
12757    * * colorFamilies
12758    * * price
12759    * * originalPrice
12760    * * discount
12761    * * variantId
12762    * * inventory(place_id,price)
12763    * * inventory(place_id,original_price)
12764    * * inventory(place_id,attributes.key), where key is any key in the
12765    *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
12766    *   map.
12767    * * attributes.key, where key is any key in the
12768    *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
12769    * * pickupInStore.id, where id is any
12770    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12771    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12772    *   "pickup-in-store".
12773    * * shipToStore.id, where id is any
12774    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12775    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12776    *   "ship-to-store".
12777    * * sameDayDelivery.id, where id is any
12778    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12779    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12780    *   "same-day-delivery".
12781    * * nextDayDelivery.id, where id is any
12782    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12783    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12784    *   "next-day-delivery".
12785    * * customFulfillment1.id, where id is any
12786    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12787    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12788    *   "custom-type-1".
12789    * * customFulfillment2.id, where id is any
12790    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12791    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12792    *   "custom-type-2".
12793    * * customFulfillment3.id, where id is any
12794    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12795    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12796    *   "custom-type-3".
12797    * * customFulfillment4.id, where id is any
12798    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12799    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12800    *   "custom-type-4".
12801    * * customFulfillment5.id, where id is any
12802    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12803    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12804    *   "custom-type-5".
12805    * If this field is set to an invalid value other than these, an
12806    * INVALID_ARGUMENT error is returned.
12807    * </pre>
12808    *
12809    * <code>repeated string variant_rollup_keys = 17;</code>
12810    *
12811    * @return A list containing the variantRollupKeys.
12812    */
getVariantRollupKeysList()12813   public com.google.protobuf.ProtocolStringList getVariantRollupKeysList() {
12814     return variantRollupKeys_;
12815   }
12816   /**
12817    *
12818    *
12819    * <pre>
12820    * The keys to fetch and rollup the matching
12821    * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
12822    * [Product][google.cloud.retail.v2.Product]s attributes,
12823    * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
12824    * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
12825    * attributes from all the matching
12826    * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
12827    * [Product][google.cloud.retail.v2.Product]s or
12828    * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
12829    * de-duplicated. Notice that rollup attributes will lead to extra query
12830    * latency. Maximum number of keys is 30.
12831    * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
12832    * fulfillment type and a fulfillment ID must be provided in the format of
12833    * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
12834    * "pickupInStore" is fulfillment type and "store123" is the store ID.
12835    * Supported keys are:
12836    * * colorFamilies
12837    * * price
12838    * * originalPrice
12839    * * discount
12840    * * variantId
12841    * * inventory(place_id,price)
12842    * * inventory(place_id,original_price)
12843    * * inventory(place_id,attributes.key), where key is any key in the
12844    *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
12845    *   map.
12846    * * attributes.key, where key is any key in the
12847    *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
12848    * * pickupInStore.id, where id is any
12849    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12850    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12851    *   "pickup-in-store".
12852    * * shipToStore.id, where id is any
12853    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12854    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12855    *   "ship-to-store".
12856    * * sameDayDelivery.id, where id is any
12857    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12858    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12859    *   "same-day-delivery".
12860    * * nextDayDelivery.id, where id is any
12861    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12862    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12863    *   "next-day-delivery".
12864    * * customFulfillment1.id, where id is any
12865    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12866    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12867    *   "custom-type-1".
12868    * * customFulfillment2.id, where id is any
12869    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12870    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12871    *   "custom-type-2".
12872    * * customFulfillment3.id, where id is any
12873    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12874    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12875    *   "custom-type-3".
12876    * * customFulfillment4.id, where id is any
12877    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12878    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12879    *   "custom-type-4".
12880    * * customFulfillment5.id, where id is any
12881    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12882    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12883    *   "custom-type-5".
12884    * If this field is set to an invalid value other than these, an
12885    * INVALID_ARGUMENT error is returned.
12886    * </pre>
12887    *
12888    * <code>repeated string variant_rollup_keys = 17;</code>
12889    *
12890    * @return The count of variantRollupKeys.
12891    */
getVariantRollupKeysCount()12892   public int getVariantRollupKeysCount() {
12893     return variantRollupKeys_.size();
12894   }
12895   /**
12896    *
12897    *
12898    * <pre>
12899    * The keys to fetch and rollup the matching
12900    * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
12901    * [Product][google.cloud.retail.v2.Product]s attributes,
12902    * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
12903    * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
12904    * attributes from all the matching
12905    * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
12906    * [Product][google.cloud.retail.v2.Product]s or
12907    * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
12908    * de-duplicated. Notice that rollup attributes will lead to extra query
12909    * latency. Maximum number of keys is 30.
12910    * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
12911    * fulfillment type and a fulfillment ID must be provided in the format of
12912    * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
12913    * "pickupInStore" is fulfillment type and "store123" is the store ID.
12914    * Supported keys are:
12915    * * colorFamilies
12916    * * price
12917    * * originalPrice
12918    * * discount
12919    * * variantId
12920    * * inventory(place_id,price)
12921    * * inventory(place_id,original_price)
12922    * * inventory(place_id,attributes.key), where key is any key in the
12923    *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
12924    *   map.
12925    * * attributes.key, where key is any key in the
12926    *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
12927    * * pickupInStore.id, where id is any
12928    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12929    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12930    *   "pickup-in-store".
12931    * * shipToStore.id, where id is any
12932    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12933    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12934    *   "ship-to-store".
12935    * * sameDayDelivery.id, where id is any
12936    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12937    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12938    *   "same-day-delivery".
12939    * * nextDayDelivery.id, where id is any
12940    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12941    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12942    *   "next-day-delivery".
12943    * * customFulfillment1.id, where id is any
12944    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12945    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12946    *   "custom-type-1".
12947    * * customFulfillment2.id, where id is any
12948    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12949    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12950    *   "custom-type-2".
12951    * * customFulfillment3.id, where id is any
12952    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12953    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12954    *   "custom-type-3".
12955    * * customFulfillment4.id, where id is any
12956    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12957    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12958    *   "custom-type-4".
12959    * * customFulfillment5.id, where id is any
12960    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
12961    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
12962    *   "custom-type-5".
12963    * If this field is set to an invalid value other than these, an
12964    * INVALID_ARGUMENT error is returned.
12965    * </pre>
12966    *
12967    * <code>repeated string variant_rollup_keys = 17;</code>
12968    *
12969    * @param index The index of the element to return.
12970    * @return The variantRollupKeys at the given index.
12971    */
getVariantRollupKeys(int index)12972   public java.lang.String getVariantRollupKeys(int index) {
12973     return variantRollupKeys_.get(index);
12974   }
12975   /**
12976    *
12977    *
12978    * <pre>
12979    * The keys to fetch and rollup the matching
12980    * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
12981    * [Product][google.cloud.retail.v2.Product]s attributes,
12982    * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
12983    * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
12984    * attributes from all the matching
12985    * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
12986    * [Product][google.cloud.retail.v2.Product]s or
12987    * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
12988    * de-duplicated. Notice that rollup attributes will lead to extra query
12989    * latency. Maximum number of keys is 30.
12990    * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
12991    * fulfillment type and a fulfillment ID must be provided in the format of
12992    * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
12993    * "pickupInStore" is fulfillment type and "store123" is the store ID.
12994    * Supported keys are:
12995    * * colorFamilies
12996    * * price
12997    * * originalPrice
12998    * * discount
12999    * * variantId
13000    * * inventory(place_id,price)
13001    * * inventory(place_id,original_price)
13002    * * inventory(place_id,attributes.key), where key is any key in the
13003    *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
13004    *   map.
13005    * * attributes.key, where key is any key in the
13006    *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
13007    * * pickupInStore.id, where id is any
13008    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
13009    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
13010    *   "pickup-in-store".
13011    * * shipToStore.id, where id is any
13012    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
13013    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
13014    *   "ship-to-store".
13015    * * sameDayDelivery.id, where id is any
13016    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
13017    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
13018    *   "same-day-delivery".
13019    * * nextDayDelivery.id, where id is any
13020    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
13021    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
13022    *   "next-day-delivery".
13023    * * customFulfillment1.id, where id is any
13024    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
13025    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
13026    *   "custom-type-1".
13027    * * customFulfillment2.id, where id is any
13028    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
13029    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
13030    *   "custom-type-2".
13031    * * customFulfillment3.id, where id is any
13032    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
13033    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
13034    *   "custom-type-3".
13035    * * customFulfillment4.id, where id is any
13036    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
13037    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
13038    *   "custom-type-4".
13039    * * customFulfillment5.id, where id is any
13040    * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
13041    * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
13042    *   "custom-type-5".
13043    * If this field is set to an invalid value other than these, an
13044    * INVALID_ARGUMENT error is returned.
13045    * </pre>
13046    *
13047    * <code>repeated string variant_rollup_keys = 17;</code>
13048    *
13049    * @param index The index of the value to return.
13050    * @return The bytes of the variantRollupKeys at the given index.
13051    */
getVariantRollupKeysBytes(int index)13052   public com.google.protobuf.ByteString getVariantRollupKeysBytes(int index) {
13053     return variantRollupKeys_.getByteString(index);
13054   }
13055 
13056   public static final int PAGE_CATEGORIES_FIELD_NUMBER = 23;
13057 
13058   @SuppressWarnings("serial")
13059   private com.google.protobuf.LazyStringList pageCategories_;
13060   /**
13061    *
13062    *
13063    * <pre>
13064    * The categories associated with a category page. Required for category
13065    * navigation queries to achieve good search quality. The format should be
13066    * the same as
13067    * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
13068    * To represent full path of category, use '&gt;' sign to separate different
13069    * hierarchies. If '&gt;' is part of the category name, replace it with
13070    * other character(s).
13071    * Category pages include special pages such as sales or promotions. For
13072    * instance, a special sale page may have the category hierarchy:
13073    * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
13074    * </pre>
13075    *
13076    * <code>repeated string page_categories = 23;</code>
13077    *
13078    * @return A list containing the pageCategories.
13079    */
getPageCategoriesList()13080   public com.google.protobuf.ProtocolStringList getPageCategoriesList() {
13081     return pageCategories_;
13082   }
13083   /**
13084    *
13085    *
13086    * <pre>
13087    * The categories associated with a category page. Required for category
13088    * navigation queries to achieve good search quality. The format should be
13089    * the same as
13090    * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
13091    * To represent full path of category, use '&gt;' sign to separate different
13092    * hierarchies. If '&gt;' is part of the category name, replace it with
13093    * other character(s).
13094    * Category pages include special pages such as sales or promotions. For
13095    * instance, a special sale page may have the category hierarchy:
13096    * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
13097    * </pre>
13098    *
13099    * <code>repeated string page_categories = 23;</code>
13100    *
13101    * @return The count of pageCategories.
13102    */
getPageCategoriesCount()13103   public int getPageCategoriesCount() {
13104     return pageCategories_.size();
13105   }
13106   /**
13107    *
13108    *
13109    * <pre>
13110    * The categories associated with a category page. Required for category
13111    * navigation queries to achieve good search quality. The format should be
13112    * the same as
13113    * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
13114    * To represent full path of category, use '&gt;' sign to separate different
13115    * hierarchies. If '&gt;' is part of the category name, replace it with
13116    * other character(s).
13117    * Category pages include special pages such as sales or promotions. For
13118    * instance, a special sale page may have the category hierarchy:
13119    * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
13120    * </pre>
13121    *
13122    * <code>repeated string page_categories = 23;</code>
13123    *
13124    * @param index The index of the element to return.
13125    * @return The pageCategories at the given index.
13126    */
getPageCategories(int index)13127   public java.lang.String getPageCategories(int index) {
13128     return pageCategories_.get(index);
13129   }
13130   /**
13131    *
13132    *
13133    * <pre>
13134    * The categories associated with a category page. Required for category
13135    * navigation queries to achieve good search quality. The format should be
13136    * the same as
13137    * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
13138    * To represent full path of category, use '&gt;' sign to separate different
13139    * hierarchies. If '&gt;' is part of the category name, replace it with
13140    * other character(s).
13141    * Category pages include special pages such as sales or promotions. For
13142    * instance, a special sale page may have the category hierarchy:
13143    * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
13144    * </pre>
13145    *
13146    * <code>repeated string page_categories = 23;</code>
13147    *
13148    * @param index The index of the value to return.
13149    * @return The bytes of the pageCategories at the given index.
13150    */
getPageCategoriesBytes(int index)13151   public com.google.protobuf.ByteString getPageCategoriesBytes(int index) {
13152     return pageCategories_.getByteString(index);
13153   }
13154 
13155   public static final int SEARCH_MODE_FIELD_NUMBER = 31;
13156   private int searchMode_ = 0;
13157   /**
13158    *
13159    *
13160    * <pre>
13161    * The search mode of the search request. If not specified, a single search
13162    * request triggers both product search and faceted search.
13163    * </pre>
13164    *
13165    * <code>.google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31;</code>
13166    *
13167    * @return The enum numeric value on the wire for searchMode.
13168    */
13169   @java.lang.Override
getSearchModeValue()13170   public int getSearchModeValue() {
13171     return searchMode_;
13172   }
13173   /**
13174    *
13175    *
13176    * <pre>
13177    * The search mode of the search request. If not specified, a single search
13178    * request triggers both product search and faceted search.
13179    * </pre>
13180    *
13181    * <code>.google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31;</code>
13182    *
13183    * @return The searchMode.
13184    */
13185   @java.lang.Override
getSearchMode()13186   public com.google.cloud.retail.v2.SearchRequest.SearchMode getSearchMode() {
13187     com.google.cloud.retail.v2.SearchRequest.SearchMode result =
13188         com.google.cloud.retail.v2.SearchRequest.SearchMode.forNumber(searchMode_);
13189     return result == null
13190         ? com.google.cloud.retail.v2.SearchRequest.SearchMode.UNRECOGNIZED
13191         : result;
13192   }
13193 
13194   public static final int PERSONALIZATION_SPEC_FIELD_NUMBER = 32;
13195   private com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalizationSpec_;
13196   /**
13197    *
13198    *
13199    * <pre>
13200    * The specification for personalization.
13201    * Notice that if both
13202    * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
13203    * and
13204    * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
13205    * are set.
13206    * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
13207    * will override
13208    * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
13209    * </pre>
13210    *
13211    * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
13212    * </code>
13213    *
13214    * @return Whether the personalizationSpec field is set.
13215    */
13216   @java.lang.Override
hasPersonalizationSpec()13217   public boolean hasPersonalizationSpec() {
13218     return personalizationSpec_ != null;
13219   }
13220   /**
13221    *
13222    *
13223    * <pre>
13224    * The specification for personalization.
13225    * Notice that if both
13226    * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
13227    * and
13228    * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
13229    * are set.
13230    * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
13231    * will override
13232    * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
13233    * </pre>
13234    *
13235    * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
13236    * </code>
13237    *
13238    * @return The personalizationSpec.
13239    */
13240   @java.lang.Override
getPersonalizationSpec()13241   public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec getPersonalizationSpec() {
13242     return personalizationSpec_ == null
13243         ? com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.getDefaultInstance()
13244         : personalizationSpec_;
13245   }
13246   /**
13247    *
13248    *
13249    * <pre>
13250    * The specification for personalization.
13251    * Notice that if both
13252    * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
13253    * and
13254    * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
13255    * are set.
13256    * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
13257    * will override
13258    * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
13259    * </pre>
13260    *
13261    * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
13262    * </code>
13263    */
13264   @java.lang.Override
13265   public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpecOrBuilder
getPersonalizationSpecOrBuilder()13266       getPersonalizationSpecOrBuilder() {
13267     return personalizationSpec_ == null
13268         ? com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.getDefaultInstance()
13269         : personalizationSpec_;
13270   }
13271 
13272   public static final int LABELS_FIELD_NUMBER = 34;
13273 
13274   private static final class LabelsDefaultEntryHolder {
13275     static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
13276         com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
13277             com.google.cloud.retail.v2.SearchServiceProto
13278                 .internal_static_google_cloud_retail_v2_SearchRequest_LabelsEntry_descriptor,
13279             com.google.protobuf.WireFormat.FieldType.STRING,
13280             "",
13281             com.google.protobuf.WireFormat.FieldType.STRING,
13282             "");
13283   }
13284 
13285   @SuppressWarnings("serial")
13286   private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;
13287 
internalGetLabels()13288   private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
13289     if (labels_ == null) {
13290       return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
13291     }
13292     return labels_;
13293   }
13294 
getLabelsCount()13295   public int getLabelsCount() {
13296     return internalGetLabels().getMap().size();
13297   }
13298   /**
13299    *
13300    *
13301    * <pre>
13302    * The labels applied to a resource must meet the following requirements:
13303    * * Each resource can have multiple labels, up to a maximum of 64.
13304    * * Each label must be a key-value pair.
13305    * * Keys have a minimum length of 1 character and a maximum length of 63
13306    *   characters and cannot be empty. Values can be empty and have a maximum
13307    *   length of 63 characters.
13308    * * Keys and values can contain only lowercase letters, numeric characters,
13309    *   underscores, and dashes. All characters must use UTF-8 encoding, and
13310    *   international characters are allowed.
13311    * * The key portion of a label must be unique. However, you can use the same
13312    *   key with multiple resources.
13313    * * Keys must start with a lowercase letter or international character.
13314    * See [Google Cloud
13315    * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
13316    * for more details.
13317    * </pre>
13318    *
13319    * <code>map&lt;string, string&gt; labels = 34;</code>
13320    */
13321   @java.lang.Override
containsLabels(java.lang.String key)13322   public boolean containsLabels(java.lang.String key) {
13323     if (key == null) {
13324       throw new NullPointerException("map key");
13325     }
13326     return internalGetLabels().getMap().containsKey(key);
13327   }
13328   /** Use {@link #getLabelsMap()} instead. */
13329   @java.lang.Override
13330   @java.lang.Deprecated
getLabels()13331   public java.util.Map<java.lang.String, java.lang.String> getLabels() {
13332     return getLabelsMap();
13333   }
13334   /**
13335    *
13336    *
13337    * <pre>
13338    * The labels applied to a resource must meet the following requirements:
13339    * * Each resource can have multiple labels, up to a maximum of 64.
13340    * * Each label must be a key-value pair.
13341    * * Keys have a minimum length of 1 character and a maximum length of 63
13342    *   characters and cannot be empty. Values can be empty and have a maximum
13343    *   length of 63 characters.
13344    * * Keys and values can contain only lowercase letters, numeric characters,
13345    *   underscores, and dashes. All characters must use UTF-8 encoding, and
13346    *   international characters are allowed.
13347    * * The key portion of a label must be unique. However, you can use the same
13348    *   key with multiple resources.
13349    * * Keys must start with a lowercase letter or international character.
13350    * See [Google Cloud
13351    * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
13352    * for more details.
13353    * </pre>
13354    *
13355    * <code>map&lt;string, string&gt; labels = 34;</code>
13356    */
13357   @java.lang.Override
getLabelsMap()13358   public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
13359     return internalGetLabels().getMap();
13360   }
13361   /**
13362    *
13363    *
13364    * <pre>
13365    * The labels applied to a resource must meet the following requirements:
13366    * * Each resource can have multiple labels, up to a maximum of 64.
13367    * * Each label must be a key-value pair.
13368    * * Keys have a minimum length of 1 character and a maximum length of 63
13369    *   characters and cannot be empty. Values can be empty and have a maximum
13370    *   length of 63 characters.
13371    * * Keys and values can contain only lowercase letters, numeric characters,
13372    *   underscores, and dashes. All characters must use UTF-8 encoding, and
13373    *   international characters are allowed.
13374    * * The key portion of a label must be unique. However, you can use the same
13375    *   key with multiple resources.
13376    * * Keys must start with a lowercase letter or international character.
13377    * See [Google Cloud
13378    * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
13379    * for more details.
13380    * </pre>
13381    *
13382    * <code>map&lt;string, string&gt; labels = 34;</code>
13383    */
13384   @java.lang.Override
getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue)13385   public /* nullable */ java.lang.String getLabelsOrDefault(
13386       java.lang.String key,
13387       /* nullable */
13388       java.lang.String defaultValue) {
13389     if (key == null) {
13390       throw new NullPointerException("map key");
13391     }
13392     java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
13393     return map.containsKey(key) ? map.get(key) : defaultValue;
13394   }
13395   /**
13396    *
13397    *
13398    * <pre>
13399    * The labels applied to a resource must meet the following requirements:
13400    * * Each resource can have multiple labels, up to a maximum of 64.
13401    * * Each label must be a key-value pair.
13402    * * Keys have a minimum length of 1 character and a maximum length of 63
13403    *   characters and cannot be empty. Values can be empty and have a maximum
13404    *   length of 63 characters.
13405    * * Keys and values can contain only lowercase letters, numeric characters,
13406    *   underscores, and dashes. All characters must use UTF-8 encoding, and
13407    *   international characters are allowed.
13408    * * The key portion of a label must be unique. However, you can use the same
13409    *   key with multiple resources.
13410    * * Keys must start with a lowercase letter or international character.
13411    * See [Google Cloud
13412    * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
13413    * for more details.
13414    * </pre>
13415    *
13416    * <code>map&lt;string, string&gt; labels = 34;</code>
13417    */
13418   @java.lang.Override
getLabelsOrThrow(java.lang.String key)13419   public java.lang.String getLabelsOrThrow(java.lang.String key) {
13420     if (key == null) {
13421       throw new NullPointerException("map key");
13422     }
13423     java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
13424     if (!map.containsKey(key)) {
13425       throw new java.lang.IllegalArgumentException();
13426     }
13427     return map.get(key);
13428   }
13429 
13430   public static final int SPELL_CORRECTION_SPEC_FIELD_NUMBER = 35;
13431   private com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spellCorrectionSpec_;
13432   /**
13433    *
13434    *
13435    * <pre>
13436    * The spell correction specification that specifies the mode under
13437    * which spell correction will take effect.
13438    * </pre>
13439    *
13440    * <code>
13441    * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
13442    * </code>
13443    *
13444    * @return Whether the spellCorrectionSpec field is set.
13445    */
13446   @java.lang.Override
hasSpellCorrectionSpec()13447   public boolean hasSpellCorrectionSpec() {
13448     return ((bitField0_ & 0x00000001) != 0);
13449   }
13450   /**
13451    *
13452    *
13453    * <pre>
13454    * The spell correction specification that specifies the mode under
13455    * which spell correction will take effect.
13456    * </pre>
13457    *
13458    * <code>
13459    * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
13460    * </code>
13461    *
13462    * @return The spellCorrectionSpec.
13463    */
13464   @java.lang.Override
getSpellCorrectionSpec()13465   public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec getSpellCorrectionSpec() {
13466     return spellCorrectionSpec_ == null
13467         ? com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.getDefaultInstance()
13468         : spellCorrectionSpec_;
13469   }
13470   /**
13471    *
13472    *
13473    * <pre>
13474    * The spell correction specification that specifies the mode under
13475    * which spell correction will take effect.
13476    * </pre>
13477    *
13478    * <code>
13479    * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
13480    * </code>
13481    */
13482   @java.lang.Override
13483   public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpecOrBuilder
getSpellCorrectionSpecOrBuilder()13484       getSpellCorrectionSpecOrBuilder() {
13485     return spellCorrectionSpec_ == null
13486         ? com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.getDefaultInstance()
13487         : spellCorrectionSpec_;
13488   }
13489 
13490   public static final int ENTITY_FIELD_NUMBER = 38;
13491 
13492   @SuppressWarnings("serial")
13493   private volatile java.lang.Object entity_ = "";
13494   /**
13495    *
13496    *
13497    * <pre>
13498    * The entity for customers that may run multiple different entities, domains,
13499    * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`,
13500    * `google.com`, `youtube.com`, etc.
13501    * If this is set, it should be exactly matched with
13502    * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search
13503    * results boosted by entity.
13504    * </pre>
13505    *
13506    * <code>string entity = 38;</code>
13507    *
13508    * @return The entity.
13509    */
13510   @java.lang.Override
getEntity()13511   public java.lang.String getEntity() {
13512     java.lang.Object ref = entity_;
13513     if (ref instanceof java.lang.String) {
13514       return (java.lang.String) ref;
13515     } else {
13516       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
13517       java.lang.String s = bs.toStringUtf8();
13518       entity_ = s;
13519       return s;
13520     }
13521   }
13522   /**
13523    *
13524    *
13525    * <pre>
13526    * The entity for customers that may run multiple different entities, domains,
13527    * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`,
13528    * `google.com`, `youtube.com`, etc.
13529    * If this is set, it should be exactly matched with
13530    * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search
13531    * results boosted by entity.
13532    * </pre>
13533    *
13534    * <code>string entity = 38;</code>
13535    *
13536    * @return The bytes for entity.
13537    */
13538   @java.lang.Override
getEntityBytes()13539   public com.google.protobuf.ByteString getEntityBytes() {
13540     java.lang.Object ref = entity_;
13541     if (ref instanceof java.lang.String) {
13542       com.google.protobuf.ByteString b =
13543           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
13544       entity_ = b;
13545       return b;
13546     } else {
13547       return (com.google.protobuf.ByteString) ref;
13548     }
13549   }
13550 
13551   private byte memoizedIsInitialized = -1;
13552 
13553   @java.lang.Override
isInitialized()13554   public final boolean isInitialized() {
13555     byte isInitialized = memoizedIsInitialized;
13556     if (isInitialized == 1) return true;
13557     if (isInitialized == 0) return false;
13558 
13559     memoizedIsInitialized = 1;
13560     return true;
13561   }
13562 
13563   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)13564   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
13565     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(placement_)) {
13566       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, placement_);
13567     }
13568     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) {
13569       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branch_);
13570     }
13571     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) {
13572       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_);
13573     }
13574     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) {
13575       com.google.protobuf.GeneratedMessageV3.writeString(output, 4, visitorId_);
13576     }
13577     if (userInfo_ != null) {
13578       output.writeMessage(5, getUserInfo());
13579     }
13580     if (pageSize_ != 0) {
13581       output.writeInt32(7, pageSize_);
13582     }
13583     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
13584       com.google.protobuf.GeneratedMessageV3.writeString(output, 8, pageToken_);
13585     }
13586     if (offset_ != 0) {
13587       output.writeInt32(9, offset_);
13588     }
13589     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) {
13590       com.google.protobuf.GeneratedMessageV3.writeString(output, 10, filter_);
13591     }
13592     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) {
13593       com.google.protobuf.GeneratedMessageV3.writeString(output, 11, orderBy_);
13594     }
13595     for (int i = 0; i < facetSpecs_.size(); i++) {
13596       output.writeMessage(12, facetSpecs_.get(i));
13597     }
13598     if (boostSpec_ != null) {
13599       output.writeMessage(13, getBoostSpec());
13600     }
13601     if (queryExpansionSpec_ != null) {
13602       output.writeMessage(14, getQueryExpansionSpec());
13603     }
13604     for (int i = 0; i < variantRollupKeys_.size(); i++) {
13605       com.google.protobuf.GeneratedMessageV3.writeString(output, 17, variantRollupKeys_.getRaw(i));
13606     }
13607     if (dynamicFacetSpec_ != null) {
13608       output.writeMessage(21, getDynamicFacetSpec());
13609     }
13610     for (int i = 0; i < pageCategories_.size(); i++) {
13611       com.google.protobuf.GeneratedMessageV3.writeString(output, 23, pageCategories_.getRaw(i));
13612     }
13613     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(canonicalFilter_)) {
13614       com.google.protobuf.GeneratedMessageV3.writeString(output, 28, canonicalFilter_);
13615     }
13616     if (searchMode_
13617         != com.google.cloud.retail.v2.SearchRequest.SearchMode.SEARCH_MODE_UNSPECIFIED
13618             .getNumber()) {
13619       output.writeEnum(31, searchMode_);
13620     }
13621     if (personalizationSpec_ != null) {
13622       output.writeMessage(32, getPersonalizationSpec());
13623     }
13624     com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
13625         output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 34);
13626     if (((bitField0_ & 0x00000001) != 0)) {
13627       output.writeMessage(35, getSpellCorrectionSpec());
13628     }
13629     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entity_)) {
13630       com.google.protobuf.GeneratedMessageV3.writeString(output, 38, entity_);
13631     }
13632     getUnknownFields().writeTo(output);
13633   }
13634 
13635   @java.lang.Override
getSerializedSize()13636   public int getSerializedSize() {
13637     int size = memoizedSize;
13638     if (size != -1) return size;
13639 
13640     size = 0;
13641     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(placement_)) {
13642       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, placement_);
13643     }
13644     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) {
13645       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branch_);
13646     }
13647     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) {
13648       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, query_);
13649     }
13650     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) {
13651       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, visitorId_);
13652     }
13653     if (userInfo_ != null) {
13654       size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUserInfo());
13655     }
13656     if (pageSize_ != 0) {
13657       size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, pageSize_);
13658     }
13659     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
13660       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, pageToken_);
13661     }
13662     if (offset_ != 0) {
13663       size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, offset_);
13664     }
13665     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) {
13666       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, filter_);
13667     }
13668     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) {
13669       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, orderBy_);
13670     }
13671     for (int i = 0; i < facetSpecs_.size(); i++) {
13672       size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, facetSpecs_.get(i));
13673     }
13674     if (boostSpec_ != null) {
13675       size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getBoostSpec());
13676     }
13677     if (queryExpansionSpec_ != null) {
13678       size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getQueryExpansionSpec());
13679     }
13680     {
13681       int dataSize = 0;
13682       for (int i = 0; i < variantRollupKeys_.size(); i++) {
13683         dataSize += computeStringSizeNoTag(variantRollupKeys_.getRaw(i));
13684       }
13685       size += dataSize;
13686       size += 2 * getVariantRollupKeysList().size();
13687     }
13688     if (dynamicFacetSpec_ != null) {
13689       size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getDynamicFacetSpec());
13690     }
13691     {
13692       int dataSize = 0;
13693       for (int i = 0; i < pageCategories_.size(); i++) {
13694         dataSize += computeStringSizeNoTag(pageCategories_.getRaw(i));
13695       }
13696       size += dataSize;
13697       size += 2 * getPageCategoriesList().size();
13698     }
13699     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(canonicalFilter_)) {
13700       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(28, canonicalFilter_);
13701     }
13702     if (searchMode_
13703         != com.google.cloud.retail.v2.SearchRequest.SearchMode.SEARCH_MODE_UNSPECIFIED
13704             .getNumber()) {
13705       size += com.google.protobuf.CodedOutputStream.computeEnumSize(31, searchMode_);
13706     }
13707     if (personalizationSpec_ != null) {
13708       size +=
13709           com.google.protobuf.CodedOutputStream.computeMessageSize(32, getPersonalizationSpec());
13710     }
13711     for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
13712         internalGetLabels().getMap().entrySet()) {
13713       com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
13714           LabelsDefaultEntryHolder.defaultEntry
13715               .newBuilderForType()
13716               .setKey(entry.getKey())
13717               .setValue(entry.getValue())
13718               .build();
13719       size += com.google.protobuf.CodedOutputStream.computeMessageSize(34, labels__);
13720     }
13721     if (((bitField0_ & 0x00000001) != 0)) {
13722       size +=
13723           com.google.protobuf.CodedOutputStream.computeMessageSize(35, getSpellCorrectionSpec());
13724     }
13725     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entity_)) {
13726       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(38, entity_);
13727     }
13728     size += getUnknownFields().getSerializedSize();
13729     memoizedSize = size;
13730     return size;
13731   }
13732 
13733   @java.lang.Override
equals(final java.lang.Object obj)13734   public boolean equals(final java.lang.Object obj) {
13735     if (obj == this) {
13736       return true;
13737     }
13738     if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest)) {
13739       return super.equals(obj);
13740     }
13741     com.google.cloud.retail.v2.SearchRequest other = (com.google.cloud.retail.v2.SearchRequest) obj;
13742 
13743     if (!getPlacement().equals(other.getPlacement())) return false;
13744     if (!getBranch().equals(other.getBranch())) return false;
13745     if (!getQuery().equals(other.getQuery())) return false;
13746     if (!getVisitorId().equals(other.getVisitorId())) return false;
13747     if (hasUserInfo() != other.hasUserInfo()) return false;
13748     if (hasUserInfo()) {
13749       if (!getUserInfo().equals(other.getUserInfo())) return false;
13750     }
13751     if (getPageSize() != other.getPageSize()) return false;
13752     if (!getPageToken().equals(other.getPageToken())) return false;
13753     if (getOffset() != other.getOffset()) return false;
13754     if (!getFilter().equals(other.getFilter())) return false;
13755     if (!getCanonicalFilter().equals(other.getCanonicalFilter())) return false;
13756     if (!getOrderBy().equals(other.getOrderBy())) return false;
13757     if (!getFacetSpecsList().equals(other.getFacetSpecsList())) return false;
13758     if (hasDynamicFacetSpec() != other.hasDynamicFacetSpec()) return false;
13759     if (hasDynamicFacetSpec()) {
13760       if (!getDynamicFacetSpec().equals(other.getDynamicFacetSpec())) return false;
13761     }
13762     if (hasBoostSpec() != other.hasBoostSpec()) return false;
13763     if (hasBoostSpec()) {
13764       if (!getBoostSpec().equals(other.getBoostSpec())) return false;
13765     }
13766     if (hasQueryExpansionSpec() != other.hasQueryExpansionSpec()) return false;
13767     if (hasQueryExpansionSpec()) {
13768       if (!getQueryExpansionSpec().equals(other.getQueryExpansionSpec())) return false;
13769     }
13770     if (!getVariantRollupKeysList().equals(other.getVariantRollupKeysList())) return false;
13771     if (!getPageCategoriesList().equals(other.getPageCategoriesList())) return false;
13772     if (searchMode_ != other.searchMode_) return false;
13773     if (hasPersonalizationSpec() != other.hasPersonalizationSpec()) return false;
13774     if (hasPersonalizationSpec()) {
13775       if (!getPersonalizationSpec().equals(other.getPersonalizationSpec())) return false;
13776     }
13777     if (!internalGetLabels().equals(other.internalGetLabels())) return false;
13778     if (hasSpellCorrectionSpec() != other.hasSpellCorrectionSpec()) return false;
13779     if (hasSpellCorrectionSpec()) {
13780       if (!getSpellCorrectionSpec().equals(other.getSpellCorrectionSpec())) return false;
13781     }
13782     if (!getEntity().equals(other.getEntity())) return false;
13783     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
13784     return true;
13785   }
13786 
13787   @java.lang.Override
hashCode()13788   public int hashCode() {
13789     if (memoizedHashCode != 0) {
13790       return memoizedHashCode;
13791     }
13792     int hash = 41;
13793     hash = (19 * hash) + getDescriptor().hashCode();
13794     hash = (37 * hash) + PLACEMENT_FIELD_NUMBER;
13795     hash = (53 * hash) + getPlacement().hashCode();
13796     hash = (37 * hash) + BRANCH_FIELD_NUMBER;
13797     hash = (53 * hash) + getBranch().hashCode();
13798     hash = (37 * hash) + QUERY_FIELD_NUMBER;
13799     hash = (53 * hash) + getQuery().hashCode();
13800     hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER;
13801     hash = (53 * hash) + getVisitorId().hashCode();
13802     if (hasUserInfo()) {
13803       hash = (37 * hash) + USER_INFO_FIELD_NUMBER;
13804       hash = (53 * hash) + getUserInfo().hashCode();
13805     }
13806     hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER;
13807     hash = (53 * hash) + getPageSize();
13808     hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER;
13809     hash = (53 * hash) + getPageToken().hashCode();
13810     hash = (37 * hash) + OFFSET_FIELD_NUMBER;
13811     hash = (53 * hash) + getOffset();
13812     hash = (37 * hash) + FILTER_FIELD_NUMBER;
13813     hash = (53 * hash) + getFilter().hashCode();
13814     hash = (37 * hash) + CANONICAL_FILTER_FIELD_NUMBER;
13815     hash = (53 * hash) + getCanonicalFilter().hashCode();
13816     hash = (37 * hash) + ORDER_BY_FIELD_NUMBER;
13817     hash = (53 * hash) + getOrderBy().hashCode();
13818     if (getFacetSpecsCount() > 0) {
13819       hash = (37 * hash) + FACET_SPECS_FIELD_NUMBER;
13820       hash = (53 * hash) + getFacetSpecsList().hashCode();
13821     }
13822     if (hasDynamicFacetSpec()) {
13823       hash = (37 * hash) + DYNAMIC_FACET_SPEC_FIELD_NUMBER;
13824       hash = (53 * hash) + getDynamicFacetSpec().hashCode();
13825     }
13826     if (hasBoostSpec()) {
13827       hash = (37 * hash) + BOOST_SPEC_FIELD_NUMBER;
13828       hash = (53 * hash) + getBoostSpec().hashCode();
13829     }
13830     if (hasQueryExpansionSpec()) {
13831       hash = (37 * hash) + QUERY_EXPANSION_SPEC_FIELD_NUMBER;
13832       hash = (53 * hash) + getQueryExpansionSpec().hashCode();
13833     }
13834     if (getVariantRollupKeysCount() > 0) {
13835       hash = (37 * hash) + VARIANT_ROLLUP_KEYS_FIELD_NUMBER;
13836       hash = (53 * hash) + getVariantRollupKeysList().hashCode();
13837     }
13838     if (getPageCategoriesCount() > 0) {
13839       hash = (37 * hash) + PAGE_CATEGORIES_FIELD_NUMBER;
13840       hash = (53 * hash) + getPageCategoriesList().hashCode();
13841     }
13842     hash = (37 * hash) + SEARCH_MODE_FIELD_NUMBER;
13843     hash = (53 * hash) + searchMode_;
13844     if (hasPersonalizationSpec()) {
13845       hash = (37 * hash) + PERSONALIZATION_SPEC_FIELD_NUMBER;
13846       hash = (53 * hash) + getPersonalizationSpec().hashCode();
13847     }
13848     if (!internalGetLabels().getMap().isEmpty()) {
13849       hash = (37 * hash) + LABELS_FIELD_NUMBER;
13850       hash = (53 * hash) + internalGetLabels().hashCode();
13851     }
13852     if (hasSpellCorrectionSpec()) {
13853       hash = (37 * hash) + SPELL_CORRECTION_SPEC_FIELD_NUMBER;
13854       hash = (53 * hash) + getSpellCorrectionSpec().hashCode();
13855     }
13856     hash = (37 * hash) + ENTITY_FIELD_NUMBER;
13857     hash = (53 * hash) + getEntity().hashCode();
13858     hash = (29 * hash) + getUnknownFields().hashCode();
13859     memoizedHashCode = hash;
13860     return hash;
13861   }
13862 
parseFrom(java.nio.ByteBuffer data)13863   public static com.google.cloud.retail.v2.SearchRequest parseFrom(java.nio.ByteBuffer data)
13864       throws com.google.protobuf.InvalidProtocolBufferException {
13865     return PARSER.parseFrom(data);
13866   }
13867 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)13868   public static com.google.cloud.retail.v2.SearchRequest parseFrom(
13869       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
13870       throws com.google.protobuf.InvalidProtocolBufferException {
13871     return PARSER.parseFrom(data, extensionRegistry);
13872   }
13873 
parseFrom( com.google.protobuf.ByteString data)13874   public static com.google.cloud.retail.v2.SearchRequest parseFrom(
13875       com.google.protobuf.ByteString data)
13876       throws com.google.protobuf.InvalidProtocolBufferException {
13877     return PARSER.parseFrom(data);
13878   }
13879 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)13880   public static com.google.cloud.retail.v2.SearchRequest parseFrom(
13881       com.google.protobuf.ByteString data,
13882       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
13883       throws com.google.protobuf.InvalidProtocolBufferException {
13884     return PARSER.parseFrom(data, extensionRegistry);
13885   }
13886 
parseFrom(byte[] data)13887   public static com.google.cloud.retail.v2.SearchRequest parseFrom(byte[] data)
13888       throws com.google.protobuf.InvalidProtocolBufferException {
13889     return PARSER.parseFrom(data);
13890   }
13891 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)13892   public static com.google.cloud.retail.v2.SearchRequest parseFrom(
13893       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
13894       throws com.google.protobuf.InvalidProtocolBufferException {
13895     return PARSER.parseFrom(data, extensionRegistry);
13896   }
13897 
parseFrom(java.io.InputStream input)13898   public static com.google.cloud.retail.v2.SearchRequest parseFrom(java.io.InputStream input)
13899       throws java.io.IOException {
13900     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
13901   }
13902 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)13903   public static com.google.cloud.retail.v2.SearchRequest parseFrom(
13904       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
13905       throws java.io.IOException {
13906     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
13907         PARSER, input, extensionRegistry);
13908   }
13909 
parseDelimitedFrom( java.io.InputStream input)13910   public static com.google.cloud.retail.v2.SearchRequest parseDelimitedFrom(
13911       java.io.InputStream input) throws java.io.IOException {
13912     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
13913   }
13914 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)13915   public static com.google.cloud.retail.v2.SearchRequest parseDelimitedFrom(
13916       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
13917       throws java.io.IOException {
13918     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
13919         PARSER, input, extensionRegistry);
13920   }
13921 
parseFrom( com.google.protobuf.CodedInputStream input)13922   public static com.google.cloud.retail.v2.SearchRequest parseFrom(
13923       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
13924     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
13925   }
13926 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)13927   public static com.google.cloud.retail.v2.SearchRequest parseFrom(
13928       com.google.protobuf.CodedInputStream input,
13929       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
13930       throws java.io.IOException {
13931     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
13932         PARSER, input, extensionRegistry);
13933   }
13934 
13935   @java.lang.Override
newBuilderForType()13936   public Builder newBuilderForType() {
13937     return newBuilder();
13938   }
13939 
newBuilder()13940   public static Builder newBuilder() {
13941     return DEFAULT_INSTANCE.toBuilder();
13942   }
13943 
newBuilder(com.google.cloud.retail.v2.SearchRequest prototype)13944   public static Builder newBuilder(com.google.cloud.retail.v2.SearchRequest prototype) {
13945     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
13946   }
13947 
13948   @java.lang.Override
toBuilder()13949   public Builder toBuilder() {
13950     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
13951   }
13952 
13953   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)13954   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
13955     Builder builder = new Builder(parent);
13956     return builder;
13957   }
13958   /**
13959    *
13960    *
13961    * <pre>
13962    * Request message for
13963    * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] method.
13964    * </pre>
13965    *
13966    * Protobuf type {@code google.cloud.retail.v2.SearchRequest}
13967    */
13968   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
13969       implements
13970       // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest)
13971       com.google.cloud.retail.v2.SearchRequestOrBuilder {
getDescriptor()13972     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
13973       return com.google.cloud.retail.v2.SearchServiceProto
13974           .internal_static_google_cloud_retail_v2_SearchRequest_descriptor;
13975     }
13976 
13977     @SuppressWarnings({"rawtypes"})
internalGetMapField(int number)13978     protected com.google.protobuf.MapField internalGetMapField(int number) {
13979       switch (number) {
13980         case 34:
13981           return internalGetLabels();
13982         default:
13983           throw new RuntimeException("Invalid map field number: " + number);
13984       }
13985     }
13986 
13987     @SuppressWarnings({"rawtypes"})
internalGetMutableMapField(int number)13988     protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
13989       switch (number) {
13990         case 34:
13991           return internalGetMutableLabels();
13992         default:
13993           throw new RuntimeException("Invalid map field number: " + number);
13994       }
13995     }
13996 
13997     @java.lang.Override
13998     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()13999         internalGetFieldAccessorTable() {
14000       return com.google.cloud.retail.v2.SearchServiceProto
14001           .internal_static_google_cloud_retail_v2_SearchRequest_fieldAccessorTable
14002           .ensureFieldAccessorsInitialized(
14003               com.google.cloud.retail.v2.SearchRequest.class,
14004               com.google.cloud.retail.v2.SearchRequest.Builder.class);
14005     }
14006 
14007     // Construct using com.google.cloud.retail.v2.SearchRequest.newBuilder()
Builder()14008     private Builder() {
14009       maybeForceBuilderInitialization();
14010     }
14011 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)14012     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
14013       super(parent);
14014       maybeForceBuilderInitialization();
14015     }
14016 
maybeForceBuilderInitialization()14017     private void maybeForceBuilderInitialization() {
14018       if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
14019         getUserInfoFieldBuilder();
14020         getFacetSpecsFieldBuilder();
14021         getDynamicFacetSpecFieldBuilder();
14022         getBoostSpecFieldBuilder();
14023         getQueryExpansionSpecFieldBuilder();
14024         getPersonalizationSpecFieldBuilder();
14025         getSpellCorrectionSpecFieldBuilder();
14026       }
14027     }
14028 
14029     @java.lang.Override
clear()14030     public Builder clear() {
14031       super.clear();
14032       bitField0_ = 0;
14033       placement_ = "";
14034       branch_ = "";
14035       query_ = "";
14036       visitorId_ = "";
14037       userInfo_ = null;
14038       if (userInfoBuilder_ != null) {
14039         userInfoBuilder_.dispose();
14040         userInfoBuilder_ = null;
14041       }
14042       pageSize_ = 0;
14043       pageToken_ = "";
14044       offset_ = 0;
14045       filter_ = "";
14046       canonicalFilter_ = "";
14047       orderBy_ = "";
14048       if (facetSpecsBuilder_ == null) {
14049         facetSpecs_ = java.util.Collections.emptyList();
14050       } else {
14051         facetSpecs_ = null;
14052         facetSpecsBuilder_.clear();
14053       }
14054       bitField0_ = (bitField0_ & ~0x00000800);
14055       dynamicFacetSpec_ = null;
14056       if (dynamicFacetSpecBuilder_ != null) {
14057         dynamicFacetSpecBuilder_.dispose();
14058         dynamicFacetSpecBuilder_ = null;
14059       }
14060       boostSpec_ = null;
14061       if (boostSpecBuilder_ != null) {
14062         boostSpecBuilder_.dispose();
14063         boostSpecBuilder_ = null;
14064       }
14065       queryExpansionSpec_ = null;
14066       if (queryExpansionSpecBuilder_ != null) {
14067         queryExpansionSpecBuilder_.dispose();
14068         queryExpansionSpecBuilder_ = null;
14069       }
14070       variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
14071       bitField0_ = (bitField0_ & ~0x00008000);
14072       pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY;
14073       bitField0_ = (bitField0_ & ~0x00010000);
14074       searchMode_ = 0;
14075       personalizationSpec_ = null;
14076       if (personalizationSpecBuilder_ != null) {
14077         personalizationSpecBuilder_.dispose();
14078         personalizationSpecBuilder_ = null;
14079       }
14080       internalGetMutableLabels().clear();
14081       spellCorrectionSpec_ = null;
14082       if (spellCorrectionSpecBuilder_ != null) {
14083         spellCorrectionSpecBuilder_.dispose();
14084         spellCorrectionSpecBuilder_ = null;
14085       }
14086       entity_ = "";
14087       return this;
14088     }
14089 
14090     @java.lang.Override
getDescriptorForType()14091     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
14092       return com.google.cloud.retail.v2.SearchServiceProto
14093           .internal_static_google_cloud_retail_v2_SearchRequest_descriptor;
14094     }
14095 
14096     @java.lang.Override
getDefaultInstanceForType()14097     public com.google.cloud.retail.v2.SearchRequest getDefaultInstanceForType() {
14098       return com.google.cloud.retail.v2.SearchRequest.getDefaultInstance();
14099     }
14100 
14101     @java.lang.Override
build()14102     public com.google.cloud.retail.v2.SearchRequest build() {
14103       com.google.cloud.retail.v2.SearchRequest result = buildPartial();
14104       if (!result.isInitialized()) {
14105         throw newUninitializedMessageException(result);
14106       }
14107       return result;
14108     }
14109 
14110     @java.lang.Override
buildPartial()14111     public com.google.cloud.retail.v2.SearchRequest buildPartial() {
14112       com.google.cloud.retail.v2.SearchRequest result =
14113           new com.google.cloud.retail.v2.SearchRequest(this);
14114       buildPartialRepeatedFields(result);
14115       if (bitField0_ != 0) {
14116         buildPartial0(result);
14117       }
14118       onBuilt();
14119       return result;
14120     }
14121 
buildPartialRepeatedFields(com.google.cloud.retail.v2.SearchRequest result)14122     private void buildPartialRepeatedFields(com.google.cloud.retail.v2.SearchRequest result) {
14123       if (facetSpecsBuilder_ == null) {
14124         if (((bitField0_ & 0x00000800) != 0)) {
14125           facetSpecs_ = java.util.Collections.unmodifiableList(facetSpecs_);
14126           bitField0_ = (bitField0_ & ~0x00000800);
14127         }
14128         result.facetSpecs_ = facetSpecs_;
14129       } else {
14130         result.facetSpecs_ = facetSpecsBuilder_.build();
14131       }
14132       if (((bitField0_ & 0x00008000) != 0)) {
14133         variantRollupKeys_ = variantRollupKeys_.getUnmodifiableView();
14134         bitField0_ = (bitField0_ & ~0x00008000);
14135       }
14136       result.variantRollupKeys_ = variantRollupKeys_;
14137       if (((bitField0_ & 0x00010000) != 0)) {
14138         pageCategories_ = pageCategories_.getUnmodifiableView();
14139         bitField0_ = (bitField0_ & ~0x00010000);
14140       }
14141       result.pageCategories_ = pageCategories_;
14142     }
14143 
buildPartial0(com.google.cloud.retail.v2.SearchRequest result)14144     private void buildPartial0(com.google.cloud.retail.v2.SearchRequest result) {
14145       int from_bitField0_ = bitField0_;
14146       if (((from_bitField0_ & 0x00000001) != 0)) {
14147         result.placement_ = placement_;
14148       }
14149       if (((from_bitField0_ & 0x00000002) != 0)) {
14150         result.branch_ = branch_;
14151       }
14152       if (((from_bitField0_ & 0x00000004) != 0)) {
14153         result.query_ = query_;
14154       }
14155       if (((from_bitField0_ & 0x00000008) != 0)) {
14156         result.visitorId_ = visitorId_;
14157       }
14158       if (((from_bitField0_ & 0x00000010) != 0)) {
14159         result.userInfo_ = userInfoBuilder_ == null ? userInfo_ : userInfoBuilder_.build();
14160       }
14161       if (((from_bitField0_ & 0x00000020) != 0)) {
14162         result.pageSize_ = pageSize_;
14163       }
14164       if (((from_bitField0_ & 0x00000040) != 0)) {
14165         result.pageToken_ = pageToken_;
14166       }
14167       if (((from_bitField0_ & 0x00000080) != 0)) {
14168         result.offset_ = offset_;
14169       }
14170       if (((from_bitField0_ & 0x00000100) != 0)) {
14171         result.filter_ = filter_;
14172       }
14173       if (((from_bitField0_ & 0x00000200) != 0)) {
14174         result.canonicalFilter_ = canonicalFilter_;
14175       }
14176       if (((from_bitField0_ & 0x00000400) != 0)) {
14177         result.orderBy_ = orderBy_;
14178       }
14179       if (((from_bitField0_ & 0x00001000) != 0)) {
14180         result.dynamicFacetSpec_ =
14181             dynamicFacetSpecBuilder_ == null ? dynamicFacetSpec_ : dynamicFacetSpecBuilder_.build();
14182       }
14183       if (((from_bitField0_ & 0x00002000) != 0)) {
14184         result.boostSpec_ = boostSpecBuilder_ == null ? boostSpec_ : boostSpecBuilder_.build();
14185       }
14186       if (((from_bitField0_ & 0x00004000) != 0)) {
14187         result.queryExpansionSpec_ =
14188             queryExpansionSpecBuilder_ == null
14189                 ? queryExpansionSpec_
14190                 : queryExpansionSpecBuilder_.build();
14191       }
14192       if (((from_bitField0_ & 0x00020000) != 0)) {
14193         result.searchMode_ = searchMode_;
14194       }
14195       if (((from_bitField0_ & 0x00040000) != 0)) {
14196         result.personalizationSpec_ =
14197             personalizationSpecBuilder_ == null
14198                 ? personalizationSpec_
14199                 : personalizationSpecBuilder_.build();
14200       }
14201       if (((from_bitField0_ & 0x00080000) != 0)) {
14202         result.labels_ = internalGetLabels();
14203         result.labels_.makeImmutable();
14204       }
14205       int to_bitField0_ = 0;
14206       if (((from_bitField0_ & 0x00100000) != 0)) {
14207         result.spellCorrectionSpec_ =
14208             spellCorrectionSpecBuilder_ == null
14209                 ? spellCorrectionSpec_
14210                 : spellCorrectionSpecBuilder_.build();
14211         to_bitField0_ |= 0x00000001;
14212       }
14213       if (((from_bitField0_ & 0x00200000) != 0)) {
14214         result.entity_ = entity_;
14215       }
14216       result.bitField0_ |= to_bitField0_;
14217     }
14218 
14219     @java.lang.Override
clone()14220     public Builder clone() {
14221       return super.clone();
14222     }
14223 
14224     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)14225     public Builder setField(
14226         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
14227       return super.setField(field, value);
14228     }
14229 
14230     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)14231     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
14232       return super.clearField(field);
14233     }
14234 
14235     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)14236     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
14237       return super.clearOneof(oneof);
14238     }
14239 
14240     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)14241     public Builder setRepeatedField(
14242         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
14243       return super.setRepeatedField(field, index, value);
14244     }
14245 
14246     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)14247     public Builder addRepeatedField(
14248         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
14249       return super.addRepeatedField(field, value);
14250     }
14251 
14252     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)14253     public Builder mergeFrom(com.google.protobuf.Message other) {
14254       if (other instanceof com.google.cloud.retail.v2.SearchRequest) {
14255         return mergeFrom((com.google.cloud.retail.v2.SearchRequest) other);
14256       } else {
14257         super.mergeFrom(other);
14258         return this;
14259       }
14260     }
14261 
mergeFrom(com.google.cloud.retail.v2.SearchRequest other)14262     public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest other) {
14263       if (other == com.google.cloud.retail.v2.SearchRequest.getDefaultInstance()) return this;
14264       if (!other.getPlacement().isEmpty()) {
14265         placement_ = other.placement_;
14266         bitField0_ |= 0x00000001;
14267         onChanged();
14268       }
14269       if (!other.getBranch().isEmpty()) {
14270         branch_ = other.branch_;
14271         bitField0_ |= 0x00000002;
14272         onChanged();
14273       }
14274       if (!other.getQuery().isEmpty()) {
14275         query_ = other.query_;
14276         bitField0_ |= 0x00000004;
14277         onChanged();
14278       }
14279       if (!other.getVisitorId().isEmpty()) {
14280         visitorId_ = other.visitorId_;
14281         bitField0_ |= 0x00000008;
14282         onChanged();
14283       }
14284       if (other.hasUserInfo()) {
14285         mergeUserInfo(other.getUserInfo());
14286       }
14287       if (other.getPageSize() != 0) {
14288         setPageSize(other.getPageSize());
14289       }
14290       if (!other.getPageToken().isEmpty()) {
14291         pageToken_ = other.pageToken_;
14292         bitField0_ |= 0x00000040;
14293         onChanged();
14294       }
14295       if (other.getOffset() != 0) {
14296         setOffset(other.getOffset());
14297       }
14298       if (!other.getFilter().isEmpty()) {
14299         filter_ = other.filter_;
14300         bitField0_ |= 0x00000100;
14301         onChanged();
14302       }
14303       if (!other.getCanonicalFilter().isEmpty()) {
14304         canonicalFilter_ = other.canonicalFilter_;
14305         bitField0_ |= 0x00000200;
14306         onChanged();
14307       }
14308       if (!other.getOrderBy().isEmpty()) {
14309         orderBy_ = other.orderBy_;
14310         bitField0_ |= 0x00000400;
14311         onChanged();
14312       }
14313       if (facetSpecsBuilder_ == null) {
14314         if (!other.facetSpecs_.isEmpty()) {
14315           if (facetSpecs_.isEmpty()) {
14316             facetSpecs_ = other.facetSpecs_;
14317             bitField0_ = (bitField0_ & ~0x00000800);
14318           } else {
14319             ensureFacetSpecsIsMutable();
14320             facetSpecs_.addAll(other.facetSpecs_);
14321           }
14322           onChanged();
14323         }
14324       } else {
14325         if (!other.facetSpecs_.isEmpty()) {
14326           if (facetSpecsBuilder_.isEmpty()) {
14327             facetSpecsBuilder_.dispose();
14328             facetSpecsBuilder_ = null;
14329             facetSpecs_ = other.facetSpecs_;
14330             bitField0_ = (bitField0_ & ~0x00000800);
14331             facetSpecsBuilder_ =
14332                 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
14333                     ? getFacetSpecsFieldBuilder()
14334                     : null;
14335           } else {
14336             facetSpecsBuilder_.addAllMessages(other.facetSpecs_);
14337           }
14338         }
14339       }
14340       if (other.hasDynamicFacetSpec()) {
14341         mergeDynamicFacetSpec(other.getDynamicFacetSpec());
14342       }
14343       if (other.hasBoostSpec()) {
14344         mergeBoostSpec(other.getBoostSpec());
14345       }
14346       if (other.hasQueryExpansionSpec()) {
14347         mergeQueryExpansionSpec(other.getQueryExpansionSpec());
14348       }
14349       if (!other.variantRollupKeys_.isEmpty()) {
14350         if (variantRollupKeys_.isEmpty()) {
14351           variantRollupKeys_ = other.variantRollupKeys_;
14352           bitField0_ = (bitField0_ & ~0x00008000);
14353         } else {
14354           ensureVariantRollupKeysIsMutable();
14355           variantRollupKeys_.addAll(other.variantRollupKeys_);
14356         }
14357         onChanged();
14358       }
14359       if (!other.pageCategories_.isEmpty()) {
14360         if (pageCategories_.isEmpty()) {
14361           pageCategories_ = other.pageCategories_;
14362           bitField0_ = (bitField0_ & ~0x00010000);
14363         } else {
14364           ensurePageCategoriesIsMutable();
14365           pageCategories_.addAll(other.pageCategories_);
14366         }
14367         onChanged();
14368       }
14369       if (other.searchMode_ != 0) {
14370         setSearchModeValue(other.getSearchModeValue());
14371       }
14372       if (other.hasPersonalizationSpec()) {
14373         mergePersonalizationSpec(other.getPersonalizationSpec());
14374       }
14375       internalGetMutableLabels().mergeFrom(other.internalGetLabels());
14376       bitField0_ |= 0x00080000;
14377       if (other.hasSpellCorrectionSpec()) {
14378         mergeSpellCorrectionSpec(other.getSpellCorrectionSpec());
14379       }
14380       if (!other.getEntity().isEmpty()) {
14381         entity_ = other.entity_;
14382         bitField0_ |= 0x00200000;
14383         onChanged();
14384       }
14385       this.mergeUnknownFields(other.getUnknownFields());
14386       onChanged();
14387       return this;
14388     }
14389 
14390     @java.lang.Override
isInitialized()14391     public final boolean isInitialized() {
14392       return true;
14393     }
14394 
14395     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)14396     public Builder mergeFrom(
14397         com.google.protobuf.CodedInputStream input,
14398         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
14399         throws java.io.IOException {
14400       if (extensionRegistry == null) {
14401         throw new java.lang.NullPointerException();
14402       }
14403       try {
14404         boolean done = false;
14405         while (!done) {
14406           int tag = input.readTag();
14407           switch (tag) {
14408             case 0:
14409               done = true;
14410               break;
14411             case 10:
14412               {
14413                 placement_ = input.readStringRequireUtf8();
14414                 bitField0_ |= 0x00000001;
14415                 break;
14416               } // case 10
14417             case 18:
14418               {
14419                 branch_ = input.readStringRequireUtf8();
14420                 bitField0_ |= 0x00000002;
14421                 break;
14422               } // case 18
14423             case 26:
14424               {
14425                 query_ = input.readStringRequireUtf8();
14426                 bitField0_ |= 0x00000004;
14427                 break;
14428               } // case 26
14429             case 34:
14430               {
14431                 visitorId_ = input.readStringRequireUtf8();
14432                 bitField0_ |= 0x00000008;
14433                 break;
14434               } // case 34
14435             case 42:
14436               {
14437                 input.readMessage(getUserInfoFieldBuilder().getBuilder(), extensionRegistry);
14438                 bitField0_ |= 0x00000010;
14439                 break;
14440               } // case 42
14441             case 56:
14442               {
14443                 pageSize_ = input.readInt32();
14444                 bitField0_ |= 0x00000020;
14445                 break;
14446               } // case 56
14447             case 66:
14448               {
14449                 pageToken_ = input.readStringRequireUtf8();
14450                 bitField0_ |= 0x00000040;
14451                 break;
14452               } // case 66
14453             case 72:
14454               {
14455                 offset_ = input.readInt32();
14456                 bitField0_ |= 0x00000080;
14457                 break;
14458               } // case 72
14459             case 82:
14460               {
14461                 filter_ = input.readStringRequireUtf8();
14462                 bitField0_ |= 0x00000100;
14463                 break;
14464               } // case 82
14465             case 90:
14466               {
14467                 orderBy_ = input.readStringRequireUtf8();
14468                 bitField0_ |= 0x00000400;
14469                 break;
14470               } // case 90
14471             case 98:
14472               {
14473                 com.google.cloud.retail.v2.SearchRequest.FacetSpec m =
14474                     input.readMessage(
14475                         com.google.cloud.retail.v2.SearchRequest.FacetSpec.parser(),
14476                         extensionRegistry);
14477                 if (facetSpecsBuilder_ == null) {
14478                   ensureFacetSpecsIsMutable();
14479                   facetSpecs_.add(m);
14480                 } else {
14481                   facetSpecsBuilder_.addMessage(m);
14482                 }
14483                 break;
14484               } // case 98
14485             case 106:
14486               {
14487                 input.readMessage(getBoostSpecFieldBuilder().getBuilder(), extensionRegistry);
14488                 bitField0_ |= 0x00002000;
14489                 break;
14490               } // case 106
14491             case 114:
14492               {
14493                 input.readMessage(
14494                     getQueryExpansionSpecFieldBuilder().getBuilder(), extensionRegistry);
14495                 bitField0_ |= 0x00004000;
14496                 break;
14497               } // case 114
14498             case 138:
14499               {
14500                 java.lang.String s = input.readStringRequireUtf8();
14501                 ensureVariantRollupKeysIsMutable();
14502                 variantRollupKeys_.add(s);
14503                 break;
14504               } // case 138
14505             case 170:
14506               {
14507                 input.readMessage(
14508                     getDynamicFacetSpecFieldBuilder().getBuilder(), extensionRegistry);
14509                 bitField0_ |= 0x00001000;
14510                 break;
14511               } // case 170
14512             case 186:
14513               {
14514                 java.lang.String s = input.readStringRequireUtf8();
14515                 ensurePageCategoriesIsMutable();
14516                 pageCategories_.add(s);
14517                 break;
14518               } // case 186
14519             case 226:
14520               {
14521                 canonicalFilter_ = input.readStringRequireUtf8();
14522                 bitField0_ |= 0x00000200;
14523                 break;
14524               } // case 226
14525             case 248:
14526               {
14527                 searchMode_ = input.readEnum();
14528                 bitField0_ |= 0x00020000;
14529                 break;
14530               } // case 248
14531             case 258:
14532               {
14533                 input.readMessage(
14534                     getPersonalizationSpecFieldBuilder().getBuilder(), extensionRegistry);
14535                 bitField0_ |= 0x00040000;
14536                 break;
14537               } // case 258
14538             case 274:
14539               {
14540                 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
14541                     input.readMessage(
14542                         LabelsDefaultEntryHolder.defaultEntry.getParserForType(),
14543                         extensionRegistry);
14544                 internalGetMutableLabels()
14545                     .getMutableMap()
14546                     .put(labels__.getKey(), labels__.getValue());
14547                 bitField0_ |= 0x00080000;
14548                 break;
14549               } // case 274
14550             case 282:
14551               {
14552                 input.readMessage(
14553                     getSpellCorrectionSpecFieldBuilder().getBuilder(), extensionRegistry);
14554                 bitField0_ |= 0x00100000;
14555                 break;
14556               } // case 282
14557             case 306:
14558               {
14559                 entity_ = input.readStringRequireUtf8();
14560                 bitField0_ |= 0x00200000;
14561                 break;
14562               } // case 306
14563             default:
14564               {
14565                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
14566                   done = true; // was an endgroup tag
14567                 }
14568                 break;
14569               } // default:
14570           } // switch (tag)
14571         } // while (!done)
14572       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
14573         throw e.unwrapIOException();
14574       } finally {
14575         onChanged();
14576       } // finally
14577       return this;
14578     }
14579 
14580     private int bitField0_;
14581 
14582     private java.lang.Object placement_ = "";
14583     /**
14584      *
14585      *
14586      * <pre>
14587      * Required. The resource name of the Retail Search serving config, such as
14588      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/servingConfigs/default_serving_config`
14589      * or the name of the legacy placement resource, such as
14590      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/placements/default_search`.
14591      * This field is used to identify the serving config name and the set
14592      * of models that will be used to make the search.
14593      * </pre>
14594      *
14595      * <code>string placement = 1 [(.google.api.field_behavior) = REQUIRED];</code>
14596      *
14597      * @return The placement.
14598      */
getPlacement()14599     public java.lang.String getPlacement() {
14600       java.lang.Object ref = placement_;
14601       if (!(ref instanceof java.lang.String)) {
14602         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
14603         java.lang.String s = bs.toStringUtf8();
14604         placement_ = s;
14605         return s;
14606       } else {
14607         return (java.lang.String) ref;
14608       }
14609     }
14610     /**
14611      *
14612      *
14613      * <pre>
14614      * Required. The resource name of the Retail Search serving config, such as
14615      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/servingConfigs/default_serving_config`
14616      * or the name of the legacy placement resource, such as
14617      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/placements/default_search`.
14618      * This field is used to identify the serving config name and the set
14619      * of models that will be used to make the search.
14620      * </pre>
14621      *
14622      * <code>string placement = 1 [(.google.api.field_behavior) = REQUIRED];</code>
14623      *
14624      * @return The bytes for placement.
14625      */
getPlacementBytes()14626     public com.google.protobuf.ByteString getPlacementBytes() {
14627       java.lang.Object ref = placement_;
14628       if (ref instanceof String) {
14629         com.google.protobuf.ByteString b =
14630             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
14631         placement_ = b;
14632         return b;
14633       } else {
14634         return (com.google.protobuf.ByteString) ref;
14635       }
14636     }
14637     /**
14638      *
14639      *
14640      * <pre>
14641      * Required. The resource name of the Retail Search serving config, such as
14642      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/servingConfigs/default_serving_config`
14643      * or the name of the legacy placement resource, such as
14644      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/placements/default_search`.
14645      * This field is used to identify the serving config name and the set
14646      * of models that will be used to make the search.
14647      * </pre>
14648      *
14649      * <code>string placement = 1 [(.google.api.field_behavior) = REQUIRED];</code>
14650      *
14651      * @param value The placement to set.
14652      * @return This builder for chaining.
14653      */
setPlacement(java.lang.String value)14654     public Builder setPlacement(java.lang.String value) {
14655       if (value == null) {
14656         throw new NullPointerException();
14657       }
14658       placement_ = value;
14659       bitField0_ |= 0x00000001;
14660       onChanged();
14661       return this;
14662     }
14663     /**
14664      *
14665      *
14666      * <pre>
14667      * Required. The resource name of the Retail Search serving config, such as
14668      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/servingConfigs/default_serving_config`
14669      * or the name of the legacy placement resource, such as
14670      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/placements/default_search`.
14671      * This field is used to identify the serving config name and the set
14672      * of models that will be used to make the search.
14673      * </pre>
14674      *
14675      * <code>string placement = 1 [(.google.api.field_behavior) = REQUIRED];</code>
14676      *
14677      * @return This builder for chaining.
14678      */
clearPlacement()14679     public Builder clearPlacement() {
14680       placement_ = getDefaultInstance().getPlacement();
14681       bitField0_ = (bitField0_ & ~0x00000001);
14682       onChanged();
14683       return this;
14684     }
14685     /**
14686      *
14687      *
14688      * <pre>
14689      * Required. The resource name of the Retail Search serving config, such as
14690      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/servingConfigs/default_serving_config`
14691      * or the name of the legacy placement resource, such as
14692      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/placements/default_search`.
14693      * This field is used to identify the serving config name and the set
14694      * of models that will be used to make the search.
14695      * </pre>
14696      *
14697      * <code>string placement = 1 [(.google.api.field_behavior) = REQUIRED];</code>
14698      *
14699      * @param value The bytes for placement to set.
14700      * @return This builder for chaining.
14701      */
setPlacementBytes(com.google.protobuf.ByteString value)14702     public Builder setPlacementBytes(com.google.protobuf.ByteString value) {
14703       if (value == null) {
14704         throw new NullPointerException();
14705       }
14706       checkByteStringIsUtf8(value);
14707       placement_ = value;
14708       bitField0_ |= 0x00000001;
14709       onChanged();
14710       return this;
14711     }
14712 
14713     private java.lang.Object branch_ = "";
14714     /**
14715      *
14716      *
14717      * <pre>
14718      * The branch resource name, such as
14719      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/0`.
14720      * Use "default_branch" as the branch ID or leave this field empty, to search
14721      * products under the default branch.
14722      * </pre>
14723      *
14724      * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
14725      *
14726      * @return The branch.
14727      */
getBranch()14728     public java.lang.String getBranch() {
14729       java.lang.Object ref = branch_;
14730       if (!(ref instanceof java.lang.String)) {
14731         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
14732         java.lang.String s = bs.toStringUtf8();
14733         branch_ = s;
14734         return s;
14735       } else {
14736         return (java.lang.String) ref;
14737       }
14738     }
14739     /**
14740      *
14741      *
14742      * <pre>
14743      * The branch resource name, such as
14744      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/0`.
14745      * Use "default_branch" as the branch ID or leave this field empty, to search
14746      * products under the default branch.
14747      * </pre>
14748      *
14749      * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
14750      *
14751      * @return The bytes for branch.
14752      */
getBranchBytes()14753     public com.google.protobuf.ByteString getBranchBytes() {
14754       java.lang.Object ref = branch_;
14755       if (ref instanceof String) {
14756         com.google.protobuf.ByteString b =
14757             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
14758         branch_ = b;
14759         return b;
14760       } else {
14761         return (com.google.protobuf.ByteString) ref;
14762       }
14763     }
14764     /**
14765      *
14766      *
14767      * <pre>
14768      * The branch resource name, such as
14769      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/0`.
14770      * Use "default_branch" as the branch ID or leave this field empty, to search
14771      * products under the default branch.
14772      * </pre>
14773      *
14774      * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
14775      *
14776      * @param value The branch to set.
14777      * @return This builder for chaining.
14778      */
setBranch(java.lang.String value)14779     public Builder setBranch(java.lang.String value) {
14780       if (value == null) {
14781         throw new NullPointerException();
14782       }
14783       branch_ = value;
14784       bitField0_ |= 0x00000002;
14785       onChanged();
14786       return this;
14787     }
14788     /**
14789      *
14790      *
14791      * <pre>
14792      * The branch resource name, such as
14793      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/0`.
14794      * Use "default_branch" as the branch ID or leave this field empty, to search
14795      * products under the default branch.
14796      * </pre>
14797      *
14798      * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
14799      *
14800      * @return This builder for chaining.
14801      */
clearBranch()14802     public Builder clearBranch() {
14803       branch_ = getDefaultInstance().getBranch();
14804       bitField0_ = (bitField0_ & ~0x00000002);
14805       onChanged();
14806       return this;
14807     }
14808     /**
14809      *
14810      *
14811      * <pre>
14812      * The branch resource name, such as
14813      * `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/0`.
14814      * Use "default_branch" as the branch ID or leave this field empty, to search
14815      * products under the default branch.
14816      * </pre>
14817      *
14818      * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
14819      *
14820      * @param value The bytes for branch to set.
14821      * @return This builder for chaining.
14822      */
setBranchBytes(com.google.protobuf.ByteString value)14823     public Builder setBranchBytes(com.google.protobuf.ByteString value) {
14824       if (value == null) {
14825         throw new NullPointerException();
14826       }
14827       checkByteStringIsUtf8(value);
14828       branch_ = value;
14829       bitField0_ |= 0x00000002;
14830       onChanged();
14831       return this;
14832     }
14833 
14834     private java.lang.Object query_ = "";
14835     /**
14836      *
14837      *
14838      * <pre>
14839      * Raw search query.
14840      * If this field is empty, the request is considered a category browsing
14841      * request and returned results are based on
14842      * [filter][google.cloud.retail.v2.SearchRequest.filter] and
14843      * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories].
14844      * </pre>
14845      *
14846      * <code>string query = 3;</code>
14847      *
14848      * @return The query.
14849      */
getQuery()14850     public java.lang.String getQuery() {
14851       java.lang.Object ref = query_;
14852       if (!(ref instanceof java.lang.String)) {
14853         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
14854         java.lang.String s = bs.toStringUtf8();
14855         query_ = s;
14856         return s;
14857       } else {
14858         return (java.lang.String) ref;
14859       }
14860     }
14861     /**
14862      *
14863      *
14864      * <pre>
14865      * Raw search query.
14866      * If this field is empty, the request is considered a category browsing
14867      * request and returned results are based on
14868      * [filter][google.cloud.retail.v2.SearchRequest.filter] and
14869      * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories].
14870      * </pre>
14871      *
14872      * <code>string query = 3;</code>
14873      *
14874      * @return The bytes for query.
14875      */
getQueryBytes()14876     public com.google.protobuf.ByteString getQueryBytes() {
14877       java.lang.Object ref = query_;
14878       if (ref instanceof String) {
14879         com.google.protobuf.ByteString b =
14880             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
14881         query_ = b;
14882         return b;
14883       } else {
14884         return (com.google.protobuf.ByteString) ref;
14885       }
14886     }
14887     /**
14888      *
14889      *
14890      * <pre>
14891      * Raw search query.
14892      * If this field is empty, the request is considered a category browsing
14893      * request and returned results are based on
14894      * [filter][google.cloud.retail.v2.SearchRequest.filter] and
14895      * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories].
14896      * </pre>
14897      *
14898      * <code>string query = 3;</code>
14899      *
14900      * @param value The query to set.
14901      * @return This builder for chaining.
14902      */
setQuery(java.lang.String value)14903     public Builder setQuery(java.lang.String value) {
14904       if (value == null) {
14905         throw new NullPointerException();
14906       }
14907       query_ = value;
14908       bitField0_ |= 0x00000004;
14909       onChanged();
14910       return this;
14911     }
14912     /**
14913      *
14914      *
14915      * <pre>
14916      * Raw search query.
14917      * If this field is empty, the request is considered a category browsing
14918      * request and returned results are based on
14919      * [filter][google.cloud.retail.v2.SearchRequest.filter] and
14920      * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories].
14921      * </pre>
14922      *
14923      * <code>string query = 3;</code>
14924      *
14925      * @return This builder for chaining.
14926      */
clearQuery()14927     public Builder clearQuery() {
14928       query_ = getDefaultInstance().getQuery();
14929       bitField0_ = (bitField0_ & ~0x00000004);
14930       onChanged();
14931       return this;
14932     }
14933     /**
14934      *
14935      *
14936      * <pre>
14937      * Raw search query.
14938      * If this field is empty, the request is considered a category browsing
14939      * request and returned results are based on
14940      * [filter][google.cloud.retail.v2.SearchRequest.filter] and
14941      * [page_categories][google.cloud.retail.v2.SearchRequest.page_categories].
14942      * </pre>
14943      *
14944      * <code>string query = 3;</code>
14945      *
14946      * @param value The bytes for query to set.
14947      * @return This builder for chaining.
14948      */
setQueryBytes(com.google.protobuf.ByteString value)14949     public Builder setQueryBytes(com.google.protobuf.ByteString value) {
14950       if (value == null) {
14951         throw new NullPointerException();
14952       }
14953       checkByteStringIsUtf8(value);
14954       query_ = value;
14955       bitField0_ |= 0x00000004;
14956       onChanged();
14957       return this;
14958     }
14959 
14960     private java.lang.Object visitorId_ = "";
14961     /**
14962      *
14963      *
14964      * <pre>
14965      * Required. A unique identifier for tracking visitors. For example, this
14966      * could be implemented with an HTTP cookie, which should be able to uniquely
14967      * identify a visitor on a single device. This unique identifier should not
14968      * change if the visitor logs in or out of the website.
14969      * This should be the same identifier as
14970      * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id].
14971      * The field must be a UTF-8 encoded string with a length limit of 128
14972      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
14973      * </pre>
14974      *
14975      * <code>string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
14976      *
14977      * @return The visitorId.
14978      */
getVisitorId()14979     public java.lang.String getVisitorId() {
14980       java.lang.Object ref = visitorId_;
14981       if (!(ref instanceof java.lang.String)) {
14982         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
14983         java.lang.String s = bs.toStringUtf8();
14984         visitorId_ = s;
14985         return s;
14986       } else {
14987         return (java.lang.String) ref;
14988       }
14989     }
14990     /**
14991      *
14992      *
14993      * <pre>
14994      * Required. A unique identifier for tracking visitors. For example, this
14995      * could be implemented with an HTTP cookie, which should be able to uniquely
14996      * identify a visitor on a single device. This unique identifier should not
14997      * change if the visitor logs in or out of the website.
14998      * This should be the same identifier as
14999      * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id].
15000      * The field must be a UTF-8 encoded string with a length limit of 128
15001      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
15002      * </pre>
15003      *
15004      * <code>string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
15005      *
15006      * @return The bytes for visitorId.
15007      */
getVisitorIdBytes()15008     public com.google.protobuf.ByteString getVisitorIdBytes() {
15009       java.lang.Object ref = visitorId_;
15010       if (ref instanceof String) {
15011         com.google.protobuf.ByteString b =
15012             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
15013         visitorId_ = b;
15014         return b;
15015       } else {
15016         return (com.google.protobuf.ByteString) ref;
15017       }
15018     }
15019     /**
15020      *
15021      *
15022      * <pre>
15023      * Required. A unique identifier for tracking visitors. For example, this
15024      * could be implemented with an HTTP cookie, which should be able to uniquely
15025      * identify a visitor on a single device. This unique identifier should not
15026      * change if the visitor logs in or out of the website.
15027      * This should be the same identifier as
15028      * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id].
15029      * The field must be a UTF-8 encoded string with a length limit of 128
15030      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
15031      * </pre>
15032      *
15033      * <code>string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
15034      *
15035      * @param value The visitorId to set.
15036      * @return This builder for chaining.
15037      */
setVisitorId(java.lang.String value)15038     public Builder setVisitorId(java.lang.String value) {
15039       if (value == null) {
15040         throw new NullPointerException();
15041       }
15042       visitorId_ = value;
15043       bitField0_ |= 0x00000008;
15044       onChanged();
15045       return this;
15046     }
15047     /**
15048      *
15049      *
15050      * <pre>
15051      * Required. A unique identifier for tracking visitors. For example, this
15052      * could be implemented with an HTTP cookie, which should be able to uniquely
15053      * identify a visitor on a single device. This unique identifier should not
15054      * change if the visitor logs in or out of the website.
15055      * This should be the same identifier as
15056      * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id].
15057      * The field must be a UTF-8 encoded string with a length limit of 128
15058      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
15059      * </pre>
15060      *
15061      * <code>string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
15062      *
15063      * @return This builder for chaining.
15064      */
clearVisitorId()15065     public Builder clearVisitorId() {
15066       visitorId_ = getDefaultInstance().getVisitorId();
15067       bitField0_ = (bitField0_ & ~0x00000008);
15068       onChanged();
15069       return this;
15070     }
15071     /**
15072      *
15073      *
15074      * <pre>
15075      * Required. A unique identifier for tracking visitors. For example, this
15076      * could be implemented with an HTTP cookie, which should be able to uniquely
15077      * identify a visitor on a single device. This unique identifier should not
15078      * change if the visitor logs in or out of the website.
15079      * This should be the same identifier as
15080      * [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id].
15081      * The field must be a UTF-8 encoded string with a length limit of 128
15082      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
15083      * </pre>
15084      *
15085      * <code>string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
15086      *
15087      * @param value The bytes for visitorId to set.
15088      * @return This builder for chaining.
15089      */
setVisitorIdBytes(com.google.protobuf.ByteString value)15090     public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) {
15091       if (value == null) {
15092         throw new NullPointerException();
15093       }
15094       checkByteStringIsUtf8(value);
15095       visitorId_ = value;
15096       bitField0_ |= 0x00000008;
15097       onChanged();
15098       return this;
15099     }
15100 
15101     private com.google.cloud.retail.v2.UserInfo userInfo_;
15102     private com.google.protobuf.SingleFieldBuilderV3<
15103             com.google.cloud.retail.v2.UserInfo,
15104             com.google.cloud.retail.v2.UserInfo.Builder,
15105             com.google.cloud.retail.v2.UserInfoOrBuilder>
15106         userInfoBuilder_;
15107     /**
15108      *
15109      *
15110      * <pre>
15111      * User information.
15112      * </pre>
15113      *
15114      * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
15115      *
15116      * @return Whether the userInfo field is set.
15117      */
hasUserInfo()15118     public boolean hasUserInfo() {
15119       return ((bitField0_ & 0x00000010) != 0);
15120     }
15121     /**
15122      *
15123      *
15124      * <pre>
15125      * User information.
15126      * </pre>
15127      *
15128      * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
15129      *
15130      * @return The userInfo.
15131      */
getUserInfo()15132     public com.google.cloud.retail.v2.UserInfo getUserInfo() {
15133       if (userInfoBuilder_ == null) {
15134         return userInfo_ == null
15135             ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance()
15136             : userInfo_;
15137       } else {
15138         return userInfoBuilder_.getMessage();
15139       }
15140     }
15141     /**
15142      *
15143      *
15144      * <pre>
15145      * User information.
15146      * </pre>
15147      *
15148      * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
15149      */
setUserInfo(com.google.cloud.retail.v2.UserInfo value)15150     public Builder setUserInfo(com.google.cloud.retail.v2.UserInfo value) {
15151       if (userInfoBuilder_ == null) {
15152         if (value == null) {
15153           throw new NullPointerException();
15154         }
15155         userInfo_ = value;
15156       } else {
15157         userInfoBuilder_.setMessage(value);
15158       }
15159       bitField0_ |= 0x00000010;
15160       onChanged();
15161       return this;
15162     }
15163     /**
15164      *
15165      *
15166      * <pre>
15167      * User information.
15168      * </pre>
15169      *
15170      * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
15171      */
setUserInfo(com.google.cloud.retail.v2.UserInfo.Builder builderForValue)15172     public Builder setUserInfo(com.google.cloud.retail.v2.UserInfo.Builder builderForValue) {
15173       if (userInfoBuilder_ == null) {
15174         userInfo_ = builderForValue.build();
15175       } else {
15176         userInfoBuilder_.setMessage(builderForValue.build());
15177       }
15178       bitField0_ |= 0x00000010;
15179       onChanged();
15180       return this;
15181     }
15182     /**
15183      *
15184      *
15185      * <pre>
15186      * User information.
15187      * </pre>
15188      *
15189      * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
15190      */
mergeUserInfo(com.google.cloud.retail.v2.UserInfo value)15191     public Builder mergeUserInfo(com.google.cloud.retail.v2.UserInfo value) {
15192       if (userInfoBuilder_ == null) {
15193         if (((bitField0_ & 0x00000010) != 0)
15194             && userInfo_ != null
15195             && userInfo_ != com.google.cloud.retail.v2.UserInfo.getDefaultInstance()) {
15196           getUserInfoBuilder().mergeFrom(value);
15197         } else {
15198           userInfo_ = value;
15199         }
15200       } else {
15201         userInfoBuilder_.mergeFrom(value);
15202       }
15203       bitField0_ |= 0x00000010;
15204       onChanged();
15205       return this;
15206     }
15207     /**
15208      *
15209      *
15210      * <pre>
15211      * User information.
15212      * </pre>
15213      *
15214      * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
15215      */
clearUserInfo()15216     public Builder clearUserInfo() {
15217       bitField0_ = (bitField0_ & ~0x00000010);
15218       userInfo_ = null;
15219       if (userInfoBuilder_ != null) {
15220         userInfoBuilder_.dispose();
15221         userInfoBuilder_ = null;
15222       }
15223       onChanged();
15224       return this;
15225     }
15226     /**
15227      *
15228      *
15229      * <pre>
15230      * User information.
15231      * </pre>
15232      *
15233      * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
15234      */
getUserInfoBuilder()15235     public com.google.cloud.retail.v2.UserInfo.Builder getUserInfoBuilder() {
15236       bitField0_ |= 0x00000010;
15237       onChanged();
15238       return getUserInfoFieldBuilder().getBuilder();
15239     }
15240     /**
15241      *
15242      *
15243      * <pre>
15244      * User information.
15245      * </pre>
15246      *
15247      * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
15248      */
getUserInfoOrBuilder()15249     public com.google.cloud.retail.v2.UserInfoOrBuilder getUserInfoOrBuilder() {
15250       if (userInfoBuilder_ != null) {
15251         return userInfoBuilder_.getMessageOrBuilder();
15252       } else {
15253         return userInfo_ == null
15254             ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance()
15255             : userInfo_;
15256       }
15257     }
15258     /**
15259      *
15260      *
15261      * <pre>
15262      * User information.
15263      * </pre>
15264      *
15265      * <code>.google.cloud.retail.v2.UserInfo user_info = 5;</code>
15266      */
15267     private com.google.protobuf.SingleFieldBuilderV3<
15268             com.google.cloud.retail.v2.UserInfo,
15269             com.google.cloud.retail.v2.UserInfo.Builder,
15270             com.google.cloud.retail.v2.UserInfoOrBuilder>
getUserInfoFieldBuilder()15271         getUserInfoFieldBuilder() {
15272       if (userInfoBuilder_ == null) {
15273         userInfoBuilder_ =
15274             new com.google.protobuf.SingleFieldBuilderV3<
15275                 com.google.cloud.retail.v2.UserInfo,
15276                 com.google.cloud.retail.v2.UserInfo.Builder,
15277                 com.google.cloud.retail.v2.UserInfoOrBuilder>(
15278                 getUserInfo(), getParentForChildren(), isClean());
15279         userInfo_ = null;
15280       }
15281       return userInfoBuilder_;
15282     }
15283 
15284     private int pageSize_;
15285     /**
15286      *
15287      *
15288      * <pre>
15289      * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
15290      * unspecified, defaults to a reasonable value. The maximum allowed value is
15291      * 120. Values above 120 will be coerced to 120.
15292      * If this field is negative, an INVALID_ARGUMENT is returned.
15293      * </pre>
15294      *
15295      * <code>int32 page_size = 7;</code>
15296      *
15297      * @return The pageSize.
15298      */
15299     @java.lang.Override
getPageSize()15300     public int getPageSize() {
15301       return pageSize_;
15302     }
15303     /**
15304      *
15305      *
15306      * <pre>
15307      * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
15308      * unspecified, defaults to a reasonable value. The maximum allowed value is
15309      * 120. Values above 120 will be coerced to 120.
15310      * If this field is negative, an INVALID_ARGUMENT is returned.
15311      * </pre>
15312      *
15313      * <code>int32 page_size = 7;</code>
15314      *
15315      * @param value The pageSize to set.
15316      * @return This builder for chaining.
15317      */
setPageSize(int value)15318     public Builder setPageSize(int value) {
15319 
15320       pageSize_ = value;
15321       bitField0_ |= 0x00000020;
15322       onChanged();
15323       return this;
15324     }
15325     /**
15326      *
15327      *
15328      * <pre>
15329      * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
15330      * unspecified, defaults to a reasonable value. The maximum allowed value is
15331      * 120. Values above 120 will be coerced to 120.
15332      * If this field is negative, an INVALID_ARGUMENT is returned.
15333      * </pre>
15334      *
15335      * <code>int32 page_size = 7;</code>
15336      *
15337      * @return This builder for chaining.
15338      */
clearPageSize()15339     public Builder clearPageSize() {
15340       bitField0_ = (bitField0_ & ~0x00000020);
15341       pageSize_ = 0;
15342       onChanged();
15343       return this;
15344     }
15345 
15346     private java.lang.Object pageToken_ = "";
15347     /**
15348      *
15349      *
15350      * <pre>
15351      * A page token
15352      * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
15353      * received from a previous
15354      * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
15355      * Provide this to retrieve the subsequent page.
15356      * When paginating, all other parameters provided to
15357      * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
15358      * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
15359      * error is returned.
15360      * </pre>
15361      *
15362      * <code>string page_token = 8;</code>
15363      *
15364      * @return The pageToken.
15365      */
getPageToken()15366     public java.lang.String getPageToken() {
15367       java.lang.Object ref = pageToken_;
15368       if (!(ref instanceof java.lang.String)) {
15369         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
15370         java.lang.String s = bs.toStringUtf8();
15371         pageToken_ = s;
15372         return s;
15373       } else {
15374         return (java.lang.String) ref;
15375       }
15376     }
15377     /**
15378      *
15379      *
15380      * <pre>
15381      * A page token
15382      * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
15383      * received from a previous
15384      * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
15385      * Provide this to retrieve the subsequent page.
15386      * When paginating, all other parameters provided to
15387      * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
15388      * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
15389      * error is returned.
15390      * </pre>
15391      *
15392      * <code>string page_token = 8;</code>
15393      *
15394      * @return The bytes for pageToken.
15395      */
getPageTokenBytes()15396     public com.google.protobuf.ByteString getPageTokenBytes() {
15397       java.lang.Object ref = pageToken_;
15398       if (ref instanceof String) {
15399         com.google.protobuf.ByteString b =
15400             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
15401         pageToken_ = b;
15402         return b;
15403       } else {
15404         return (com.google.protobuf.ByteString) ref;
15405       }
15406     }
15407     /**
15408      *
15409      *
15410      * <pre>
15411      * A page token
15412      * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
15413      * received from a previous
15414      * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
15415      * Provide this to retrieve the subsequent page.
15416      * When paginating, all other parameters provided to
15417      * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
15418      * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
15419      * error is returned.
15420      * </pre>
15421      *
15422      * <code>string page_token = 8;</code>
15423      *
15424      * @param value The pageToken to set.
15425      * @return This builder for chaining.
15426      */
setPageToken(java.lang.String value)15427     public Builder setPageToken(java.lang.String value) {
15428       if (value == null) {
15429         throw new NullPointerException();
15430       }
15431       pageToken_ = value;
15432       bitField0_ |= 0x00000040;
15433       onChanged();
15434       return this;
15435     }
15436     /**
15437      *
15438      *
15439      * <pre>
15440      * A page token
15441      * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
15442      * received from a previous
15443      * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
15444      * Provide this to retrieve the subsequent page.
15445      * When paginating, all other parameters provided to
15446      * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
15447      * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
15448      * error is returned.
15449      * </pre>
15450      *
15451      * <code>string page_token = 8;</code>
15452      *
15453      * @return This builder for chaining.
15454      */
clearPageToken()15455     public Builder clearPageToken() {
15456       pageToken_ = getDefaultInstance().getPageToken();
15457       bitField0_ = (bitField0_ & ~0x00000040);
15458       onChanged();
15459       return this;
15460     }
15461     /**
15462      *
15463      *
15464      * <pre>
15465      * A page token
15466      * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
15467      * received from a previous
15468      * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
15469      * Provide this to retrieve the subsequent page.
15470      * When paginating, all other parameters provided to
15471      * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
15472      * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
15473      * error is returned.
15474      * </pre>
15475      *
15476      * <code>string page_token = 8;</code>
15477      *
15478      * @param value The bytes for pageToken to set.
15479      * @return This builder for chaining.
15480      */
setPageTokenBytes(com.google.protobuf.ByteString value)15481     public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
15482       if (value == null) {
15483         throw new NullPointerException();
15484       }
15485       checkByteStringIsUtf8(value);
15486       pageToken_ = value;
15487       bitField0_ |= 0x00000040;
15488       onChanged();
15489       return this;
15490     }
15491 
15492     private int offset_;
15493     /**
15494      *
15495      *
15496      * <pre>
15497      * A 0-indexed integer that specifies the current offset (that is, starting
15498      * result location, amongst the [Product][google.cloud.retail.v2.Product]s
15499      * deemed by the API as relevant) in search results. This field is only
15500      * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token]
15501      * is unset.
15502      * If this field is negative, an INVALID_ARGUMENT is returned.
15503      * </pre>
15504      *
15505      * <code>int32 offset = 9;</code>
15506      *
15507      * @return The offset.
15508      */
15509     @java.lang.Override
getOffset()15510     public int getOffset() {
15511       return offset_;
15512     }
15513     /**
15514      *
15515      *
15516      * <pre>
15517      * A 0-indexed integer that specifies the current offset (that is, starting
15518      * result location, amongst the [Product][google.cloud.retail.v2.Product]s
15519      * deemed by the API as relevant) in search results. This field is only
15520      * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token]
15521      * is unset.
15522      * If this field is negative, an INVALID_ARGUMENT is returned.
15523      * </pre>
15524      *
15525      * <code>int32 offset = 9;</code>
15526      *
15527      * @param value The offset to set.
15528      * @return This builder for chaining.
15529      */
setOffset(int value)15530     public Builder setOffset(int value) {
15531 
15532       offset_ = value;
15533       bitField0_ |= 0x00000080;
15534       onChanged();
15535       return this;
15536     }
15537     /**
15538      *
15539      *
15540      * <pre>
15541      * A 0-indexed integer that specifies the current offset (that is, starting
15542      * result location, amongst the [Product][google.cloud.retail.v2.Product]s
15543      * deemed by the API as relevant) in search results. This field is only
15544      * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token]
15545      * is unset.
15546      * If this field is negative, an INVALID_ARGUMENT is returned.
15547      * </pre>
15548      *
15549      * <code>int32 offset = 9;</code>
15550      *
15551      * @return This builder for chaining.
15552      */
clearOffset()15553     public Builder clearOffset() {
15554       bitField0_ = (bitField0_ & ~0x00000080);
15555       offset_ = 0;
15556       onChanged();
15557       return this;
15558     }
15559 
15560     private java.lang.Object filter_ = "";
15561     /**
15562      *
15563      *
15564      * <pre>
15565      * The filter syntax consists of an expression language for constructing a
15566      * predicate from one or more fields of the products being filtered. Filter
15567      * expression is case-sensitive. See more details at this [user
15568      * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
15569      * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
15570      * </pre>
15571      *
15572      * <code>string filter = 10;</code>
15573      *
15574      * @return The filter.
15575      */
getFilter()15576     public java.lang.String getFilter() {
15577       java.lang.Object ref = filter_;
15578       if (!(ref instanceof java.lang.String)) {
15579         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
15580         java.lang.String s = bs.toStringUtf8();
15581         filter_ = s;
15582         return s;
15583       } else {
15584         return (java.lang.String) ref;
15585       }
15586     }
15587     /**
15588      *
15589      *
15590      * <pre>
15591      * The filter syntax consists of an expression language for constructing a
15592      * predicate from one or more fields of the products being filtered. Filter
15593      * expression is case-sensitive. See more details at this [user
15594      * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
15595      * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
15596      * </pre>
15597      *
15598      * <code>string filter = 10;</code>
15599      *
15600      * @return The bytes for filter.
15601      */
getFilterBytes()15602     public com.google.protobuf.ByteString getFilterBytes() {
15603       java.lang.Object ref = filter_;
15604       if (ref instanceof String) {
15605         com.google.protobuf.ByteString b =
15606             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
15607         filter_ = b;
15608         return b;
15609       } else {
15610         return (com.google.protobuf.ByteString) ref;
15611       }
15612     }
15613     /**
15614      *
15615      *
15616      * <pre>
15617      * The filter syntax consists of an expression language for constructing a
15618      * predicate from one or more fields of the products being filtered. Filter
15619      * expression is case-sensitive. See more details at this [user
15620      * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
15621      * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
15622      * </pre>
15623      *
15624      * <code>string filter = 10;</code>
15625      *
15626      * @param value The filter to set.
15627      * @return This builder for chaining.
15628      */
setFilter(java.lang.String value)15629     public Builder setFilter(java.lang.String value) {
15630       if (value == null) {
15631         throw new NullPointerException();
15632       }
15633       filter_ = value;
15634       bitField0_ |= 0x00000100;
15635       onChanged();
15636       return this;
15637     }
15638     /**
15639      *
15640      *
15641      * <pre>
15642      * The filter syntax consists of an expression language for constructing a
15643      * predicate from one or more fields of the products being filtered. Filter
15644      * expression is case-sensitive. See more details at this [user
15645      * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
15646      * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
15647      * </pre>
15648      *
15649      * <code>string filter = 10;</code>
15650      *
15651      * @return This builder for chaining.
15652      */
clearFilter()15653     public Builder clearFilter() {
15654       filter_ = getDefaultInstance().getFilter();
15655       bitField0_ = (bitField0_ & ~0x00000100);
15656       onChanged();
15657       return this;
15658     }
15659     /**
15660      *
15661      *
15662      * <pre>
15663      * The filter syntax consists of an expression language for constructing a
15664      * predicate from one or more fields of the products being filtered. Filter
15665      * expression is case-sensitive. See more details at this [user
15666      * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
15667      * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
15668      * </pre>
15669      *
15670      * <code>string filter = 10;</code>
15671      *
15672      * @param value The bytes for filter to set.
15673      * @return This builder for chaining.
15674      */
setFilterBytes(com.google.protobuf.ByteString value)15675     public Builder setFilterBytes(com.google.protobuf.ByteString value) {
15676       if (value == null) {
15677         throw new NullPointerException();
15678       }
15679       checkByteStringIsUtf8(value);
15680       filter_ = value;
15681       bitField0_ |= 0x00000100;
15682       onChanged();
15683       return this;
15684     }
15685 
15686     private java.lang.Object canonicalFilter_ = "";
15687     /**
15688      *
15689      *
15690      * <pre>
15691      * The default filter that is applied when a user performs a search without
15692      * checking any filters on the search page.
15693      * The filter applied to every search request when quality improvement such as
15694      * query expansion is needed. For example, if a query does not have enough
15695      * results, an expanded query with
15696      * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
15697      * will be returned as a supplement of the original query. This field is
15698      * strongly recommended to achieve high search quality.
15699      * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
15700      * more details about filter syntax.
15701      * </pre>
15702      *
15703      * <code>string canonical_filter = 28;</code>
15704      *
15705      * @return The canonicalFilter.
15706      */
getCanonicalFilter()15707     public java.lang.String getCanonicalFilter() {
15708       java.lang.Object ref = canonicalFilter_;
15709       if (!(ref instanceof java.lang.String)) {
15710         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
15711         java.lang.String s = bs.toStringUtf8();
15712         canonicalFilter_ = s;
15713         return s;
15714       } else {
15715         return (java.lang.String) ref;
15716       }
15717     }
15718     /**
15719      *
15720      *
15721      * <pre>
15722      * The default filter that is applied when a user performs a search without
15723      * checking any filters on the search page.
15724      * The filter applied to every search request when quality improvement such as
15725      * query expansion is needed. For example, if a query does not have enough
15726      * results, an expanded query with
15727      * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
15728      * will be returned as a supplement of the original query. This field is
15729      * strongly recommended to achieve high search quality.
15730      * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
15731      * more details about filter syntax.
15732      * </pre>
15733      *
15734      * <code>string canonical_filter = 28;</code>
15735      *
15736      * @return The bytes for canonicalFilter.
15737      */
getCanonicalFilterBytes()15738     public com.google.protobuf.ByteString getCanonicalFilterBytes() {
15739       java.lang.Object ref = canonicalFilter_;
15740       if (ref instanceof String) {
15741         com.google.protobuf.ByteString b =
15742             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
15743         canonicalFilter_ = b;
15744         return b;
15745       } else {
15746         return (com.google.protobuf.ByteString) ref;
15747       }
15748     }
15749     /**
15750      *
15751      *
15752      * <pre>
15753      * The default filter that is applied when a user performs a search without
15754      * checking any filters on the search page.
15755      * The filter applied to every search request when quality improvement such as
15756      * query expansion is needed. For example, if a query does not have enough
15757      * results, an expanded query with
15758      * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
15759      * will be returned as a supplement of the original query. This field is
15760      * strongly recommended to achieve high search quality.
15761      * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
15762      * more details about filter syntax.
15763      * </pre>
15764      *
15765      * <code>string canonical_filter = 28;</code>
15766      *
15767      * @param value The canonicalFilter to set.
15768      * @return This builder for chaining.
15769      */
setCanonicalFilter(java.lang.String value)15770     public Builder setCanonicalFilter(java.lang.String value) {
15771       if (value == null) {
15772         throw new NullPointerException();
15773       }
15774       canonicalFilter_ = value;
15775       bitField0_ |= 0x00000200;
15776       onChanged();
15777       return this;
15778     }
15779     /**
15780      *
15781      *
15782      * <pre>
15783      * The default filter that is applied when a user performs a search without
15784      * checking any filters on the search page.
15785      * The filter applied to every search request when quality improvement such as
15786      * query expansion is needed. For example, if a query does not have enough
15787      * results, an expanded query with
15788      * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
15789      * will be returned as a supplement of the original query. This field is
15790      * strongly recommended to achieve high search quality.
15791      * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
15792      * more details about filter syntax.
15793      * </pre>
15794      *
15795      * <code>string canonical_filter = 28;</code>
15796      *
15797      * @return This builder for chaining.
15798      */
clearCanonicalFilter()15799     public Builder clearCanonicalFilter() {
15800       canonicalFilter_ = getDefaultInstance().getCanonicalFilter();
15801       bitField0_ = (bitField0_ & ~0x00000200);
15802       onChanged();
15803       return this;
15804     }
15805     /**
15806      *
15807      *
15808      * <pre>
15809      * The default filter that is applied when a user performs a search without
15810      * checking any filters on the search page.
15811      * The filter applied to every search request when quality improvement such as
15812      * query expansion is needed. For example, if a query does not have enough
15813      * results, an expanded query with
15814      * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
15815      * will be returned as a supplement of the original query. This field is
15816      * strongly recommended to achieve high search quality.
15817      * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
15818      * more details about filter syntax.
15819      * </pre>
15820      *
15821      * <code>string canonical_filter = 28;</code>
15822      *
15823      * @param value The bytes for canonicalFilter to set.
15824      * @return This builder for chaining.
15825      */
setCanonicalFilterBytes(com.google.protobuf.ByteString value)15826     public Builder setCanonicalFilterBytes(com.google.protobuf.ByteString value) {
15827       if (value == null) {
15828         throw new NullPointerException();
15829       }
15830       checkByteStringIsUtf8(value);
15831       canonicalFilter_ = value;
15832       bitField0_ |= 0x00000200;
15833       onChanged();
15834       return this;
15835     }
15836 
15837     private java.lang.Object orderBy_ = "";
15838     /**
15839      *
15840      *
15841      * <pre>
15842      * The order in which products are returned. Products can be ordered by
15843      * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
15844      * unset if ordered by relevance. OrderBy expression is case-sensitive. See
15845      * more details at this [user
15846      * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
15847      * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
15848      * </pre>
15849      *
15850      * <code>string order_by = 11;</code>
15851      *
15852      * @return The orderBy.
15853      */
getOrderBy()15854     public java.lang.String getOrderBy() {
15855       java.lang.Object ref = orderBy_;
15856       if (!(ref instanceof java.lang.String)) {
15857         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
15858         java.lang.String s = bs.toStringUtf8();
15859         orderBy_ = s;
15860         return s;
15861       } else {
15862         return (java.lang.String) ref;
15863       }
15864     }
15865     /**
15866      *
15867      *
15868      * <pre>
15869      * The order in which products are returned. Products can be ordered by
15870      * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
15871      * unset if ordered by relevance. OrderBy expression is case-sensitive. See
15872      * more details at this [user
15873      * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
15874      * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
15875      * </pre>
15876      *
15877      * <code>string order_by = 11;</code>
15878      *
15879      * @return The bytes for orderBy.
15880      */
getOrderByBytes()15881     public com.google.protobuf.ByteString getOrderByBytes() {
15882       java.lang.Object ref = orderBy_;
15883       if (ref instanceof String) {
15884         com.google.protobuf.ByteString b =
15885             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
15886         orderBy_ = b;
15887         return b;
15888       } else {
15889         return (com.google.protobuf.ByteString) ref;
15890       }
15891     }
15892     /**
15893      *
15894      *
15895      * <pre>
15896      * The order in which products are returned. Products can be ordered by
15897      * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
15898      * unset if ordered by relevance. OrderBy expression is case-sensitive. See
15899      * more details at this [user
15900      * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
15901      * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
15902      * </pre>
15903      *
15904      * <code>string order_by = 11;</code>
15905      *
15906      * @param value The orderBy to set.
15907      * @return This builder for chaining.
15908      */
setOrderBy(java.lang.String value)15909     public Builder setOrderBy(java.lang.String value) {
15910       if (value == null) {
15911         throw new NullPointerException();
15912       }
15913       orderBy_ = value;
15914       bitField0_ |= 0x00000400;
15915       onChanged();
15916       return this;
15917     }
15918     /**
15919      *
15920      *
15921      * <pre>
15922      * The order in which products are returned. Products can be ordered by
15923      * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
15924      * unset if ordered by relevance. OrderBy expression is case-sensitive. See
15925      * more details at this [user
15926      * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
15927      * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
15928      * </pre>
15929      *
15930      * <code>string order_by = 11;</code>
15931      *
15932      * @return This builder for chaining.
15933      */
clearOrderBy()15934     public Builder clearOrderBy() {
15935       orderBy_ = getDefaultInstance().getOrderBy();
15936       bitField0_ = (bitField0_ & ~0x00000400);
15937       onChanged();
15938       return this;
15939     }
15940     /**
15941      *
15942      *
15943      * <pre>
15944      * The order in which products are returned. Products can be ordered by
15945      * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
15946      * unset if ordered by relevance. OrderBy expression is case-sensitive. See
15947      * more details at this [user
15948      * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
15949      * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
15950      * </pre>
15951      *
15952      * <code>string order_by = 11;</code>
15953      *
15954      * @param value The bytes for orderBy to set.
15955      * @return This builder for chaining.
15956      */
setOrderByBytes(com.google.protobuf.ByteString value)15957     public Builder setOrderByBytes(com.google.protobuf.ByteString value) {
15958       if (value == null) {
15959         throw new NullPointerException();
15960       }
15961       checkByteStringIsUtf8(value);
15962       orderBy_ = value;
15963       bitField0_ |= 0x00000400;
15964       onChanged();
15965       return this;
15966     }
15967 
15968     private java.util.List<com.google.cloud.retail.v2.SearchRequest.FacetSpec> facetSpecs_ =
15969         java.util.Collections.emptyList();
15970 
ensureFacetSpecsIsMutable()15971     private void ensureFacetSpecsIsMutable() {
15972       if (!((bitField0_ & 0x00000800) != 0)) {
15973         facetSpecs_ =
15974             new java.util.ArrayList<com.google.cloud.retail.v2.SearchRequest.FacetSpec>(
15975                 facetSpecs_);
15976         bitField0_ |= 0x00000800;
15977       }
15978     }
15979 
15980     private com.google.protobuf.RepeatedFieldBuilderV3<
15981             com.google.cloud.retail.v2.SearchRequest.FacetSpec,
15982             com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder,
15983             com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder>
15984         facetSpecsBuilder_;
15985 
15986     /**
15987      *
15988      *
15989      * <pre>
15990      * Facet specifications for faceted search. If empty, no facets are returned.
15991      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
15992      * is returned.
15993      * </pre>
15994      *
15995      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
15996      */
getFacetSpecsList()15997     public java.util.List<com.google.cloud.retail.v2.SearchRequest.FacetSpec> getFacetSpecsList() {
15998       if (facetSpecsBuilder_ == null) {
15999         return java.util.Collections.unmodifiableList(facetSpecs_);
16000       } else {
16001         return facetSpecsBuilder_.getMessageList();
16002       }
16003     }
16004     /**
16005      *
16006      *
16007      * <pre>
16008      * Facet specifications for faceted search. If empty, no facets are returned.
16009      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16010      * is returned.
16011      * </pre>
16012      *
16013      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16014      */
getFacetSpecsCount()16015     public int getFacetSpecsCount() {
16016       if (facetSpecsBuilder_ == null) {
16017         return facetSpecs_.size();
16018       } else {
16019         return facetSpecsBuilder_.getCount();
16020       }
16021     }
16022     /**
16023      *
16024      *
16025      * <pre>
16026      * Facet specifications for faceted search. If empty, no facets are returned.
16027      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16028      * is returned.
16029      * </pre>
16030      *
16031      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16032      */
getFacetSpecs(int index)16033     public com.google.cloud.retail.v2.SearchRequest.FacetSpec getFacetSpecs(int index) {
16034       if (facetSpecsBuilder_ == null) {
16035         return facetSpecs_.get(index);
16036       } else {
16037         return facetSpecsBuilder_.getMessage(index);
16038       }
16039     }
16040     /**
16041      *
16042      *
16043      * <pre>
16044      * Facet specifications for faceted search. If empty, no facets are returned.
16045      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16046      * is returned.
16047      * </pre>
16048      *
16049      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16050      */
setFacetSpecs( int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec value)16051     public Builder setFacetSpecs(
16052         int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec value) {
16053       if (facetSpecsBuilder_ == null) {
16054         if (value == null) {
16055           throw new NullPointerException();
16056         }
16057         ensureFacetSpecsIsMutable();
16058         facetSpecs_.set(index, value);
16059         onChanged();
16060       } else {
16061         facetSpecsBuilder_.setMessage(index, value);
16062       }
16063       return this;
16064     }
16065     /**
16066      *
16067      *
16068      * <pre>
16069      * Facet specifications for faceted search. If empty, no facets are returned.
16070      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16071      * is returned.
16072      * </pre>
16073      *
16074      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16075      */
setFacetSpecs( int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder builderForValue)16076     public Builder setFacetSpecs(
16077         int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder builderForValue) {
16078       if (facetSpecsBuilder_ == null) {
16079         ensureFacetSpecsIsMutable();
16080         facetSpecs_.set(index, builderForValue.build());
16081         onChanged();
16082       } else {
16083         facetSpecsBuilder_.setMessage(index, builderForValue.build());
16084       }
16085       return this;
16086     }
16087     /**
16088      *
16089      *
16090      * <pre>
16091      * Facet specifications for faceted search. If empty, no facets are returned.
16092      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16093      * is returned.
16094      * </pre>
16095      *
16096      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16097      */
addFacetSpecs(com.google.cloud.retail.v2.SearchRequest.FacetSpec value)16098     public Builder addFacetSpecs(com.google.cloud.retail.v2.SearchRequest.FacetSpec value) {
16099       if (facetSpecsBuilder_ == null) {
16100         if (value == null) {
16101           throw new NullPointerException();
16102         }
16103         ensureFacetSpecsIsMutable();
16104         facetSpecs_.add(value);
16105         onChanged();
16106       } else {
16107         facetSpecsBuilder_.addMessage(value);
16108       }
16109       return this;
16110     }
16111     /**
16112      *
16113      *
16114      * <pre>
16115      * Facet specifications for faceted search. If empty, no facets are returned.
16116      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16117      * is returned.
16118      * </pre>
16119      *
16120      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16121      */
addFacetSpecs( int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec value)16122     public Builder addFacetSpecs(
16123         int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec value) {
16124       if (facetSpecsBuilder_ == null) {
16125         if (value == null) {
16126           throw new NullPointerException();
16127         }
16128         ensureFacetSpecsIsMutable();
16129         facetSpecs_.add(index, value);
16130         onChanged();
16131       } else {
16132         facetSpecsBuilder_.addMessage(index, value);
16133       }
16134       return this;
16135     }
16136     /**
16137      *
16138      *
16139      * <pre>
16140      * Facet specifications for faceted search. If empty, no facets are returned.
16141      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16142      * is returned.
16143      * </pre>
16144      *
16145      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16146      */
addFacetSpecs( com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder builderForValue)16147     public Builder addFacetSpecs(
16148         com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder builderForValue) {
16149       if (facetSpecsBuilder_ == null) {
16150         ensureFacetSpecsIsMutable();
16151         facetSpecs_.add(builderForValue.build());
16152         onChanged();
16153       } else {
16154         facetSpecsBuilder_.addMessage(builderForValue.build());
16155       }
16156       return this;
16157     }
16158     /**
16159      *
16160      *
16161      * <pre>
16162      * Facet specifications for faceted search. If empty, no facets are returned.
16163      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16164      * is returned.
16165      * </pre>
16166      *
16167      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16168      */
addFacetSpecs( int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder builderForValue)16169     public Builder addFacetSpecs(
16170         int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder builderForValue) {
16171       if (facetSpecsBuilder_ == null) {
16172         ensureFacetSpecsIsMutable();
16173         facetSpecs_.add(index, builderForValue.build());
16174         onChanged();
16175       } else {
16176         facetSpecsBuilder_.addMessage(index, builderForValue.build());
16177       }
16178       return this;
16179     }
16180     /**
16181      *
16182      *
16183      * <pre>
16184      * Facet specifications for faceted search. If empty, no facets are returned.
16185      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16186      * is returned.
16187      * </pre>
16188      *
16189      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16190      */
addAllFacetSpecs( java.lang.Iterable<? extends com.google.cloud.retail.v2.SearchRequest.FacetSpec> values)16191     public Builder addAllFacetSpecs(
16192         java.lang.Iterable<? extends com.google.cloud.retail.v2.SearchRequest.FacetSpec> values) {
16193       if (facetSpecsBuilder_ == null) {
16194         ensureFacetSpecsIsMutable();
16195         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facetSpecs_);
16196         onChanged();
16197       } else {
16198         facetSpecsBuilder_.addAllMessages(values);
16199       }
16200       return this;
16201     }
16202     /**
16203      *
16204      *
16205      * <pre>
16206      * Facet specifications for faceted search. If empty, no facets are returned.
16207      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16208      * is returned.
16209      * </pre>
16210      *
16211      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16212      */
clearFacetSpecs()16213     public Builder clearFacetSpecs() {
16214       if (facetSpecsBuilder_ == null) {
16215         facetSpecs_ = java.util.Collections.emptyList();
16216         bitField0_ = (bitField0_ & ~0x00000800);
16217         onChanged();
16218       } else {
16219         facetSpecsBuilder_.clear();
16220       }
16221       return this;
16222     }
16223     /**
16224      *
16225      *
16226      * <pre>
16227      * Facet specifications for faceted search. If empty, no facets are returned.
16228      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16229      * is returned.
16230      * </pre>
16231      *
16232      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16233      */
removeFacetSpecs(int index)16234     public Builder removeFacetSpecs(int index) {
16235       if (facetSpecsBuilder_ == null) {
16236         ensureFacetSpecsIsMutable();
16237         facetSpecs_.remove(index);
16238         onChanged();
16239       } else {
16240         facetSpecsBuilder_.remove(index);
16241       }
16242       return this;
16243     }
16244     /**
16245      *
16246      *
16247      * <pre>
16248      * Facet specifications for faceted search. If empty, no facets are returned.
16249      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16250      * is returned.
16251      * </pre>
16252      *
16253      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16254      */
getFacetSpecsBuilder( int index)16255     public com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder getFacetSpecsBuilder(
16256         int index) {
16257       return getFacetSpecsFieldBuilder().getBuilder(index);
16258     }
16259     /**
16260      *
16261      *
16262      * <pre>
16263      * Facet specifications for faceted search. If empty, no facets are returned.
16264      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16265      * is returned.
16266      * </pre>
16267      *
16268      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16269      */
getFacetSpecsOrBuilder( int index)16270     public com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder(
16271         int index) {
16272       if (facetSpecsBuilder_ == null) {
16273         return facetSpecs_.get(index);
16274       } else {
16275         return facetSpecsBuilder_.getMessageOrBuilder(index);
16276       }
16277     }
16278     /**
16279      *
16280      *
16281      * <pre>
16282      * Facet specifications for faceted search. If empty, no facets are returned.
16283      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16284      * is returned.
16285      * </pre>
16286      *
16287      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16288      */
16289     public java.util.List<? extends com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder>
getFacetSpecsOrBuilderList()16290         getFacetSpecsOrBuilderList() {
16291       if (facetSpecsBuilder_ != null) {
16292         return facetSpecsBuilder_.getMessageOrBuilderList();
16293       } else {
16294         return java.util.Collections.unmodifiableList(facetSpecs_);
16295       }
16296     }
16297     /**
16298      *
16299      *
16300      * <pre>
16301      * Facet specifications for faceted search. If empty, no facets are returned.
16302      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16303      * is returned.
16304      * </pre>
16305      *
16306      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16307      */
addFacetSpecsBuilder()16308     public com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder addFacetSpecsBuilder() {
16309       return getFacetSpecsFieldBuilder()
16310           .addBuilder(com.google.cloud.retail.v2.SearchRequest.FacetSpec.getDefaultInstance());
16311     }
16312     /**
16313      *
16314      *
16315      * <pre>
16316      * Facet specifications for faceted search. If empty, no facets are returned.
16317      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16318      * is returned.
16319      * </pre>
16320      *
16321      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16322      */
addFacetSpecsBuilder( int index)16323     public com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder addFacetSpecsBuilder(
16324         int index) {
16325       return getFacetSpecsFieldBuilder()
16326           .addBuilder(
16327               index, com.google.cloud.retail.v2.SearchRequest.FacetSpec.getDefaultInstance());
16328     }
16329     /**
16330      *
16331      *
16332      * <pre>
16333      * Facet specifications for faceted search. If empty, no facets are returned.
16334      * A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error
16335      * is returned.
16336      * </pre>
16337      *
16338      * <code>repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12;</code>
16339      */
16340     public java.util.List<com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder>
getFacetSpecsBuilderList()16341         getFacetSpecsBuilderList() {
16342       return getFacetSpecsFieldBuilder().getBuilderList();
16343     }
16344 
16345     private com.google.protobuf.RepeatedFieldBuilderV3<
16346             com.google.cloud.retail.v2.SearchRequest.FacetSpec,
16347             com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder,
16348             com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder>
getFacetSpecsFieldBuilder()16349         getFacetSpecsFieldBuilder() {
16350       if (facetSpecsBuilder_ == null) {
16351         facetSpecsBuilder_ =
16352             new com.google.protobuf.RepeatedFieldBuilderV3<
16353                 com.google.cloud.retail.v2.SearchRequest.FacetSpec,
16354                 com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder,
16355                 com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder>(
16356                 facetSpecs_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean());
16357         facetSpecs_ = null;
16358       }
16359       return facetSpecsBuilder_;
16360     }
16361 
16362     private com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamicFacetSpec_;
16363     private com.google.protobuf.SingleFieldBuilderV3<
16364             com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec,
16365             com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder,
16366             com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder>
16367         dynamicFacetSpecBuilder_;
16368     /**
16369      *
16370      *
16371      * <pre>
16372      * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
16373      * to enable dynamic facets. Do not set this field.
16374      * The specification for dynamically generated facets. Notice that only
16375      * textual facets can be dynamically generated.
16376      * </pre>
16377      *
16378      * <code>
16379      * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
16380      * </code>
16381      *
16382      * @deprecated google.cloud.retail.v2.SearchRequest.dynamic_facet_spec is deprecated. See
16383      *     google/cloud/retail/v2/search_service.proto;l=596
16384      * @return Whether the dynamicFacetSpec field is set.
16385      */
16386     @java.lang.Deprecated
hasDynamicFacetSpec()16387     public boolean hasDynamicFacetSpec() {
16388       return ((bitField0_ & 0x00001000) != 0);
16389     }
16390     /**
16391      *
16392      *
16393      * <pre>
16394      * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
16395      * to enable dynamic facets. Do not set this field.
16396      * The specification for dynamically generated facets. Notice that only
16397      * textual facets can be dynamically generated.
16398      * </pre>
16399      *
16400      * <code>
16401      * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
16402      * </code>
16403      *
16404      * @deprecated google.cloud.retail.v2.SearchRequest.dynamic_facet_spec is deprecated. See
16405      *     google/cloud/retail/v2/search_service.proto;l=596
16406      * @return The dynamicFacetSpec.
16407      */
16408     @java.lang.Deprecated
getDynamicFacetSpec()16409     public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() {
16410       if (dynamicFacetSpecBuilder_ == null) {
16411         return dynamicFacetSpec_ == null
16412             ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance()
16413             : dynamicFacetSpec_;
16414       } else {
16415         return dynamicFacetSpecBuilder_.getMessage();
16416       }
16417     }
16418     /**
16419      *
16420      *
16421      * <pre>
16422      * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
16423      * to enable dynamic facets. Do not set this field.
16424      * The specification for dynamically generated facets. Notice that only
16425      * textual facets can be dynamically generated.
16426      * </pre>
16427      *
16428      * <code>
16429      * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
16430      * </code>
16431      */
16432     @java.lang.Deprecated
setDynamicFacetSpec( com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec value)16433     public Builder setDynamicFacetSpec(
16434         com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec value) {
16435       if (dynamicFacetSpecBuilder_ == null) {
16436         if (value == null) {
16437           throw new NullPointerException();
16438         }
16439         dynamicFacetSpec_ = value;
16440       } else {
16441         dynamicFacetSpecBuilder_.setMessage(value);
16442       }
16443       bitField0_ |= 0x00001000;
16444       onChanged();
16445       return this;
16446     }
16447     /**
16448      *
16449      *
16450      * <pre>
16451      * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
16452      * to enable dynamic facets. Do not set this field.
16453      * The specification for dynamically generated facets. Notice that only
16454      * textual facets can be dynamically generated.
16455      * </pre>
16456      *
16457      * <code>
16458      * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
16459      * </code>
16460      */
16461     @java.lang.Deprecated
setDynamicFacetSpec( com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder builderForValue)16462     public Builder setDynamicFacetSpec(
16463         com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder builderForValue) {
16464       if (dynamicFacetSpecBuilder_ == null) {
16465         dynamicFacetSpec_ = builderForValue.build();
16466       } else {
16467         dynamicFacetSpecBuilder_.setMessage(builderForValue.build());
16468       }
16469       bitField0_ |= 0x00001000;
16470       onChanged();
16471       return this;
16472     }
16473     /**
16474      *
16475      *
16476      * <pre>
16477      * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
16478      * to enable dynamic facets. Do not set this field.
16479      * The specification for dynamically generated facets. Notice that only
16480      * textual facets can be dynamically generated.
16481      * </pre>
16482      *
16483      * <code>
16484      * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
16485      * </code>
16486      */
16487     @java.lang.Deprecated
mergeDynamicFacetSpec( com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec value)16488     public Builder mergeDynamicFacetSpec(
16489         com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec value) {
16490       if (dynamicFacetSpecBuilder_ == null) {
16491         if (((bitField0_ & 0x00001000) != 0)
16492             && dynamicFacetSpec_ != null
16493             && dynamicFacetSpec_
16494                 != com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance()) {
16495           getDynamicFacetSpecBuilder().mergeFrom(value);
16496         } else {
16497           dynamicFacetSpec_ = value;
16498         }
16499       } else {
16500         dynamicFacetSpecBuilder_.mergeFrom(value);
16501       }
16502       bitField0_ |= 0x00001000;
16503       onChanged();
16504       return this;
16505     }
16506     /**
16507      *
16508      *
16509      * <pre>
16510      * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
16511      * to enable dynamic facets. Do not set this field.
16512      * The specification for dynamically generated facets. Notice that only
16513      * textual facets can be dynamically generated.
16514      * </pre>
16515      *
16516      * <code>
16517      * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
16518      * </code>
16519      */
16520     @java.lang.Deprecated
clearDynamicFacetSpec()16521     public Builder clearDynamicFacetSpec() {
16522       bitField0_ = (bitField0_ & ~0x00001000);
16523       dynamicFacetSpec_ = null;
16524       if (dynamicFacetSpecBuilder_ != null) {
16525         dynamicFacetSpecBuilder_.dispose();
16526         dynamicFacetSpecBuilder_ = null;
16527       }
16528       onChanged();
16529       return this;
16530     }
16531     /**
16532      *
16533      *
16534      * <pre>
16535      * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
16536      * to enable dynamic facets. Do not set this field.
16537      * The specification for dynamically generated facets. Notice that only
16538      * textual facets can be dynamically generated.
16539      * </pre>
16540      *
16541      * <code>
16542      * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
16543      * </code>
16544      */
16545     @java.lang.Deprecated
16546     public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder
getDynamicFacetSpecBuilder()16547         getDynamicFacetSpecBuilder() {
16548       bitField0_ |= 0x00001000;
16549       onChanged();
16550       return getDynamicFacetSpecFieldBuilder().getBuilder();
16551     }
16552     /**
16553      *
16554      *
16555      * <pre>
16556      * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
16557      * to enable dynamic facets. Do not set this field.
16558      * The specification for dynamically generated facets. Notice that only
16559      * textual facets can be dynamically generated.
16560      * </pre>
16561      *
16562      * <code>
16563      * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
16564      * </code>
16565      */
16566     @java.lang.Deprecated
16567     public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder
getDynamicFacetSpecOrBuilder()16568         getDynamicFacetSpecOrBuilder() {
16569       if (dynamicFacetSpecBuilder_ != null) {
16570         return dynamicFacetSpecBuilder_.getMessageOrBuilder();
16571       } else {
16572         return dynamicFacetSpec_ == null
16573             ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance()
16574             : dynamicFacetSpec_;
16575       }
16576     }
16577     /**
16578      *
16579      *
16580      * <pre>
16581      * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
16582      * to enable dynamic facets. Do not set this field.
16583      * The specification for dynamically generated facets. Notice that only
16584      * textual facets can be dynamically generated.
16585      * </pre>
16586      *
16587      * <code>
16588      * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
16589      * </code>
16590      */
16591     private com.google.protobuf.SingleFieldBuilderV3<
16592             com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec,
16593             com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder,
16594             com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder>
getDynamicFacetSpecFieldBuilder()16595         getDynamicFacetSpecFieldBuilder() {
16596       if (dynamicFacetSpecBuilder_ == null) {
16597         dynamicFacetSpecBuilder_ =
16598             new com.google.protobuf.SingleFieldBuilderV3<
16599                 com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec,
16600                 com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder,
16601                 com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder>(
16602                 getDynamicFacetSpec(), getParentForChildren(), isClean());
16603         dynamicFacetSpec_ = null;
16604       }
16605       return dynamicFacetSpecBuilder_;
16606     }
16607 
16608     private com.google.cloud.retail.v2.SearchRequest.BoostSpec boostSpec_;
16609     private com.google.protobuf.SingleFieldBuilderV3<
16610             com.google.cloud.retail.v2.SearchRequest.BoostSpec,
16611             com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder,
16612             com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder>
16613         boostSpecBuilder_;
16614     /**
16615      *
16616      *
16617      * <pre>
16618      * Boost specification to boost certain products. See more details at this
16619      * [user guide](https://cloud.google.com/retail/docs/boosting).
16620      * Notice that if both
16621      * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
16622      * and
16623      * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
16624      * are set, the boost conditions from both places are evaluated. If a search
16625      * request matches multiple boost conditions, the final boost score is equal
16626      * to the sum of the boost scores from all matched boost conditions.
16627      * </pre>
16628      *
16629      * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
16630      *
16631      * @return Whether the boostSpec field is set.
16632      */
hasBoostSpec()16633     public boolean hasBoostSpec() {
16634       return ((bitField0_ & 0x00002000) != 0);
16635     }
16636     /**
16637      *
16638      *
16639      * <pre>
16640      * Boost specification to boost certain products. See more details at this
16641      * [user guide](https://cloud.google.com/retail/docs/boosting).
16642      * Notice that if both
16643      * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
16644      * and
16645      * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
16646      * are set, the boost conditions from both places are evaluated. If a search
16647      * request matches multiple boost conditions, the final boost score is equal
16648      * to the sum of the boost scores from all matched boost conditions.
16649      * </pre>
16650      *
16651      * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
16652      *
16653      * @return The boostSpec.
16654      */
getBoostSpec()16655     public com.google.cloud.retail.v2.SearchRequest.BoostSpec getBoostSpec() {
16656       if (boostSpecBuilder_ == null) {
16657         return boostSpec_ == null
16658             ? com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance()
16659             : boostSpec_;
16660       } else {
16661         return boostSpecBuilder_.getMessage();
16662       }
16663     }
16664     /**
16665      *
16666      *
16667      * <pre>
16668      * Boost specification to boost certain products. See more details at this
16669      * [user guide](https://cloud.google.com/retail/docs/boosting).
16670      * Notice that if both
16671      * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
16672      * and
16673      * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
16674      * are set, the boost conditions from both places are evaluated. If a search
16675      * request matches multiple boost conditions, the final boost score is equal
16676      * to the sum of the boost scores from all matched boost conditions.
16677      * </pre>
16678      *
16679      * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
16680      */
setBoostSpec(com.google.cloud.retail.v2.SearchRequest.BoostSpec value)16681     public Builder setBoostSpec(com.google.cloud.retail.v2.SearchRequest.BoostSpec value) {
16682       if (boostSpecBuilder_ == null) {
16683         if (value == null) {
16684           throw new NullPointerException();
16685         }
16686         boostSpec_ = value;
16687       } else {
16688         boostSpecBuilder_.setMessage(value);
16689       }
16690       bitField0_ |= 0x00002000;
16691       onChanged();
16692       return this;
16693     }
16694     /**
16695      *
16696      *
16697      * <pre>
16698      * Boost specification to boost certain products. See more details at this
16699      * [user guide](https://cloud.google.com/retail/docs/boosting).
16700      * Notice that if both
16701      * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
16702      * and
16703      * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
16704      * are set, the boost conditions from both places are evaluated. If a search
16705      * request matches multiple boost conditions, the final boost score is equal
16706      * to the sum of the boost scores from all matched boost conditions.
16707      * </pre>
16708      *
16709      * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
16710      */
setBoostSpec( com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder builderForValue)16711     public Builder setBoostSpec(
16712         com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder builderForValue) {
16713       if (boostSpecBuilder_ == null) {
16714         boostSpec_ = builderForValue.build();
16715       } else {
16716         boostSpecBuilder_.setMessage(builderForValue.build());
16717       }
16718       bitField0_ |= 0x00002000;
16719       onChanged();
16720       return this;
16721     }
16722     /**
16723      *
16724      *
16725      * <pre>
16726      * Boost specification to boost certain products. See more details at this
16727      * [user guide](https://cloud.google.com/retail/docs/boosting).
16728      * Notice that if both
16729      * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
16730      * and
16731      * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
16732      * are set, the boost conditions from both places are evaluated. If a search
16733      * request matches multiple boost conditions, the final boost score is equal
16734      * to the sum of the boost scores from all matched boost conditions.
16735      * </pre>
16736      *
16737      * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
16738      */
mergeBoostSpec(com.google.cloud.retail.v2.SearchRequest.BoostSpec value)16739     public Builder mergeBoostSpec(com.google.cloud.retail.v2.SearchRequest.BoostSpec value) {
16740       if (boostSpecBuilder_ == null) {
16741         if (((bitField0_ & 0x00002000) != 0)
16742             && boostSpec_ != null
16743             && boostSpec_
16744                 != com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance()) {
16745           getBoostSpecBuilder().mergeFrom(value);
16746         } else {
16747           boostSpec_ = value;
16748         }
16749       } else {
16750         boostSpecBuilder_.mergeFrom(value);
16751       }
16752       bitField0_ |= 0x00002000;
16753       onChanged();
16754       return this;
16755     }
16756     /**
16757      *
16758      *
16759      * <pre>
16760      * Boost specification to boost certain products. See more details at this
16761      * [user guide](https://cloud.google.com/retail/docs/boosting).
16762      * Notice that if both
16763      * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
16764      * and
16765      * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
16766      * are set, the boost conditions from both places are evaluated. If a search
16767      * request matches multiple boost conditions, the final boost score is equal
16768      * to the sum of the boost scores from all matched boost conditions.
16769      * </pre>
16770      *
16771      * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
16772      */
clearBoostSpec()16773     public Builder clearBoostSpec() {
16774       bitField0_ = (bitField0_ & ~0x00002000);
16775       boostSpec_ = null;
16776       if (boostSpecBuilder_ != null) {
16777         boostSpecBuilder_.dispose();
16778         boostSpecBuilder_ = null;
16779       }
16780       onChanged();
16781       return this;
16782     }
16783     /**
16784      *
16785      *
16786      * <pre>
16787      * Boost specification to boost certain products. See more details at this
16788      * [user guide](https://cloud.google.com/retail/docs/boosting).
16789      * Notice that if both
16790      * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
16791      * and
16792      * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
16793      * are set, the boost conditions from both places are evaluated. If a search
16794      * request matches multiple boost conditions, the final boost score is equal
16795      * to the sum of the boost scores from all matched boost conditions.
16796      * </pre>
16797      *
16798      * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
16799      */
getBoostSpecBuilder()16800     public com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder getBoostSpecBuilder() {
16801       bitField0_ |= 0x00002000;
16802       onChanged();
16803       return getBoostSpecFieldBuilder().getBuilder();
16804     }
16805     /**
16806      *
16807      *
16808      * <pre>
16809      * Boost specification to boost certain products. See more details at this
16810      * [user guide](https://cloud.google.com/retail/docs/boosting).
16811      * Notice that if both
16812      * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
16813      * and
16814      * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
16815      * are set, the boost conditions from both places are evaluated. If a search
16816      * request matches multiple boost conditions, the final boost score is equal
16817      * to the sum of the boost scores from all matched boost conditions.
16818      * </pre>
16819      *
16820      * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
16821      */
getBoostSpecOrBuilder()16822     public com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder() {
16823       if (boostSpecBuilder_ != null) {
16824         return boostSpecBuilder_.getMessageOrBuilder();
16825       } else {
16826         return boostSpec_ == null
16827             ? com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance()
16828             : boostSpec_;
16829       }
16830     }
16831     /**
16832      *
16833      *
16834      * <pre>
16835      * Boost specification to boost certain products. See more details at this
16836      * [user guide](https://cloud.google.com/retail/docs/boosting).
16837      * Notice that if both
16838      * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
16839      * and
16840      * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
16841      * are set, the boost conditions from both places are evaluated. If a search
16842      * request matches multiple boost conditions, the final boost score is equal
16843      * to the sum of the boost scores from all matched boost conditions.
16844      * </pre>
16845      *
16846      * <code>.google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13;</code>
16847      */
16848     private com.google.protobuf.SingleFieldBuilderV3<
16849             com.google.cloud.retail.v2.SearchRequest.BoostSpec,
16850             com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder,
16851             com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder>
getBoostSpecFieldBuilder()16852         getBoostSpecFieldBuilder() {
16853       if (boostSpecBuilder_ == null) {
16854         boostSpecBuilder_ =
16855             new com.google.protobuf.SingleFieldBuilderV3<
16856                 com.google.cloud.retail.v2.SearchRequest.BoostSpec,
16857                 com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder,
16858                 com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder>(
16859                 getBoostSpec(), getParentForChildren(), isClean());
16860         boostSpec_ = null;
16861       }
16862       return boostSpecBuilder_;
16863     }
16864 
16865     private com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec queryExpansionSpec_;
16866     private com.google.protobuf.SingleFieldBuilderV3<
16867             com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec,
16868             com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder,
16869             com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder>
16870         queryExpansionSpecBuilder_;
16871     /**
16872      *
16873      *
16874      * <pre>
16875      * The query expansion specification that specifies the conditions under which
16876      * query expansion will occur. See more details at this [user
16877      * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
16878      * </pre>
16879      *
16880      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
16881      * </code>
16882      *
16883      * @return Whether the queryExpansionSpec field is set.
16884      */
hasQueryExpansionSpec()16885     public boolean hasQueryExpansionSpec() {
16886       return ((bitField0_ & 0x00004000) != 0);
16887     }
16888     /**
16889      *
16890      *
16891      * <pre>
16892      * The query expansion specification that specifies the conditions under which
16893      * query expansion will occur. See more details at this [user
16894      * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
16895      * </pre>
16896      *
16897      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
16898      * </code>
16899      *
16900      * @return The queryExpansionSpec.
16901      */
getQueryExpansionSpec()16902     public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec getQueryExpansionSpec() {
16903       if (queryExpansionSpecBuilder_ == null) {
16904         return queryExpansionSpec_ == null
16905             ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance()
16906             : queryExpansionSpec_;
16907       } else {
16908         return queryExpansionSpecBuilder_.getMessage();
16909       }
16910     }
16911     /**
16912      *
16913      *
16914      * <pre>
16915      * The query expansion specification that specifies the conditions under which
16916      * query expansion will occur. See more details at this [user
16917      * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
16918      * </pre>
16919      *
16920      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
16921      * </code>
16922      */
setQueryExpansionSpec( com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec value)16923     public Builder setQueryExpansionSpec(
16924         com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec value) {
16925       if (queryExpansionSpecBuilder_ == null) {
16926         if (value == null) {
16927           throw new NullPointerException();
16928         }
16929         queryExpansionSpec_ = value;
16930       } else {
16931         queryExpansionSpecBuilder_.setMessage(value);
16932       }
16933       bitField0_ |= 0x00004000;
16934       onChanged();
16935       return this;
16936     }
16937     /**
16938      *
16939      *
16940      * <pre>
16941      * The query expansion specification that specifies the conditions under which
16942      * query expansion will occur. See more details at this [user
16943      * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
16944      * </pre>
16945      *
16946      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
16947      * </code>
16948      */
setQueryExpansionSpec( com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder builderForValue)16949     public Builder setQueryExpansionSpec(
16950         com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder builderForValue) {
16951       if (queryExpansionSpecBuilder_ == null) {
16952         queryExpansionSpec_ = builderForValue.build();
16953       } else {
16954         queryExpansionSpecBuilder_.setMessage(builderForValue.build());
16955       }
16956       bitField0_ |= 0x00004000;
16957       onChanged();
16958       return this;
16959     }
16960     /**
16961      *
16962      *
16963      * <pre>
16964      * The query expansion specification that specifies the conditions under which
16965      * query expansion will occur. See more details at this [user
16966      * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
16967      * </pre>
16968      *
16969      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
16970      * </code>
16971      */
mergeQueryExpansionSpec( com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec value)16972     public Builder mergeQueryExpansionSpec(
16973         com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec value) {
16974       if (queryExpansionSpecBuilder_ == null) {
16975         if (((bitField0_ & 0x00004000) != 0)
16976             && queryExpansionSpec_ != null
16977             && queryExpansionSpec_
16978                 != com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec
16979                     .getDefaultInstance()) {
16980           getQueryExpansionSpecBuilder().mergeFrom(value);
16981         } else {
16982           queryExpansionSpec_ = value;
16983         }
16984       } else {
16985         queryExpansionSpecBuilder_.mergeFrom(value);
16986       }
16987       bitField0_ |= 0x00004000;
16988       onChanged();
16989       return this;
16990     }
16991     /**
16992      *
16993      *
16994      * <pre>
16995      * The query expansion specification that specifies the conditions under which
16996      * query expansion will occur. See more details at this [user
16997      * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
16998      * </pre>
16999      *
17000      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
17001      * </code>
17002      */
clearQueryExpansionSpec()17003     public Builder clearQueryExpansionSpec() {
17004       bitField0_ = (bitField0_ & ~0x00004000);
17005       queryExpansionSpec_ = null;
17006       if (queryExpansionSpecBuilder_ != null) {
17007         queryExpansionSpecBuilder_.dispose();
17008         queryExpansionSpecBuilder_ = null;
17009       }
17010       onChanged();
17011       return this;
17012     }
17013     /**
17014      *
17015      *
17016      * <pre>
17017      * The query expansion specification that specifies the conditions under which
17018      * query expansion will occur. See more details at this [user
17019      * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
17020      * </pre>
17021      *
17022      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
17023      * </code>
17024      */
17025     public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder
getQueryExpansionSpecBuilder()17026         getQueryExpansionSpecBuilder() {
17027       bitField0_ |= 0x00004000;
17028       onChanged();
17029       return getQueryExpansionSpecFieldBuilder().getBuilder();
17030     }
17031     /**
17032      *
17033      *
17034      * <pre>
17035      * The query expansion specification that specifies the conditions under which
17036      * query expansion will occur. See more details at this [user
17037      * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
17038      * </pre>
17039      *
17040      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
17041      * </code>
17042      */
17043     public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder
getQueryExpansionSpecOrBuilder()17044         getQueryExpansionSpecOrBuilder() {
17045       if (queryExpansionSpecBuilder_ != null) {
17046         return queryExpansionSpecBuilder_.getMessageOrBuilder();
17047       } else {
17048         return queryExpansionSpec_ == null
17049             ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance()
17050             : queryExpansionSpec_;
17051       }
17052     }
17053     /**
17054      *
17055      *
17056      * <pre>
17057      * The query expansion specification that specifies the conditions under which
17058      * query expansion will occur. See more details at this [user
17059      * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
17060      * </pre>
17061      *
17062      * <code>.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14;
17063      * </code>
17064      */
17065     private com.google.protobuf.SingleFieldBuilderV3<
17066             com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec,
17067             com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder,
17068             com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder>
getQueryExpansionSpecFieldBuilder()17069         getQueryExpansionSpecFieldBuilder() {
17070       if (queryExpansionSpecBuilder_ == null) {
17071         queryExpansionSpecBuilder_ =
17072             new com.google.protobuf.SingleFieldBuilderV3<
17073                 com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec,
17074                 com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder,
17075                 com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder>(
17076                 getQueryExpansionSpec(), getParentForChildren(), isClean());
17077         queryExpansionSpec_ = null;
17078       }
17079       return queryExpansionSpecBuilder_;
17080     }
17081 
17082     private com.google.protobuf.LazyStringList variantRollupKeys_ =
17083         com.google.protobuf.LazyStringArrayList.EMPTY;
17084 
ensureVariantRollupKeysIsMutable()17085     private void ensureVariantRollupKeysIsMutable() {
17086       if (!((bitField0_ & 0x00008000) != 0)) {
17087         variantRollupKeys_ = new com.google.protobuf.LazyStringArrayList(variantRollupKeys_);
17088         bitField0_ |= 0x00008000;
17089       }
17090     }
17091     /**
17092      *
17093      *
17094      * <pre>
17095      * The keys to fetch and rollup the matching
17096      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17097      * [Product][google.cloud.retail.v2.Product]s attributes,
17098      * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
17099      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
17100      * attributes from all the matching
17101      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17102      * [Product][google.cloud.retail.v2.Product]s or
17103      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
17104      * de-duplicated. Notice that rollup attributes will lead to extra query
17105      * latency. Maximum number of keys is 30.
17106      * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
17107      * fulfillment type and a fulfillment ID must be provided in the format of
17108      * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
17109      * "pickupInStore" is fulfillment type and "store123" is the store ID.
17110      * Supported keys are:
17111      * * colorFamilies
17112      * * price
17113      * * originalPrice
17114      * * discount
17115      * * variantId
17116      * * inventory(place_id,price)
17117      * * inventory(place_id,original_price)
17118      * * inventory(place_id,attributes.key), where key is any key in the
17119      *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
17120      *   map.
17121      * * attributes.key, where key is any key in the
17122      *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
17123      * * pickupInStore.id, where id is any
17124      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17125      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17126      *   "pickup-in-store".
17127      * * shipToStore.id, where id is any
17128      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17129      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17130      *   "ship-to-store".
17131      * * sameDayDelivery.id, where id is any
17132      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17133      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17134      *   "same-day-delivery".
17135      * * nextDayDelivery.id, where id is any
17136      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17137      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17138      *   "next-day-delivery".
17139      * * customFulfillment1.id, where id is any
17140      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17141      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17142      *   "custom-type-1".
17143      * * customFulfillment2.id, where id is any
17144      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17145      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17146      *   "custom-type-2".
17147      * * customFulfillment3.id, where id is any
17148      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17149      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17150      *   "custom-type-3".
17151      * * customFulfillment4.id, where id is any
17152      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17153      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17154      *   "custom-type-4".
17155      * * customFulfillment5.id, where id is any
17156      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17157      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17158      *   "custom-type-5".
17159      * If this field is set to an invalid value other than these, an
17160      * INVALID_ARGUMENT error is returned.
17161      * </pre>
17162      *
17163      * <code>repeated string variant_rollup_keys = 17;</code>
17164      *
17165      * @return A list containing the variantRollupKeys.
17166      */
getVariantRollupKeysList()17167     public com.google.protobuf.ProtocolStringList getVariantRollupKeysList() {
17168       return variantRollupKeys_.getUnmodifiableView();
17169     }
17170     /**
17171      *
17172      *
17173      * <pre>
17174      * The keys to fetch and rollup the matching
17175      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17176      * [Product][google.cloud.retail.v2.Product]s attributes,
17177      * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
17178      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
17179      * attributes from all the matching
17180      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17181      * [Product][google.cloud.retail.v2.Product]s or
17182      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
17183      * de-duplicated. Notice that rollup attributes will lead to extra query
17184      * latency. Maximum number of keys is 30.
17185      * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
17186      * fulfillment type and a fulfillment ID must be provided in the format of
17187      * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
17188      * "pickupInStore" is fulfillment type and "store123" is the store ID.
17189      * Supported keys are:
17190      * * colorFamilies
17191      * * price
17192      * * originalPrice
17193      * * discount
17194      * * variantId
17195      * * inventory(place_id,price)
17196      * * inventory(place_id,original_price)
17197      * * inventory(place_id,attributes.key), where key is any key in the
17198      *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
17199      *   map.
17200      * * attributes.key, where key is any key in the
17201      *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
17202      * * pickupInStore.id, where id is any
17203      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17204      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17205      *   "pickup-in-store".
17206      * * shipToStore.id, where id is any
17207      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17208      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17209      *   "ship-to-store".
17210      * * sameDayDelivery.id, where id is any
17211      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17212      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17213      *   "same-day-delivery".
17214      * * nextDayDelivery.id, where id is any
17215      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17216      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17217      *   "next-day-delivery".
17218      * * customFulfillment1.id, where id is any
17219      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17220      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17221      *   "custom-type-1".
17222      * * customFulfillment2.id, where id is any
17223      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17224      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17225      *   "custom-type-2".
17226      * * customFulfillment3.id, where id is any
17227      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17228      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17229      *   "custom-type-3".
17230      * * customFulfillment4.id, where id is any
17231      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17232      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17233      *   "custom-type-4".
17234      * * customFulfillment5.id, where id is any
17235      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17236      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17237      *   "custom-type-5".
17238      * If this field is set to an invalid value other than these, an
17239      * INVALID_ARGUMENT error is returned.
17240      * </pre>
17241      *
17242      * <code>repeated string variant_rollup_keys = 17;</code>
17243      *
17244      * @return The count of variantRollupKeys.
17245      */
getVariantRollupKeysCount()17246     public int getVariantRollupKeysCount() {
17247       return variantRollupKeys_.size();
17248     }
17249     /**
17250      *
17251      *
17252      * <pre>
17253      * The keys to fetch and rollup the matching
17254      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17255      * [Product][google.cloud.retail.v2.Product]s attributes,
17256      * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
17257      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
17258      * attributes from all the matching
17259      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17260      * [Product][google.cloud.retail.v2.Product]s or
17261      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
17262      * de-duplicated. Notice that rollup attributes will lead to extra query
17263      * latency. Maximum number of keys is 30.
17264      * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
17265      * fulfillment type and a fulfillment ID must be provided in the format of
17266      * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
17267      * "pickupInStore" is fulfillment type and "store123" is the store ID.
17268      * Supported keys are:
17269      * * colorFamilies
17270      * * price
17271      * * originalPrice
17272      * * discount
17273      * * variantId
17274      * * inventory(place_id,price)
17275      * * inventory(place_id,original_price)
17276      * * inventory(place_id,attributes.key), where key is any key in the
17277      *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
17278      *   map.
17279      * * attributes.key, where key is any key in the
17280      *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
17281      * * pickupInStore.id, where id is any
17282      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17283      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17284      *   "pickup-in-store".
17285      * * shipToStore.id, where id is any
17286      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17287      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17288      *   "ship-to-store".
17289      * * sameDayDelivery.id, where id is any
17290      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17291      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17292      *   "same-day-delivery".
17293      * * nextDayDelivery.id, where id is any
17294      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17295      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17296      *   "next-day-delivery".
17297      * * customFulfillment1.id, where id is any
17298      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17299      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17300      *   "custom-type-1".
17301      * * customFulfillment2.id, where id is any
17302      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17303      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17304      *   "custom-type-2".
17305      * * customFulfillment3.id, where id is any
17306      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17307      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17308      *   "custom-type-3".
17309      * * customFulfillment4.id, where id is any
17310      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17311      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17312      *   "custom-type-4".
17313      * * customFulfillment5.id, where id is any
17314      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17315      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17316      *   "custom-type-5".
17317      * If this field is set to an invalid value other than these, an
17318      * INVALID_ARGUMENT error is returned.
17319      * </pre>
17320      *
17321      * <code>repeated string variant_rollup_keys = 17;</code>
17322      *
17323      * @param index The index of the element to return.
17324      * @return The variantRollupKeys at the given index.
17325      */
getVariantRollupKeys(int index)17326     public java.lang.String getVariantRollupKeys(int index) {
17327       return variantRollupKeys_.get(index);
17328     }
17329     /**
17330      *
17331      *
17332      * <pre>
17333      * The keys to fetch and rollup the matching
17334      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17335      * [Product][google.cloud.retail.v2.Product]s attributes,
17336      * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
17337      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
17338      * attributes from all the matching
17339      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17340      * [Product][google.cloud.retail.v2.Product]s or
17341      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
17342      * de-duplicated. Notice that rollup attributes will lead to extra query
17343      * latency. Maximum number of keys is 30.
17344      * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
17345      * fulfillment type and a fulfillment ID must be provided in the format of
17346      * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
17347      * "pickupInStore" is fulfillment type and "store123" is the store ID.
17348      * Supported keys are:
17349      * * colorFamilies
17350      * * price
17351      * * originalPrice
17352      * * discount
17353      * * variantId
17354      * * inventory(place_id,price)
17355      * * inventory(place_id,original_price)
17356      * * inventory(place_id,attributes.key), where key is any key in the
17357      *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
17358      *   map.
17359      * * attributes.key, where key is any key in the
17360      *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
17361      * * pickupInStore.id, where id is any
17362      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17363      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17364      *   "pickup-in-store".
17365      * * shipToStore.id, where id is any
17366      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17367      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17368      *   "ship-to-store".
17369      * * sameDayDelivery.id, where id is any
17370      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17371      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17372      *   "same-day-delivery".
17373      * * nextDayDelivery.id, where id is any
17374      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17375      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17376      *   "next-day-delivery".
17377      * * customFulfillment1.id, where id is any
17378      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17379      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17380      *   "custom-type-1".
17381      * * customFulfillment2.id, where id is any
17382      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17383      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17384      *   "custom-type-2".
17385      * * customFulfillment3.id, where id is any
17386      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17387      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17388      *   "custom-type-3".
17389      * * customFulfillment4.id, where id is any
17390      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17391      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17392      *   "custom-type-4".
17393      * * customFulfillment5.id, where id is any
17394      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17395      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17396      *   "custom-type-5".
17397      * If this field is set to an invalid value other than these, an
17398      * INVALID_ARGUMENT error is returned.
17399      * </pre>
17400      *
17401      * <code>repeated string variant_rollup_keys = 17;</code>
17402      *
17403      * @param index The index of the value to return.
17404      * @return The bytes of the variantRollupKeys at the given index.
17405      */
getVariantRollupKeysBytes(int index)17406     public com.google.protobuf.ByteString getVariantRollupKeysBytes(int index) {
17407       return variantRollupKeys_.getByteString(index);
17408     }
17409     /**
17410      *
17411      *
17412      * <pre>
17413      * The keys to fetch and rollup the matching
17414      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17415      * [Product][google.cloud.retail.v2.Product]s attributes,
17416      * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
17417      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
17418      * attributes from all the matching
17419      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17420      * [Product][google.cloud.retail.v2.Product]s or
17421      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
17422      * de-duplicated. Notice that rollup attributes will lead to extra query
17423      * latency. Maximum number of keys is 30.
17424      * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
17425      * fulfillment type and a fulfillment ID must be provided in the format of
17426      * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
17427      * "pickupInStore" is fulfillment type and "store123" is the store ID.
17428      * Supported keys are:
17429      * * colorFamilies
17430      * * price
17431      * * originalPrice
17432      * * discount
17433      * * variantId
17434      * * inventory(place_id,price)
17435      * * inventory(place_id,original_price)
17436      * * inventory(place_id,attributes.key), where key is any key in the
17437      *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
17438      *   map.
17439      * * attributes.key, where key is any key in the
17440      *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
17441      * * pickupInStore.id, where id is any
17442      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17443      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17444      *   "pickup-in-store".
17445      * * shipToStore.id, where id is any
17446      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17447      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17448      *   "ship-to-store".
17449      * * sameDayDelivery.id, where id is any
17450      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17451      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17452      *   "same-day-delivery".
17453      * * nextDayDelivery.id, where id is any
17454      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17455      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17456      *   "next-day-delivery".
17457      * * customFulfillment1.id, where id is any
17458      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17459      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17460      *   "custom-type-1".
17461      * * customFulfillment2.id, where id is any
17462      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17463      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17464      *   "custom-type-2".
17465      * * customFulfillment3.id, where id is any
17466      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17467      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17468      *   "custom-type-3".
17469      * * customFulfillment4.id, where id is any
17470      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17471      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17472      *   "custom-type-4".
17473      * * customFulfillment5.id, where id is any
17474      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17475      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17476      *   "custom-type-5".
17477      * If this field is set to an invalid value other than these, an
17478      * INVALID_ARGUMENT error is returned.
17479      * </pre>
17480      *
17481      * <code>repeated string variant_rollup_keys = 17;</code>
17482      *
17483      * @param index The index to set the value at.
17484      * @param value The variantRollupKeys to set.
17485      * @return This builder for chaining.
17486      */
setVariantRollupKeys(int index, java.lang.String value)17487     public Builder setVariantRollupKeys(int index, java.lang.String value) {
17488       if (value == null) {
17489         throw new NullPointerException();
17490       }
17491       ensureVariantRollupKeysIsMutable();
17492       variantRollupKeys_.set(index, value);
17493       onChanged();
17494       return this;
17495     }
17496     /**
17497      *
17498      *
17499      * <pre>
17500      * The keys to fetch and rollup the matching
17501      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17502      * [Product][google.cloud.retail.v2.Product]s attributes,
17503      * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
17504      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
17505      * attributes from all the matching
17506      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17507      * [Product][google.cloud.retail.v2.Product]s or
17508      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
17509      * de-duplicated. Notice that rollup attributes will lead to extra query
17510      * latency. Maximum number of keys is 30.
17511      * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
17512      * fulfillment type and a fulfillment ID must be provided in the format of
17513      * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
17514      * "pickupInStore" is fulfillment type and "store123" is the store ID.
17515      * Supported keys are:
17516      * * colorFamilies
17517      * * price
17518      * * originalPrice
17519      * * discount
17520      * * variantId
17521      * * inventory(place_id,price)
17522      * * inventory(place_id,original_price)
17523      * * inventory(place_id,attributes.key), where key is any key in the
17524      *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
17525      *   map.
17526      * * attributes.key, where key is any key in the
17527      *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
17528      * * pickupInStore.id, where id is any
17529      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17530      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17531      *   "pickup-in-store".
17532      * * shipToStore.id, where id is any
17533      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17534      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17535      *   "ship-to-store".
17536      * * sameDayDelivery.id, where id is any
17537      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17538      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17539      *   "same-day-delivery".
17540      * * nextDayDelivery.id, where id is any
17541      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17542      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17543      *   "next-day-delivery".
17544      * * customFulfillment1.id, where id is any
17545      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17546      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17547      *   "custom-type-1".
17548      * * customFulfillment2.id, where id is any
17549      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17550      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17551      *   "custom-type-2".
17552      * * customFulfillment3.id, where id is any
17553      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17554      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17555      *   "custom-type-3".
17556      * * customFulfillment4.id, where id is any
17557      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17558      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17559      *   "custom-type-4".
17560      * * customFulfillment5.id, where id is any
17561      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17562      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17563      *   "custom-type-5".
17564      * If this field is set to an invalid value other than these, an
17565      * INVALID_ARGUMENT error is returned.
17566      * </pre>
17567      *
17568      * <code>repeated string variant_rollup_keys = 17;</code>
17569      *
17570      * @param value The variantRollupKeys to add.
17571      * @return This builder for chaining.
17572      */
addVariantRollupKeys(java.lang.String value)17573     public Builder addVariantRollupKeys(java.lang.String value) {
17574       if (value == null) {
17575         throw new NullPointerException();
17576       }
17577       ensureVariantRollupKeysIsMutable();
17578       variantRollupKeys_.add(value);
17579       onChanged();
17580       return this;
17581     }
17582     /**
17583      *
17584      *
17585      * <pre>
17586      * The keys to fetch and rollup the matching
17587      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17588      * [Product][google.cloud.retail.v2.Product]s attributes,
17589      * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
17590      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
17591      * attributes from all the matching
17592      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17593      * [Product][google.cloud.retail.v2.Product]s or
17594      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
17595      * de-duplicated. Notice that rollup attributes will lead to extra query
17596      * latency. Maximum number of keys is 30.
17597      * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
17598      * fulfillment type and a fulfillment ID must be provided in the format of
17599      * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
17600      * "pickupInStore" is fulfillment type and "store123" is the store ID.
17601      * Supported keys are:
17602      * * colorFamilies
17603      * * price
17604      * * originalPrice
17605      * * discount
17606      * * variantId
17607      * * inventory(place_id,price)
17608      * * inventory(place_id,original_price)
17609      * * inventory(place_id,attributes.key), where key is any key in the
17610      *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
17611      *   map.
17612      * * attributes.key, where key is any key in the
17613      *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
17614      * * pickupInStore.id, where id is any
17615      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17616      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17617      *   "pickup-in-store".
17618      * * shipToStore.id, where id is any
17619      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17620      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17621      *   "ship-to-store".
17622      * * sameDayDelivery.id, where id is any
17623      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17624      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17625      *   "same-day-delivery".
17626      * * nextDayDelivery.id, where id is any
17627      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17628      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17629      *   "next-day-delivery".
17630      * * customFulfillment1.id, where id is any
17631      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17632      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17633      *   "custom-type-1".
17634      * * customFulfillment2.id, where id is any
17635      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17636      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17637      *   "custom-type-2".
17638      * * customFulfillment3.id, where id is any
17639      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17640      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17641      *   "custom-type-3".
17642      * * customFulfillment4.id, where id is any
17643      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17644      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17645      *   "custom-type-4".
17646      * * customFulfillment5.id, where id is any
17647      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17648      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17649      *   "custom-type-5".
17650      * If this field is set to an invalid value other than these, an
17651      * INVALID_ARGUMENT error is returned.
17652      * </pre>
17653      *
17654      * <code>repeated string variant_rollup_keys = 17;</code>
17655      *
17656      * @param values The variantRollupKeys to add.
17657      * @return This builder for chaining.
17658      */
addAllVariantRollupKeys(java.lang.Iterable<java.lang.String> values)17659     public Builder addAllVariantRollupKeys(java.lang.Iterable<java.lang.String> values) {
17660       ensureVariantRollupKeysIsMutable();
17661       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, variantRollupKeys_);
17662       onChanged();
17663       return this;
17664     }
17665     /**
17666      *
17667      *
17668      * <pre>
17669      * The keys to fetch and rollup the matching
17670      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17671      * [Product][google.cloud.retail.v2.Product]s attributes,
17672      * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
17673      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
17674      * attributes from all the matching
17675      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17676      * [Product][google.cloud.retail.v2.Product]s or
17677      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
17678      * de-duplicated. Notice that rollup attributes will lead to extra query
17679      * latency. Maximum number of keys is 30.
17680      * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
17681      * fulfillment type and a fulfillment ID must be provided in the format of
17682      * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
17683      * "pickupInStore" is fulfillment type and "store123" is the store ID.
17684      * Supported keys are:
17685      * * colorFamilies
17686      * * price
17687      * * originalPrice
17688      * * discount
17689      * * variantId
17690      * * inventory(place_id,price)
17691      * * inventory(place_id,original_price)
17692      * * inventory(place_id,attributes.key), where key is any key in the
17693      *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
17694      *   map.
17695      * * attributes.key, where key is any key in the
17696      *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
17697      * * pickupInStore.id, where id is any
17698      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17699      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17700      *   "pickup-in-store".
17701      * * shipToStore.id, where id is any
17702      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17703      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17704      *   "ship-to-store".
17705      * * sameDayDelivery.id, where id is any
17706      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17707      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17708      *   "same-day-delivery".
17709      * * nextDayDelivery.id, where id is any
17710      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17711      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17712      *   "next-day-delivery".
17713      * * customFulfillment1.id, where id is any
17714      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17715      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17716      *   "custom-type-1".
17717      * * customFulfillment2.id, where id is any
17718      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17719      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17720      *   "custom-type-2".
17721      * * customFulfillment3.id, where id is any
17722      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17723      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17724      *   "custom-type-3".
17725      * * customFulfillment4.id, where id is any
17726      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17727      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17728      *   "custom-type-4".
17729      * * customFulfillment5.id, where id is any
17730      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17731      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17732      *   "custom-type-5".
17733      * If this field is set to an invalid value other than these, an
17734      * INVALID_ARGUMENT error is returned.
17735      * </pre>
17736      *
17737      * <code>repeated string variant_rollup_keys = 17;</code>
17738      *
17739      * @return This builder for chaining.
17740      */
clearVariantRollupKeys()17741     public Builder clearVariantRollupKeys() {
17742       variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
17743       bitField0_ = (bitField0_ & ~0x00008000);
17744       onChanged();
17745       return this;
17746     }
17747     /**
17748      *
17749      *
17750      * <pre>
17751      * The keys to fetch and rollup the matching
17752      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17753      * [Product][google.cloud.retail.v2.Product]s attributes,
17754      * [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or
17755      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The
17756      * attributes from all the matching
17757      * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
17758      * [Product][google.cloud.retail.v2.Product]s or
17759      * [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and
17760      * de-duplicated. Notice that rollup attributes will lead to extra query
17761      * latency. Maximum number of keys is 30.
17762      * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a
17763      * fulfillment type and a fulfillment ID must be provided in the format of
17764      * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
17765      * "pickupInStore" is fulfillment type and "store123" is the store ID.
17766      * Supported keys are:
17767      * * colorFamilies
17768      * * price
17769      * * originalPrice
17770      * * discount
17771      * * variantId
17772      * * inventory(place_id,price)
17773      * * inventory(place_id,original_price)
17774      * * inventory(place_id,attributes.key), where key is any key in the
17775      *   [Product.local_inventories.attributes][google.cloud.retail.v2.LocalInventory.attributes]
17776      *   map.
17777      * * attributes.key, where key is any key in the
17778      *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
17779      * * pickupInStore.id, where id is any
17780      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17781      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17782      *   "pickup-in-store".
17783      * * shipToStore.id, where id is any
17784      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17785      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17786      *   "ship-to-store".
17787      * * sameDayDelivery.id, where id is any
17788      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17789      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17790      *   "same-day-delivery".
17791      * * nextDayDelivery.id, where id is any
17792      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17793      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17794      *   "next-day-delivery".
17795      * * customFulfillment1.id, where id is any
17796      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17797      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17798      *   "custom-type-1".
17799      * * customFulfillment2.id, where id is any
17800      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17801      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17802      *   "custom-type-2".
17803      * * customFulfillment3.id, where id is any
17804      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17805      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17806      *   "custom-type-3".
17807      * * customFulfillment4.id, where id is any
17808      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17809      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17810      *   "custom-type-4".
17811      * * customFulfillment5.id, where id is any
17812      * [FulfillmentInfo.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
17813      * for [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type]
17814      *   "custom-type-5".
17815      * If this field is set to an invalid value other than these, an
17816      * INVALID_ARGUMENT error is returned.
17817      * </pre>
17818      *
17819      * <code>repeated string variant_rollup_keys = 17;</code>
17820      *
17821      * @param value The bytes of the variantRollupKeys to add.
17822      * @return This builder for chaining.
17823      */
addVariantRollupKeysBytes(com.google.protobuf.ByteString value)17824     public Builder addVariantRollupKeysBytes(com.google.protobuf.ByteString value) {
17825       if (value == null) {
17826         throw new NullPointerException();
17827       }
17828       checkByteStringIsUtf8(value);
17829       ensureVariantRollupKeysIsMutable();
17830       variantRollupKeys_.add(value);
17831       onChanged();
17832       return this;
17833     }
17834 
17835     private com.google.protobuf.LazyStringList pageCategories_ =
17836         com.google.protobuf.LazyStringArrayList.EMPTY;
17837 
ensurePageCategoriesIsMutable()17838     private void ensurePageCategoriesIsMutable() {
17839       if (!((bitField0_ & 0x00010000) != 0)) {
17840         pageCategories_ = new com.google.protobuf.LazyStringArrayList(pageCategories_);
17841         bitField0_ |= 0x00010000;
17842       }
17843     }
17844     /**
17845      *
17846      *
17847      * <pre>
17848      * The categories associated with a category page. Required for category
17849      * navigation queries to achieve good search quality. The format should be
17850      * the same as
17851      * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
17852      * To represent full path of category, use '&gt;' sign to separate different
17853      * hierarchies. If '&gt;' is part of the category name, replace it with
17854      * other character(s).
17855      * Category pages include special pages such as sales or promotions. For
17856      * instance, a special sale page may have the category hierarchy:
17857      * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
17858      * </pre>
17859      *
17860      * <code>repeated string page_categories = 23;</code>
17861      *
17862      * @return A list containing the pageCategories.
17863      */
getPageCategoriesList()17864     public com.google.protobuf.ProtocolStringList getPageCategoriesList() {
17865       return pageCategories_.getUnmodifiableView();
17866     }
17867     /**
17868      *
17869      *
17870      * <pre>
17871      * The categories associated with a category page. Required for category
17872      * navigation queries to achieve good search quality. The format should be
17873      * the same as
17874      * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
17875      * To represent full path of category, use '&gt;' sign to separate different
17876      * hierarchies. If '&gt;' is part of the category name, replace it with
17877      * other character(s).
17878      * Category pages include special pages such as sales or promotions. For
17879      * instance, a special sale page may have the category hierarchy:
17880      * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
17881      * </pre>
17882      *
17883      * <code>repeated string page_categories = 23;</code>
17884      *
17885      * @return The count of pageCategories.
17886      */
getPageCategoriesCount()17887     public int getPageCategoriesCount() {
17888       return pageCategories_.size();
17889     }
17890     /**
17891      *
17892      *
17893      * <pre>
17894      * The categories associated with a category page. Required for category
17895      * navigation queries to achieve good search quality. The format should be
17896      * the same as
17897      * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
17898      * To represent full path of category, use '&gt;' sign to separate different
17899      * hierarchies. If '&gt;' is part of the category name, replace it with
17900      * other character(s).
17901      * Category pages include special pages such as sales or promotions. For
17902      * instance, a special sale page may have the category hierarchy:
17903      * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
17904      * </pre>
17905      *
17906      * <code>repeated string page_categories = 23;</code>
17907      *
17908      * @param index The index of the element to return.
17909      * @return The pageCategories at the given index.
17910      */
getPageCategories(int index)17911     public java.lang.String getPageCategories(int index) {
17912       return pageCategories_.get(index);
17913     }
17914     /**
17915      *
17916      *
17917      * <pre>
17918      * The categories associated with a category page. Required for category
17919      * navigation queries to achieve good search quality. The format should be
17920      * the same as
17921      * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
17922      * To represent full path of category, use '&gt;' sign to separate different
17923      * hierarchies. If '&gt;' is part of the category name, replace it with
17924      * other character(s).
17925      * Category pages include special pages such as sales or promotions. For
17926      * instance, a special sale page may have the category hierarchy:
17927      * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
17928      * </pre>
17929      *
17930      * <code>repeated string page_categories = 23;</code>
17931      *
17932      * @param index The index of the value to return.
17933      * @return The bytes of the pageCategories at the given index.
17934      */
getPageCategoriesBytes(int index)17935     public com.google.protobuf.ByteString getPageCategoriesBytes(int index) {
17936       return pageCategories_.getByteString(index);
17937     }
17938     /**
17939      *
17940      *
17941      * <pre>
17942      * The categories associated with a category page. Required for category
17943      * navigation queries to achieve good search quality. The format should be
17944      * the same as
17945      * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
17946      * To represent full path of category, use '&gt;' sign to separate different
17947      * hierarchies. If '&gt;' is part of the category name, replace it with
17948      * other character(s).
17949      * Category pages include special pages such as sales or promotions. For
17950      * instance, a special sale page may have the category hierarchy:
17951      * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
17952      * </pre>
17953      *
17954      * <code>repeated string page_categories = 23;</code>
17955      *
17956      * @param index The index to set the value at.
17957      * @param value The pageCategories to set.
17958      * @return This builder for chaining.
17959      */
setPageCategories(int index, java.lang.String value)17960     public Builder setPageCategories(int index, java.lang.String value) {
17961       if (value == null) {
17962         throw new NullPointerException();
17963       }
17964       ensurePageCategoriesIsMutable();
17965       pageCategories_.set(index, value);
17966       onChanged();
17967       return this;
17968     }
17969     /**
17970      *
17971      *
17972      * <pre>
17973      * The categories associated with a category page. Required for category
17974      * navigation queries to achieve good search quality. The format should be
17975      * the same as
17976      * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
17977      * To represent full path of category, use '&gt;' sign to separate different
17978      * hierarchies. If '&gt;' is part of the category name, replace it with
17979      * other character(s).
17980      * Category pages include special pages such as sales or promotions. For
17981      * instance, a special sale page may have the category hierarchy:
17982      * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
17983      * </pre>
17984      *
17985      * <code>repeated string page_categories = 23;</code>
17986      *
17987      * @param value The pageCategories to add.
17988      * @return This builder for chaining.
17989      */
addPageCategories(java.lang.String value)17990     public Builder addPageCategories(java.lang.String value) {
17991       if (value == null) {
17992         throw new NullPointerException();
17993       }
17994       ensurePageCategoriesIsMutable();
17995       pageCategories_.add(value);
17996       onChanged();
17997       return this;
17998     }
17999     /**
18000      *
18001      *
18002      * <pre>
18003      * The categories associated with a category page. Required for category
18004      * navigation queries to achieve good search quality. The format should be
18005      * the same as
18006      * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
18007      * To represent full path of category, use '&gt;' sign to separate different
18008      * hierarchies. If '&gt;' is part of the category name, replace it with
18009      * other character(s).
18010      * Category pages include special pages such as sales or promotions. For
18011      * instance, a special sale page may have the category hierarchy:
18012      * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
18013      * </pre>
18014      *
18015      * <code>repeated string page_categories = 23;</code>
18016      *
18017      * @param values The pageCategories to add.
18018      * @return This builder for chaining.
18019      */
addAllPageCategories(java.lang.Iterable<java.lang.String> values)18020     public Builder addAllPageCategories(java.lang.Iterable<java.lang.String> values) {
18021       ensurePageCategoriesIsMutable();
18022       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pageCategories_);
18023       onChanged();
18024       return this;
18025     }
18026     /**
18027      *
18028      *
18029      * <pre>
18030      * The categories associated with a category page. Required for category
18031      * navigation queries to achieve good search quality. The format should be
18032      * the same as
18033      * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
18034      * To represent full path of category, use '&gt;' sign to separate different
18035      * hierarchies. If '&gt;' is part of the category name, replace it with
18036      * other character(s).
18037      * Category pages include special pages such as sales or promotions. For
18038      * instance, a special sale page may have the category hierarchy:
18039      * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
18040      * </pre>
18041      *
18042      * <code>repeated string page_categories = 23;</code>
18043      *
18044      * @return This builder for chaining.
18045      */
clearPageCategories()18046     public Builder clearPageCategories() {
18047       pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY;
18048       bitField0_ = (bitField0_ & ~0x00010000);
18049       onChanged();
18050       return this;
18051     }
18052     /**
18053      *
18054      *
18055      * <pre>
18056      * The categories associated with a category page. Required for category
18057      * navigation queries to achieve good search quality. The format should be
18058      * the same as
18059      * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
18060      * To represent full path of category, use '&gt;' sign to separate different
18061      * hierarchies. If '&gt;' is part of the category name, replace it with
18062      * other character(s).
18063      * Category pages include special pages such as sales or promotions. For
18064      * instance, a special sale page may have the category hierarchy:
18065      * "pageCategories" : ["Sales &gt; 2017 Black Friday Deals"].
18066      * </pre>
18067      *
18068      * <code>repeated string page_categories = 23;</code>
18069      *
18070      * @param value The bytes of the pageCategories to add.
18071      * @return This builder for chaining.
18072      */
addPageCategoriesBytes(com.google.protobuf.ByteString value)18073     public Builder addPageCategoriesBytes(com.google.protobuf.ByteString value) {
18074       if (value == null) {
18075         throw new NullPointerException();
18076       }
18077       checkByteStringIsUtf8(value);
18078       ensurePageCategoriesIsMutable();
18079       pageCategories_.add(value);
18080       onChanged();
18081       return this;
18082     }
18083 
18084     private int searchMode_ = 0;
18085     /**
18086      *
18087      *
18088      * <pre>
18089      * The search mode of the search request. If not specified, a single search
18090      * request triggers both product search and faceted search.
18091      * </pre>
18092      *
18093      * <code>.google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31;</code>
18094      *
18095      * @return The enum numeric value on the wire for searchMode.
18096      */
18097     @java.lang.Override
getSearchModeValue()18098     public int getSearchModeValue() {
18099       return searchMode_;
18100     }
18101     /**
18102      *
18103      *
18104      * <pre>
18105      * The search mode of the search request. If not specified, a single search
18106      * request triggers both product search and faceted search.
18107      * </pre>
18108      *
18109      * <code>.google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31;</code>
18110      *
18111      * @param value The enum numeric value on the wire for searchMode to set.
18112      * @return This builder for chaining.
18113      */
setSearchModeValue(int value)18114     public Builder setSearchModeValue(int value) {
18115       searchMode_ = value;
18116       bitField0_ |= 0x00020000;
18117       onChanged();
18118       return this;
18119     }
18120     /**
18121      *
18122      *
18123      * <pre>
18124      * The search mode of the search request. If not specified, a single search
18125      * request triggers both product search and faceted search.
18126      * </pre>
18127      *
18128      * <code>.google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31;</code>
18129      *
18130      * @return The searchMode.
18131      */
18132     @java.lang.Override
getSearchMode()18133     public com.google.cloud.retail.v2.SearchRequest.SearchMode getSearchMode() {
18134       com.google.cloud.retail.v2.SearchRequest.SearchMode result =
18135           com.google.cloud.retail.v2.SearchRequest.SearchMode.forNumber(searchMode_);
18136       return result == null
18137           ? com.google.cloud.retail.v2.SearchRequest.SearchMode.UNRECOGNIZED
18138           : result;
18139     }
18140     /**
18141      *
18142      *
18143      * <pre>
18144      * The search mode of the search request. If not specified, a single search
18145      * request triggers both product search and faceted search.
18146      * </pre>
18147      *
18148      * <code>.google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31;</code>
18149      *
18150      * @param value The searchMode to set.
18151      * @return This builder for chaining.
18152      */
setSearchMode(com.google.cloud.retail.v2.SearchRequest.SearchMode value)18153     public Builder setSearchMode(com.google.cloud.retail.v2.SearchRequest.SearchMode value) {
18154       if (value == null) {
18155         throw new NullPointerException();
18156       }
18157       bitField0_ |= 0x00020000;
18158       searchMode_ = value.getNumber();
18159       onChanged();
18160       return this;
18161     }
18162     /**
18163      *
18164      *
18165      * <pre>
18166      * The search mode of the search request. If not specified, a single search
18167      * request triggers both product search and faceted search.
18168      * </pre>
18169      *
18170      * <code>.google.cloud.retail.v2.SearchRequest.SearchMode search_mode = 31;</code>
18171      *
18172      * @return This builder for chaining.
18173      */
clearSearchMode()18174     public Builder clearSearchMode() {
18175       bitField0_ = (bitField0_ & ~0x00020000);
18176       searchMode_ = 0;
18177       onChanged();
18178       return this;
18179     }
18180 
18181     private com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalizationSpec_;
18182     private com.google.protobuf.SingleFieldBuilderV3<
18183             com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec,
18184             com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Builder,
18185             com.google.cloud.retail.v2.SearchRequest.PersonalizationSpecOrBuilder>
18186         personalizationSpecBuilder_;
18187     /**
18188      *
18189      *
18190      * <pre>
18191      * The specification for personalization.
18192      * Notice that if both
18193      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
18194      * and
18195      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18196      * are set.
18197      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18198      * will override
18199      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
18200      * </pre>
18201      *
18202      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
18203      * </code>
18204      *
18205      * @return Whether the personalizationSpec field is set.
18206      */
hasPersonalizationSpec()18207     public boolean hasPersonalizationSpec() {
18208       return ((bitField0_ & 0x00040000) != 0);
18209     }
18210     /**
18211      *
18212      *
18213      * <pre>
18214      * The specification for personalization.
18215      * Notice that if both
18216      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
18217      * and
18218      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18219      * are set.
18220      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18221      * will override
18222      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
18223      * </pre>
18224      *
18225      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
18226      * </code>
18227      *
18228      * @return The personalizationSpec.
18229      */
getPersonalizationSpec()18230     public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec getPersonalizationSpec() {
18231       if (personalizationSpecBuilder_ == null) {
18232         return personalizationSpec_ == null
18233             ? com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.getDefaultInstance()
18234             : personalizationSpec_;
18235       } else {
18236         return personalizationSpecBuilder_.getMessage();
18237       }
18238     }
18239     /**
18240      *
18241      *
18242      * <pre>
18243      * The specification for personalization.
18244      * Notice that if both
18245      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
18246      * and
18247      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18248      * are set.
18249      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18250      * will override
18251      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
18252      * </pre>
18253      *
18254      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
18255      * </code>
18256      */
setPersonalizationSpec( com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec value)18257     public Builder setPersonalizationSpec(
18258         com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec value) {
18259       if (personalizationSpecBuilder_ == null) {
18260         if (value == null) {
18261           throw new NullPointerException();
18262         }
18263         personalizationSpec_ = value;
18264       } else {
18265         personalizationSpecBuilder_.setMessage(value);
18266       }
18267       bitField0_ |= 0x00040000;
18268       onChanged();
18269       return this;
18270     }
18271     /**
18272      *
18273      *
18274      * <pre>
18275      * The specification for personalization.
18276      * Notice that if both
18277      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
18278      * and
18279      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18280      * are set.
18281      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18282      * will override
18283      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
18284      * </pre>
18285      *
18286      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
18287      * </code>
18288      */
setPersonalizationSpec( com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Builder builderForValue)18289     public Builder setPersonalizationSpec(
18290         com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Builder builderForValue) {
18291       if (personalizationSpecBuilder_ == null) {
18292         personalizationSpec_ = builderForValue.build();
18293       } else {
18294         personalizationSpecBuilder_.setMessage(builderForValue.build());
18295       }
18296       bitField0_ |= 0x00040000;
18297       onChanged();
18298       return this;
18299     }
18300     /**
18301      *
18302      *
18303      * <pre>
18304      * The specification for personalization.
18305      * Notice that if both
18306      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
18307      * and
18308      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18309      * are set.
18310      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18311      * will override
18312      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
18313      * </pre>
18314      *
18315      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
18316      * </code>
18317      */
mergePersonalizationSpec( com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec value)18318     public Builder mergePersonalizationSpec(
18319         com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec value) {
18320       if (personalizationSpecBuilder_ == null) {
18321         if (((bitField0_ & 0x00040000) != 0)
18322             && personalizationSpec_ != null
18323             && personalizationSpec_
18324                 != com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec
18325                     .getDefaultInstance()) {
18326           getPersonalizationSpecBuilder().mergeFrom(value);
18327         } else {
18328           personalizationSpec_ = value;
18329         }
18330       } else {
18331         personalizationSpecBuilder_.mergeFrom(value);
18332       }
18333       bitField0_ |= 0x00040000;
18334       onChanged();
18335       return this;
18336     }
18337     /**
18338      *
18339      *
18340      * <pre>
18341      * The specification for personalization.
18342      * Notice that if both
18343      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
18344      * and
18345      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18346      * are set.
18347      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18348      * will override
18349      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
18350      * </pre>
18351      *
18352      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
18353      * </code>
18354      */
clearPersonalizationSpec()18355     public Builder clearPersonalizationSpec() {
18356       bitField0_ = (bitField0_ & ~0x00040000);
18357       personalizationSpec_ = null;
18358       if (personalizationSpecBuilder_ != null) {
18359         personalizationSpecBuilder_.dispose();
18360         personalizationSpecBuilder_ = null;
18361       }
18362       onChanged();
18363       return this;
18364     }
18365     /**
18366      *
18367      *
18368      * <pre>
18369      * The specification for personalization.
18370      * Notice that if both
18371      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
18372      * and
18373      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18374      * are set.
18375      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18376      * will override
18377      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
18378      * </pre>
18379      *
18380      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
18381      * </code>
18382      */
18383     public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Builder
getPersonalizationSpecBuilder()18384         getPersonalizationSpecBuilder() {
18385       bitField0_ |= 0x00040000;
18386       onChanged();
18387       return getPersonalizationSpecFieldBuilder().getBuilder();
18388     }
18389     /**
18390      *
18391      *
18392      * <pre>
18393      * The specification for personalization.
18394      * Notice that if both
18395      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
18396      * and
18397      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18398      * are set.
18399      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18400      * will override
18401      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
18402      * </pre>
18403      *
18404      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
18405      * </code>
18406      */
18407     public com.google.cloud.retail.v2.SearchRequest.PersonalizationSpecOrBuilder
getPersonalizationSpecOrBuilder()18408         getPersonalizationSpecOrBuilder() {
18409       if (personalizationSpecBuilder_ != null) {
18410         return personalizationSpecBuilder_.getMessageOrBuilder();
18411       } else {
18412         return personalizationSpec_ == null
18413             ? com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.getDefaultInstance()
18414             : personalizationSpec_;
18415       }
18416     }
18417     /**
18418      *
18419      *
18420      * <pre>
18421      * The specification for personalization.
18422      * Notice that if both
18423      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
18424      * and
18425      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18426      * are set.
18427      * [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
18428      * will override
18429      * [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
18430      * </pre>
18431      *
18432      * <code>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 32;
18433      * </code>
18434      */
18435     private com.google.protobuf.SingleFieldBuilderV3<
18436             com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec,
18437             com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Builder,
18438             com.google.cloud.retail.v2.SearchRequest.PersonalizationSpecOrBuilder>
getPersonalizationSpecFieldBuilder()18439         getPersonalizationSpecFieldBuilder() {
18440       if (personalizationSpecBuilder_ == null) {
18441         personalizationSpecBuilder_ =
18442             new com.google.protobuf.SingleFieldBuilderV3<
18443                 com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec,
18444                 com.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Builder,
18445                 com.google.cloud.retail.v2.SearchRequest.PersonalizationSpecOrBuilder>(
18446                 getPersonalizationSpec(), getParentForChildren(), isClean());
18447         personalizationSpec_ = null;
18448       }
18449       return personalizationSpecBuilder_;
18450     }
18451 
18452     private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;
18453 
internalGetLabels()18454     private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
18455       if (labels_ == null) {
18456         return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
18457       }
18458       return labels_;
18459     }
18460 
18461     private com.google.protobuf.MapField<java.lang.String, java.lang.String>
internalGetMutableLabels()18462         internalGetMutableLabels() {
18463       if (labels_ == null) {
18464         labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry);
18465       }
18466       if (!labels_.isMutable()) {
18467         labels_ = labels_.copy();
18468       }
18469       bitField0_ |= 0x00080000;
18470       onChanged();
18471       return labels_;
18472     }
18473 
getLabelsCount()18474     public int getLabelsCount() {
18475       return internalGetLabels().getMap().size();
18476     }
18477     /**
18478      *
18479      *
18480      * <pre>
18481      * The labels applied to a resource must meet the following requirements:
18482      * * Each resource can have multiple labels, up to a maximum of 64.
18483      * * Each label must be a key-value pair.
18484      * * Keys have a minimum length of 1 character and a maximum length of 63
18485      *   characters and cannot be empty. Values can be empty and have a maximum
18486      *   length of 63 characters.
18487      * * Keys and values can contain only lowercase letters, numeric characters,
18488      *   underscores, and dashes. All characters must use UTF-8 encoding, and
18489      *   international characters are allowed.
18490      * * The key portion of a label must be unique. However, you can use the same
18491      *   key with multiple resources.
18492      * * Keys must start with a lowercase letter or international character.
18493      * See [Google Cloud
18494      * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
18495      * for more details.
18496      * </pre>
18497      *
18498      * <code>map&lt;string, string&gt; labels = 34;</code>
18499      */
18500     @java.lang.Override
containsLabels(java.lang.String key)18501     public boolean containsLabels(java.lang.String key) {
18502       if (key == null) {
18503         throw new NullPointerException("map key");
18504       }
18505       return internalGetLabels().getMap().containsKey(key);
18506     }
18507     /** Use {@link #getLabelsMap()} instead. */
18508     @java.lang.Override
18509     @java.lang.Deprecated
getLabels()18510     public java.util.Map<java.lang.String, java.lang.String> getLabels() {
18511       return getLabelsMap();
18512     }
18513     /**
18514      *
18515      *
18516      * <pre>
18517      * The labels applied to a resource must meet the following requirements:
18518      * * Each resource can have multiple labels, up to a maximum of 64.
18519      * * Each label must be a key-value pair.
18520      * * Keys have a minimum length of 1 character and a maximum length of 63
18521      *   characters and cannot be empty. Values can be empty and have a maximum
18522      *   length of 63 characters.
18523      * * Keys and values can contain only lowercase letters, numeric characters,
18524      *   underscores, and dashes. All characters must use UTF-8 encoding, and
18525      *   international characters are allowed.
18526      * * The key portion of a label must be unique. However, you can use the same
18527      *   key with multiple resources.
18528      * * Keys must start with a lowercase letter or international character.
18529      * See [Google Cloud
18530      * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
18531      * for more details.
18532      * </pre>
18533      *
18534      * <code>map&lt;string, string&gt; labels = 34;</code>
18535      */
18536     @java.lang.Override
getLabelsMap()18537     public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
18538       return internalGetLabels().getMap();
18539     }
18540     /**
18541      *
18542      *
18543      * <pre>
18544      * The labels applied to a resource must meet the following requirements:
18545      * * Each resource can have multiple labels, up to a maximum of 64.
18546      * * Each label must be a key-value pair.
18547      * * Keys have a minimum length of 1 character and a maximum length of 63
18548      *   characters and cannot be empty. Values can be empty and have a maximum
18549      *   length of 63 characters.
18550      * * Keys and values can contain only lowercase letters, numeric characters,
18551      *   underscores, and dashes. All characters must use UTF-8 encoding, and
18552      *   international characters are allowed.
18553      * * The key portion of a label must be unique. However, you can use the same
18554      *   key with multiple resources.
18555      * * Keys must start with a lowercase letter or international character.
18556      * See [Google Cloud
18557      * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
18558      * for more details.
18559      * </pre>
18560      *
18561      * <code>map&lt;string, string&gt; labels = 34;</code>
18562      */
18563     @java.lang.Override
getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue)18564     public /* nullable */ java.lang.String getLabelsOrDefault(
18565         java.lang.String key,
18566         /* nullable */
18567         java.lang.String defaultValue) {
18568       if (key == null) {
18569         throw new NullPointerException("map key");
18570       }
18571       java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
18572       return map.containsKey(key) ? map.get(key) : defaultValue;
18573     }
18574     /**
18575      *
18576      *
18577      * <pre>
18578      * The labels applied to a resource must meet the following requirements:
18579      * * Each resource can have multiple labels, up to a maximum of 64.
18580      * * Each label must be a key-value pair.
18581      * * Keys have a minimum length of 1 character and a maximum length of 63
18582      *   characters and cannot be empty. Values can be empty and have a maximum
18583      *   length of 63 characters.
18584      * * Keys and values can contain only lowercase letters, numeric characters,
18585      *   underscores, and dashes. All characters must use UTF-8 encoding, and
18586      *   international characters are allowed.
18587      * * The key portion of a label must be unique. However, you can use the same
18588      *   key with multiple resources.
18589      * * Keys must start with a lowercase letter or international character.
18590      * See [Google Cloud
18591      * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
18592      * for more details.
18593      * </pre>
18594      *
18595      * <code>map&lt;string, string&gt; labels = 34;</code>
18596      */
18597     @java.lang.Override
getLabelsOrThrow(java.lang.String key)18598     public java.lang.String getLabelsOrThrow(java.lang.String key) {
18599       if (key == null) {
18600         throw new NullPointerException("map key");
18601       }
18602       java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
18603       if (!map.containsKey(key)) {
18604         throw new java.lang.IllegalArgumentException();
18605       }
18606       return map.get(key);
18607     }
18608 
clearLabels()18609     public Builder clearLabels() {
18610       bitField0_ = (bitField0_ & ~0x00080000);
18611       internalGetMutableLabels().getMutableMap().clear();
18612       return this;
18613     }
18614     /**
18615      *
18616      *
18617      * <pre>
18618      * The labels applied to a resource must meet the following requirements:
18619      * * Each resource can have multiple labels, up to a maximum of 64.
18620      * * Each label must be a key-value pair.
18621      * * Keys have a minimum length of 1 character and a maximum length of 63
18622      *   characters and cannot be empty. Values can be empty and have a maximum
18623      *   length of 63 characters.
18624      * * Keys and values can contain only lowercase letters, numeric characters,
18625      *   underscores, and dashes. All characters must use UTF-8 encoding, and
18626      *   international characters are allowed.
18627      * * The key portion of a label must be unique. However, you can use the same
18628      *   key with multiple resources.
18629      * * Keys must start with a lowercase letter or international character.
18630      * See [Google Cloud
18631      * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
18632      * for more details.
18633      * </pre>
18634      *
18635      * <code>map&lt;string, string&gt; labels = 34;</code>
18636      */
removeLabels(java.lang.String key)18637     public Builder removeLabels(java.lang.String key) {
18638       if (key == null) {
18639         throw new NullPointerException("map key");
18640       }
18641       internalGetMutableLabels().getMutableMap().remove(key);
18642       return this;
18643     }
18644     /** Use alternate mutation accessors instead. */
18645     @java.lang.Deprecated
getMutableLabels()18646     public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() {
18647       bitField0_ |= 0x00080000;
18648       return internalGetMutableLabels().getMutableMap();
18649     }
18650     /**
18651      *
18652      *
18653      * <pre>
18654      * The labels applied to a resource must meet the following requirements:
18655      * * Each resource can have multiple labels, up to a maximum of 64.
18656      * * Each label must be a key-value pair.
18657      * * Keys have a minimum length of 1 character and a maximum length of 63
18658      *   characters and cannot be empty. Values can be empty and have a maximum
18659      *   length of 63 characters.
18660      * * Keys and values can contain only lowercase letters, numeric characters,
18661      *   underscores, and dashes. All characters must use UTF-8 encoding, and
18662      *   international characters are allowed.
18663      * * The key portion of a label must be unique. However, you can use the same
18664      *   key with multiple resources.
18665      * * Keys must start with a lowercase letter or international character.
18666      * See [Google Cloud
18667      * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
18668      * for more details.
18669      * </pre>
18670      *
18671      * <code>map&lt;string, string&gt; labels = 34;</code>
18672      */
putLabels(java.lang.String key, java.lang.String value)18673     public Builder putLabels(java.lang.String key, java.lang.String value) {
18674       if (key == null) {
18675         throw new NullPointerException("map key");
18676       }
18677       if (value == null) {
18678         throw new NullPointerException("map value");
18679       }
18680       internalGetMutableLabels().getMutableMap().put(key, value);
18681       bitField0_ |= 0x00080000;
18682       return this;
18683     }
18684     /**
18685      *
18686      *
18687      * <pre>
18688      * The labels applied to a resource must meet the following requirements:
18689      * * Each resource can have multiple labels, up to a maximum of 64.
18690      * * Each label must be a key-value pair.
18691      * * Keys have a minimum length of 1 character and a maximum length of 63
18692      *   characters and cannot be empty. Values can be empty and have a maximum
18693      *   length of 63 characters.
18694      * * Keys and values can contain only lowercase letters, numeric characters,
18695      *   underscores, and dashes. All characters must use UTF-8 encoding, and
18696      *   international characters are allowed.
18697      * * The key portion of a label must be unique. However, you can use the same
18698      *   key with multiple resources.
18699      * * Keys must start with a lowercase letter or international character.
18700      * See [Google Cloud
18701      * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
18702      * for more details.
18703      * </pre>
18704      *
18705      * <code>map&lt;string, string&gt; labels = 34;</code>
18706      */
putAllLabels(java.util.Map<java.lang.String, java.lang.String> values)18707     public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) {
18708       internalGetMutableLabels().getMutableMap().putAll(values);
18709       bitField0_ |= 0x00080000;
18710       return this;
18711     }
18712 
18713     private com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spellCorrectionSpec_;
18714     private com.google.protobuf.SingleFieldBuilderV3<
18715             com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec,
18716             com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Builder,
18717             com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpecOrBuilder>
18718         spellCorrectionSpecBuilder_;
18719     /**
18720      *
18721      *
18722      * <pre>
18723      * The spell correction specification that specifies the mode under
18724      * which spell correction will take effect.
18725      * </pre>
18726      *
18727      * <code>
18728      * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
18729      * </code>
18730      *
18731      * @return Whether the spellCorrectionSpec field is set.
18732      */
hasSpellCorrectionSpec()18733     public boolean hasSpellCorrectionSpec() {
18734       return ((bitField0_ & 0x00100000) != 0);
18735     }
18736     /**
18737      *
18738      *
18739      * <pre>
18740      * The spell correction specification that specifies the mode under
18741      * which spell correction will take effect.
18742      * </pre>
18743      *
18744      * <code>
18745      * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
18746      * </code>
18747      *
18748      * @return The spellCorrectionSpec.
18749      */
getSpellCorrectionSpec()18750     public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec getSpellCorrectionSpec() {
18751       if (spellCorrectionSpecBuilder_ == null) {
18752         return spellCorrectionSpec_ == null
18753             ? com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.getDefaultInstance()
18754             : spellCorrectionSpec_;
18755       } else {
18756         return spellCorrectionSpecBuilder_.getMessage();
18757       }
18758     }
18759     /**
18760      *
18761      *
18762      * <pre>
18763      * The spell correction specification that specifies the mode under
18764      * which spell correction will take effect.
18765      * </pre>
18766      *
18767      * <code>
18768      * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
18769      * </code>
18770      */
setSpellCorrectionSpec( com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec value)18771     public Builder setSpellCorrectionSpec(
18772         com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec value) {
18773       if (spellCorrectionSpecBuilder_ == null) {
18774         if (value == null) {
18775           throw new NullPointerException();
18776         }
18777         spellCorrectionSpec_ = value;
18778       } else {
18779         spellCorrectionSpecBuilder_.setMessage(value);
18780       }
18781       bitField0_ |= 0x00100000;
18782       onChanged();
18783       return this;
18784     }
18785     /**
18786      *
18787      *
18788      * <pre>
18789      * The spell correction specification that specifies the mode under
18790      * which spell correction will take effect.
18791      * </pre>
18792      *
18793      * <code>
18794      * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
18795      * </code>
18796      */
setSpellCorrectionSpec( com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Builder builderForValue)18797     public Builder setSpellCorrectionSpec(
18798         com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Builder builderForValue) {
18799       if (spellCorrectionSpecBuilder_ == null) {
18800         spellCorrectionSpec_ = builderForValue.build();
18801       } else {
18802         spellCorrectionSpecBuilder_.setMessage(builderForValue.build());
18803       }
18804       bitField0_ |= 0x00100000;
18805       onChanged();
18806       return this;
18807     }
18808     /**
18809      *
18810      *
18811      * <pre>
18812      * The spell correction specification that specifies the mode under
18813      * which spell correction will take effect.
18814      * </pre>
18815      *
18816      * <code>
18817      * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
18818      * </code>
18819      */
mergeSpellCorrectionSpec( com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec value)18820     public Builder mergeSpellCorrectionSpec(
18821         com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec value) {
18822       if (spellCorrectionSpecBuilder_ == null) {
18823         if (((bitField0_ & 0x00100000) != 0)
18824             && spellCorrectionSpec_ != null
18825             && spellCorrectionSpec_
18826                 != com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec
18827                     .getDefaultInstance()) {
18828           getSpellCorrectionSpecBuilder().mergeFrom(value);
18829         } else {
18830           spellCorrectionSpec_ = value;
18831         }
18832       } else {
18833         spellCorrectionSpecBuilder_.mergeFrom(value);
18834       }
18835       bitField0_ |= 0x00100000;
18836       onChanged();
18837       return this;
18838     }
18839     /**
18840      *
18841      *
18842      * <pre>
18843      * The spell correction specification that specifies the mode under
18844      * which spell correction will take effect.
18845      * </pre>
18846      *
18847      * <code>
18848      * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
18849      * </code>
18850      */
clearSpellCorrectionSpec()18851     public Builder clearSpellCorrectionSpec() {
18852       bitField0_ = (bitField0_ & ~0x00100000);
18853       spellCorrectionSpec_ = null;
18854       if (spellCorrectionSpecBuilder_ != null) {
18855         spellCorrectionSpecBuilder_.dispose();
18856         spellCorrectionSpecBuilder_ = null;
18857       }
18858       onChanged();
18859       return this;
18860     }
18861     /**
18862      *
18863      *
18864      * <pre>
18865      * The spell correction specification that specifies the mode under
18866      * which spell correction will take effect.
18867      * </pre>
18868      *
18869      * <code>
18870      * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
18871      * </code>
18872      */
18873     public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Builder
getSpellCorrectionSpecBuilder()18874         getSpellCorrectionSpecBuilder() {
18875       bitField0_ |= 0x00100000;
18876       onChanged();
18877       return getSpellCorrectionSpecFieldBuilder().getBuilder();
18878     }
18879     /**
18880      *
18881      *
18882      * <pre>
18883      * The spell correction specification that specifies the mode under
18884      * which spell correction will take effect.
18885      * </pre>
18886      *
18887      * <code>
18888      * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
18889      * </code>
18890      */
18891     public com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpecOrBuilder
getSpellCorrectionSpecOrBuilder()18892         getSpellCorrectionSpecOrBuilder() {
18893       if (spellCorrectionSpecBuilder_ != null) {
18894         return spellCorrectionSpecBuilder_.getMessageOrBuilder();
18895       } else {
18896         return spellCorrectionSpec_ == null
18897             ? com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.getDefaultInstance()
18898             : spellCorrectionSpec_;
18899       }
18900     }
18901     /**
18902      *
18903      *
18904      * <pre>
18905      * The spell correction specification that specifies the mode under
18906      * which spell correction will take effect.
18907      * </pre>
18908      *
18909      * <code>
18910      * optional .google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec spell_correction_spec = 35;
18911      * </code>
18912      */
18913     private com.google.protobuf.SingleFieldBuilderV3<
18914             com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec,
18915             com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Builder,
18916             com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpecOrBuilder>
getSpellCorrectionSpecFieldBuilder()18917         getSpellCorrectionSpecFieldBuilder() {
18918       if (spellCorrectionSpecBuilder_ == null) {
18919         spellCorrectionSpecBuilder_ =
18920             new com.google.protobuf.SingleFieldBuilderV3<
18921                 com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec,
18922                 com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Builder,
18923                 com.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpecOrBuilder>(
18924                 getSpellCorrectionSpec(), getParentForChildren(), isClean());
18925         spellCorrectionSpec_ = null;
18926       }
18927       return spellCorrectionSpecBuilder_;
18928     }
18929 
18930     private java.lang.Object entity_ = "";
18931     /**
18932      *
18933      *
18934      * <pre>
18935      * The entity for customers that may run multiple different entities, domains,
18936      * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`,
18937      * `google.com`, `youtube.com`, etc.
18938      * If this is set, it should be exactly matched with
18939      * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search
18940      * results boosted by entity.
18941      * </pre>
18942      *
18943      * <code>string entity = 38;</code>
18944      *
18945      * @return The entity.
18946      */
getEntity()18947     public java.lang.String getEntity() {
18948       java.lang.Object ref = entity_;
18949       if (!(ref instanceof java.lang.String)) {
18950         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
18951         java.lang.String s = bs.toStringUtf8();
18952         entity_ = s;
18953         return s;
18954       } else {
18955         return (java.lang.String) ref;
18956       }
18957     }
18958     /**
18959      *
18960      *
18961      * <pre>
18962      * The entity for customers that may run multiple different entities, domains,
18963      * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`,
18964      * `google.com`, `youtube.com`, etc.
18965      * If this is set, it should be exactly matched with
18966      * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search
18967      * results boosted by entity.
18968      * </pre>
18969      *
18970      * <code>string entity = 38;</code>
18971      *
18972      * @return The bytes for entity.
18973      */
getEntityBytes()18974     public com.google.protobuf.ByteString getEntityBytes() {
18975       java.lang.Object ref = entity_;
18976       if (ref instanceof String) {
18977         com.google.protobuf.ByteString b =
18978             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
18979         entity_ = b;
18980         return b;
18981       } else {
18982         return (com.google.protobuf.ByteString) ref;
18983       }
18984     }
18985     /**
18986      *
18987      *
18988      * <pre>
18989      * The entity for customers that may run multiple different entities, domains,
18990      * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`,
18991      * `google.com`, `youtube.com`, etc.
18992      * If this is set, it should be exactly matched with
18993      * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search
18994      * results boosted by entity.
18995      * </pre>
18996      *
18997      * <code>string entity = 38;</code>
18998      *
18999      * @param value The entity to set.
19000      * @return This builder for chaining.
19001      */
setEntity(java.lang.String value)19002     public Builder setEntity(java.lang.String value) {
19003       if (value == null) {
19004         throw new NullPointerException();
19005       }
19006       entity_ = value;
19007       bitField0_ |= 0x00200000;
19008       onChanged();
19009       return this;
19010     }
19011     /**
19012      *
19013      *
19014      * <pre>
19015      * The entity for customers that may run multiple different entities, domains,
19016      * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`,
19017      * `google.com`, `youtube.com`, etc.
19018      * If this is set, it should be exactly matched with
19019      * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search
19020      * results boosted by entity.
19021      * </pre>
19022      *
19023      * <code>string entity = 38;</code>
19024      *
19025      * @return This builder for chaining.
19026      */
clearEntity()19027     public Builder clearEntity() {
19028       entity_ = getDefaultInstance().getEntity();
19029       bitField0_ = (bitField0_ & ~0x00200000);
19030       onChanged();
19031       return this;
19032     }
19033     /**
19034      *
19035      *
19036      * <pre>
19037      * The entity for customers that may run multiple different entities, domains,
19038      * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`,
19039      * `google.com`, `youtube.com`, etc.
19040      * If this is set, it should be exactly matched with
19041      * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search
19042      * results boosted by entity.
19043      * </pre>
19044      *
19045      * <code>string entity = 38;</code>
19046      *
19047      * @param value The bytes for entity to set.
19048      * @return This builder for chaining.
19049      */
setEntityBytes(com.google.protobuf.ByteString value)19050     public Builder setEntityBytes(com.google.protobuf.ByteString value) {
19051       if (value == null) {
19052         throw new NullPointerException();
19053       }
19054       checkByteStringIsUtf8(value);
19055       entity_ = value;
19056       bitField0_ |= 0x00200000;
19057       onChanged();
19058       return this;
19059     }
19060 
19061     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)19062     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
19063       return super.setUnknownFields(unknownFields);
19064     }
19065 
19066     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)19067     public final Builder mergeUnknownFields(
19068         final com.google.protobuf.UnknownFieldSet unknownFields) {
19069       return super.mergeUnknownFields(unknownFields);
19070     }
19071 
19072     // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest)
19073   }
19074 
19075   // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest)
19076   private static final com.google.cloud.retail.v2.SearchRequest DEFAULT_INSTANCE;
19077 
19078   static {
19079     DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest();
19080   }
19081 
getDefaultInstance()19082   public static com.google.cloud.retail.v2.SearchRequest getDefaultInstance() {
19083     return DEFAULT_INSTANCE;
19084   }
19085 
19086   private static final com.google.protobuf.Parser<SearchRequest> PARSER =
19087       new com.google.protobuf.AbstractParser<SearchRequest>() {
19088         @java.lang.Override
19089         public SearchRequest parsePartialFrom(
19090             com.google.protobuf.CodedInputStream input,
19091             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
19092             throws com.google.protobuf.InvalidProtocolBufferException {
19093           Builder builder = newBuilder();
19094           try {
19095             builder.mergeFrom(input, extensionRegistry);
19096           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
19097             throw e.setUnfinishedMessage(builder.buildPartial());
19098           } catch (com.google.protobuf.UninitializedMessageException e) {
19099             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
19100           } catch (java.io.IOException e) {
19101             throw new com.google.protobuf.InvalidProtocolBufferException(e)
19102                 .setUnfinishedMessage(builder.buildPartial());
19103           }
19104           return builder.buildPartial();
19105         }
19106       };
19107 
parser()19108   public static com.google.protobuf.Parser<SearchRequest> parser() {
19109     return PARSER;
19110   }
19111 
19112   @java.lang.Override
getParserForType()19113   public com.google.protobuf.Parser<SearchRequest> getParserForType() {
19114     return PARSER;
19115   }
19116 
19117   @java.lang.Override
getDefaultInstanceForType()19118   public com.google.cloud.retail.v2.SearchRequest getDefaultInstanceForType() {
19119     return DEFAULT_INSTANCE;
19120   }
19121 }
19122