google-cloud-retail-v2 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/LICENSE.md +188 -190
  4. data/README.md +3 -3
  5. data/lib/google/cloud/retail/v2.rb +2 -0
  6. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -0
  7. data/lib/google/cloud/retail/v2/catalog_service/client.rb +211 -15
  8. data/lib/google/cloud/retail/v2/catalog_service/paths.rb +21 -0
  9. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +16 -0
  10. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +46 -0
  11. data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
  12. data/lib/google/cloud/retail/v2/completion_service.rb +54 -0
  13. data/lib/google/cloud/retail/v2/completion_service/client.rb +546 -0
  14. data/lib/google/cloud/retail/v2/completion_service/credentials.rb +51 -0
  15. data/lib/google/cloud/retail/v2/completion_service/operations.rb +655 -0
  16. data/lib/google/cloud/retail/v2/completion_service/paths.rb +52 -0
  17. data/lib/google/cloud/retail/v2/completion_service_pb.rb +50 -0
  18. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +61 -0
  19. data/lib/google/cloud/retail/v2/import_config_pb.rb +32 -0
  20. data/lib/google/cloud/retail/v2/prediction_service/client.rb +41 -43
  21. data/lib/google/cloud/retail/v2/product_pb.rb +21 -0
  22. data/lib/google/cloud/retail/v2/product_service/client.rb +643 -18
  23. data/lib/google/cloud/retail/v2/product_service/operations.rb +11 -11
  24. data/lib/google/cloud/retail/v2/product_service_pb.rb +56 -0
  25. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +75 -0
  26. data/lib/google/cloud/retail/v2/search_service.rb +53 -0
  27. data/lib/google/cloud/retail/v2/search_service/client.rb +541 -0
  28. data/lib/google/cloud/retail/v2/search_service/credentials.rb +51 -0
  29. data/lib/google/cloud/retail/v2/search_service/paths.rb +54 -0
  30. data/lib/google/cloud/retail/v2/search_service_pb.rb +131 -0
  31. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +53 -0
  32. data/lib/google/cloud/retail/v2/user_event_pb.rb +11 -0
  33. data/lib/google/cloud/retail/v2/user_event_service/client.rb +12 -15
  34. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +11 -11
  35. data/lib/google/cloud/retail/v2/user_event_service/paths.rb +19 -0
  36. data/lib/google/cloud/retail/v2/version.rb +1 -1
  37. data/proto_docs/google/api/field_behavior.rb +7 -1
  38. data/proto_docs/google/api/httpbody.rb +4 -3
  39. data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
  40. data/proto_docs/google/cloud/retail/v2/catalog_service.rb +53 -4
  41. data/proto_docs/google/cloud/retail/v2/common.rb +272 -4
  42. data/proto_docs/google/cloud/retail/v2/completion_service.rb +162 -0
  43. data/proto_docs/google/cloud/retail/v2/import_config.rb +122 -6
  44. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +32 -31
  45. data/proto_docs/google/cloud/retail/v2/product.rb +266 -10
  46. data/proto_docs/google/cloud/retail/v2/product_service.rb +362 -2
  47. data/proto_docs/google/cloud/retail/v2/purge_config.rb +1 -1
  48. data/proto_docs/google/cloud/retail/v2/search_service.rb +820 -0
  49. data/proto_docs/google/cloud/retail/v2/user_event.rb +95 -3
  50. data/proto_docs/google/type/date.rb +53 -0
  51. metadata +32 -10
@@ -33,7 +33,7 @@ module Google
33
33
  # @return [::String]
34
34
  # Required. The resource name of the catalog under which the events are
35
35
  # created. The format is
36
- # "projects/$\\{projectId}/locations/global/catalogs/$\\{catalogId}"
36
+ # `projects/${projectId}/locations/global/catalogs/${catalogId}`
37
37
  # @!attribute [rw] filter
38
38
  # @return [::String]
39
39
  # Required. The filter string to specify the events to be deleted with a
@@ -0,0 +1,820 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Retail
23
+ module V2
24
+ # Request message for
25
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} method.
26
+ # @!attribute [rw] placement
27
+ # @return [::String]
28
+ # Required. The resource name of the search engine placement, such as
29
+ # `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
30
+ # This field is used to identify the set of models that will be used to make
31
+ # the search.
32
+ #
33
+ # We currently support one placement with the following ID:
34
+ #
35
+ # * `default_search`.
36
+ # @!attribute [rw] branch
37
+ # @return [::String]
38
+ # The branch resource name, such as
39
+ # `projects/*/locations/global/catalogs/default_catalog/branches/0`.
40
+ #
41
+ # Use "default_branch" as the branch ID or leave this field empty, to search
42
+ # products under the default branch.
43
+ # @!attribute [rw] query
44
+ # @return [::String]
45
+ # Raw search query.
46
+ # @!attribute [rw] visitor_id
47
+ # @return [::String]
48
+ # Required. A unique identifier for tracking visitors. For example, this
49
+ # could be implemented with an HTTP cookie, which should be able to uniquely
50
+ # identify a visitor on a single device. This unique identifier should not
51
+ # change if the visitor logs in or out of the website.
52
+ #
53
+ # The field must be a UTF-8 encoded string with a length limit of 128
54
+ # characters. Otherwise, an INVALID_ARGUMENT error is returned.
55
+ # @!attribute [rw] user_info
56
+ # @return [::Google::Cloud::Retail::V2::UserInfo]
57
+ # User information.
58
+ # @!attribute [rw] page_size
59
+ # @return [::Integer]
60
+ # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If
61
+ # unspecified, defaults to a reasonable value. The maximum allowed value is
62
+ # 120. Values above 120 will be coerced to 120.
63
+ #
64
+ # If this field is negative, an INVALID_ARGUMENT is returned.
65
+ # @!attribute [rw] page_token
66
+ # @return [::String]
67
+ # A page token
68
+ # {::Google::Cloud::Retail::V2::SearchResponse#next_page_token SearchResponse.next_page_token},
69
+ # received from a previous
70
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} call.
71
+ # Provide this to retrieve the subsequent page.
72
+ #
73
+ # When paginating, all other parameters provided to
74
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} must
75
+ # match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
76
+ # error is returned.
77
+ # @!attribute [rw] offset
78
+ # @return [::Integer]
79
+ # A 0-indexed integer that specifies the current offset (that is, starting
80
+ # result location, amongst the {::Google::Cloud::Retail::V2::Product Product}s
81
+ # deemed by the API as relevant) in search results. This field is only
82
+ # considered if {::Google::Cloud::Retail::V2::SearchRequest#page_token page_token}
83
+ # is unset.
84
+ #
85
+ # If this field is negative, an INVALID_ARGUMENT is returned.
86
+ # @!attribute [rw] filter
87
+ # @return [::String]
88
+ # The filter syntax consists of an expression language for constructing a
89
+ # predicate from one or more fields of the products being filtered. Filter
90
+ # expression is case-sensitive. See more details at this [user
91
+ # guide](/retail/private/docs/filter-and-order#filter).
92
+ #
93
+ # If this field is unrecognizable, an INVALID_ARGUMENT is returned.
94
+ # @!attribute [rw] canonical_filter
95
+ # @return [::String]
96
+ # The filter applied to every search request when quality improvement such as
97
+ # query expansion is needed. For example, if a query does not have enough
98
+ # results, an expanded query with
99
+ # {::Google::Cloud::Retail::V2::SearchRequest#canonical_filter SearchRequest.canonical_filter}
100
+ # will be returned as a supplement of the original query. This field is
101
+ # strongly recommended to achieve high search quality.
102
+ #
103
+ # See {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for
104
+ # more details about filter syntax.
105
+ # @!attribute [rw] order_by
106
+ # @return [::String]
107
+ # The order in which products are returned. Products can be ordered by
108
+ # a field in an {::Google::Cloud::Retail::V2::Product Product} object. Leave it
109
+ # unset if ordered by relevance. OrderBy expression is case-sensitive. See
110
+ # more details at this [user
111
+ # guide](/retail/private/docs/filter-and-order#order).
112
+ #
113
+ # If this field is unrecognizable, an INVALID_ARGUMENT is returned.
114
+ # @!attribute [rw] facet_specs
115
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::FacetSpec>]
116
+ # Facet specifications for faceted search. If empty, no facets are returned.
117
+ #
118
+ # A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
119
+ # is returned.
120
+ # @!attribute [rw] dynamic_facet_spec
121
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec]
122
+ # The specification for dynamically generated facets. Notice that only
123
+ # textual facets can be dynamically generated.
124
+ #
125
+ # This feature requires additional allowlisting. Contact Retail Support
126
+ # (retail-search-support@google.com) if you are interested in using dynamic
127
+ # facet feature.
128
+ # @!attribute [rw] boost_spec
129
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec]
130
+ # Boost specification to boost certain products. See more details at this
131
+ # [user guide](/retail/private/docs/boosting).
132
+ # @!attribute [rw] query_expansion_spec
133
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec]
134
+ # The query expansion specification that specifies the conditions under which
135
+ # query expansion will occur. See more details at this [user
136
+ # guide](/retail/private/docs/result-size#query_expansion).
137
+ # @!attribute [rw] variant_rollup_keys
138
+ # @return [::Array<::String>]
139
+ # The keys to fetch and rollup the matching
140
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
141
+ # {::Google::Cloud::Retail::V2::Product Product}s attributes. The attributes from
142
+ # all the matching {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
143
+ # {::Google::Cloud::Retail::V2::Product Product}s are merged and de-duplicated.
144
+ # Notice that rollup {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
145
+ # {::Google::Cloud::Retail::V2::Product Product}s attributes will lead to extra
146
+ # query latency. Maximum number of keys is 10.
147
+ #
148
+ # For
149
+ # {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info},
150
+ # a fulfillment type and a fulfillment ID must be provided in the format of
151
+ # "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
152
+ # "pickupInStore" is fulfillment type and "store123" is the store ID.
153
+ #
154
+ # Supported keys are:
155
+ #
156
+ # * colorFamilies
157
+ # * price
158
+ # * originalPrice
159
+ # * discount
160
+ # * attributes.key, where key is any key in the
161
+ # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map.
162
+ # * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
163
+ # [FulfillmentInfo.Type.PICKUP_IN_STORE][].
164
+ # * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
165
+ # [FulfillmentInfo.Type.SHIP_TO_STORE][].
166
+ # * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
167
+ # [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
168
+ # * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
169
+ # [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
170
+ # * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
171
+ # [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
172
+ # * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
173
+ # [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
174
+ # * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
175
+ # [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
176
+ # * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
177
+ # [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
178
+ # * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
179
+ # [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
180
+ #
181
+ # If this field is set to an invalid value other than these, an
182
+ # INVALID_ARGUMENT error is returned.
183
+ # @!attribute [rw] page_categories
184
+ # @return [::Array<::String>]
185
+ # The categories associated with a category page. Required for category
186
+ # navigation queries to achieve good search quality. The format should be
187
+ # the same as
188
+ # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories};
189
+ #
190
+ # To represent full path of category, use '>' sign to separate different
191
+ # hierarchies. If '>' is part of the category name, please replace it with
192
+ # other character(s).
193
+ #
194
+ # Category pages include special pages such as sales or promotions. For
195
+ # instance, a special sale page may have the category hierarchy:
196
+ # "pageCategories" : ["Sales > 2017 Black Friday Deals"].
197
+ class SearchRequest
198
+ include ::Google::Protobuf::MessageExts
199
+ extend ::Google::Protobuf::MessageExts::ClassMethods
200
+
201
+ # A facet specification to perform faceted search.
202
+ # @!attribute [rw] facet_key
203
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey]
204
+ # Required. The facet key specification.
205
+ # @!attribute [rw] limit
206
+ # @return [::Integer]
207
+ # Maximum of facet values that should be returned for this facet. If
208
+ # unspecified, defaults to 20. The maximum allowed value is 300. Values
209
+ # above 300 will be coerced to 300.
210
+ #
211
+ # If this field is negative, an INVALID_ARGUMENT is returned.
212
+ # @!attribute [rw] excluded_filter_keys
213
+ # @return [::Array<::String>]
214
+ # List of keys to exclude when faceting.
215
+ #
216
+ # By default,
217
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
218
+ # is not excluded from the filter unless it is listed in this field.
219
+ #
220
+ # For example, suppose there are 100 products with color facet "Red" and
221
+ # 200 products with color facet "Blue". A query containing the filter
222
+ # "colorFamilies:ANY("Red")" and have "colorFamilies" as
223
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
224
+ # will by default return the "Red" with count 100.
225
+ #
226
+ # If this field contains "colorFamilies", then the query returns both the
227
+ # "Red" with count 100 and "Blue" with count 200, because the
228
+ # "colorFamilies" key is now excluded from the filter.
229
+ #
230
+ # A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
231
+ # is returned.
232
+ # @!attribute [rw] enable_dynamic_position
233
+ # @return [::Boolean]
234
+ # Enables dynamic position for this facet. If set to true, the position of
235
+ # this facet among all facets in the response is determined by Google
236
+ # Retail Search. It will be ordered together with dynamic facets if dynamic
237
+ # facets is enabled. If set to false, the position of this facet in the
238
+ # response will be the same as in the request, and it will be ranked before
239
+ # the facets with dynamic position enable and all dynamic facets.
240
+ #
241
+ # For example, you may always want to have rating facet returned in
242
+ # the response, but it's not necessarily to always display the rating facet
243
+ # at the top. In that case, you can set enable_dynamic_position to true so
244
+ # that the position of rating facet in response will be determined by
245
+ # Google Retail Search.
246
+ #
247
+ # Another example, assuming you have the following facets in the request:
248
+ #
249
+ # * "rating", enable_dynamic_position = true
250
+ #
251
+ # * "price", enable_dynamic_position = false
252
+ #
253
+ # * "brands", enable_dynamic_position = false
254
+ #
255
+ # And also you have a dynamic facets enable, which will generate a facet
256
+ # 'gender'. Then the final order of the facets in the response can be
257
+ # ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
258
+ # "rating") depends on how Google Retail Search orders "gender" and
259
+ # "rating" facets. However, notice that "price" and "brands" will always be
260
+ # ranked at 1st and 2nd position since their enable_dynamic_position are
261
+ # false.
262
+ class FacetSpec
263
+ include ::Google::Protobuf::MessageExts
264
+ extend ::Google::Protobuf::MessageExts::ClassMethods
265
+
266
+ # Specifies how a facet is computed.
267
+ # @!attribute [rw] key
268
+ # @return [::String]
269
+ # Required. Supported textual and numerical facet keys in
270
+ # {::Google::Cloud::Retail::V2::Product Product} object, over which the facet
271
+ # values are computed. Facet key is case-sensitive.
272
+ #
273
+ # Allowed facet keys when
274
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#query FacetKey.query}
275
+ # is not specified:
276
+ #
277
+ # * textual_field =<br>
278
+ # <font color='grey'>
279
+ # *# The
280
+ # {::Google::Cloud::Retail::V2::Product#brands Product.brands}.<br>*
281
+ # </font>
282
+ # "brands";
283
+ # <br>
284
+ # <font color='categories'>
285
+ # *# The
286
+ # {::Google::Cloud::Retail::V2::Product#categories Product.categories}.<br>*
287
+ # </font>
288
+ # "categories";
289
+ # <br>
290
+ # <font color='grey'>
291
+ # *# The
292
+ # {::Google::Cloud::Retail::V2::Audience#genders Audience.genders}.<br>*
293
+ # </font>
294
+ # | "genders";
295
+ # <br>
296
+ # <font color='grey'>
297
+ # *# The
298
+ # {::Google::Cloud::Retail::V2::Audience#age_groups Audience.age_groups}.<br>*
299
+ # </font>
300
+ # | "ageGroups";
301
+ # <br>
302
+ # <font color='grey'>
303
+ # *# The
304
+ # {::Google::Cloud::Retail::V2::Product#availability Product.availability}.
305
+ # Value is one of<br>*
306
+ # *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".<br>*
307
+ # </font>
308
+ # | "availability";
309
+ # <br>
310
+ # <font color='grey'>
311
+ # *# The
312
+ # {::Google::Cloud::Retail::V2::ColorInfo#color_families ColorInfo.color_families}.<br>*
313
+ # </font>
314
+ # | "colorFamilies";
315
+ # <br>
316
+ # <font color='grey'>
317
+ # *# The
318
+ # {::Google::Cloud::Retail::V2::ColorInfo#colors ColorInfo.colors}.<br>*
319
+ # </font>
320
+ # | "colors";
321
+ # <br>
322
+ # <font color='grey'>
323
+ # *# The {::Google::Cloud::Retail::V2::Product#sizes Product.sizes}.<br>*
324
+ # </font>
325
+ # | "sizes";
326
+ # <br>
327
+ # <font color='grey'>
328
+ # *# The
329
+ # {::Google::Cloud::Retail::V2::Product#materials Product.materials}.<br>*
330
+ # </font>
331
+ # | "materials";
332
+ # <br>
333
+ # <font color='grey'>
334
+ # *# The
335
+ # {::Google::Cloud::Retail::V2::Product#patterns Product.patterns}.<br>*
336
+ # </font>
337
+ # | "patterns";
338
+ # <br>
339
+ # <font color='grey'>
340
+ # *# The
341
+ # {::Google::Cloud::Retail::V2::Product#conditions Product.conditions}.<br>*
342
+ # </font>
343
+ # | "conditions";
344
+ # <br>
345
+ # <font color='grey'>
346
+ # *# The textual custom attribute in
347
+ # {::Google::Cloud::Retail::V2::Product Product} object. Key can<br>*
348
+ # *# be any key in the
349
+ # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes}
350
+ # map<br>*
351
+ # *# if the attribute values are textual.<br>*
352
+ # *# map.<br>*
353
+ # </font>
354
+ # | "attributes.key";
355
+ # <br>
356
+ # <font color='grey'>
357
+ # *# The [FulfillmentInfo.ids][] for type
358
+ # *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].<br>*
359
+ # </font>
360
+ # | "pickupInStore";
361
+ # <br>
362
+ # <font color='grey'>
363
+ # *# The [FulfillmentInfo.ids][] for type
364
+ # *# [FulfillmentInfo.Type.SHIP_TO_STORE][].<br>*
365
+ # </font>
366
+ # | "shipToStore";
367
+ # <br>
368
+ # <font color='grey'>
369
+ # *# The [FulfillmentInfo.ids][] for type
370
+ # *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].<br>*
371
+ # </font>
372
+ # | "sameDayDelivery";
373
+ # <br>
374
+ # <font color='grey'>
375
+ # *# The [FulfillmentInfo.ids][] for type
376
+ # *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].<br>*
377
+ # </font>
378
+ # | "nextDayDelivery";
379
+ # <br>
380
+ # <font color='grey'>
381
+ # *# The [FulfillmentInfo.ids][] for type
382
+ # *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].<br>*
383
+ # </font>
384
+ # | "customFulfillment1";
385
+ # <br>
386
+ # <font color='grey'>
387
+ # *# The [FulfillmentInfo.ids][] for type
388
+ # *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].<br>*
389
+ # </font>
390
+ # | "customFulfillment2";
391
+ # <br>
392
+ # <font color='grey'>
393
+ # *# The [FulfillmentInfo.ids][] for type
394
+ # *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].<br>*
395
+ # </font>
396
+ # | "customFulfillment3";
397
+ # <br>
398
+ # <font color='grey'>
399
+ # *# The [FulfillmentInfo.ids][] for type
400
+ # *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].<br>*
401
+ # </font>
402
+ # | "customFulfillment4";
403
+ # <br>
404
+ # <font color='grey'>
405
+ # *# The [FulfillmentInfo.ids][] for type
406
+ # *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].<br>*
407
+ # </font>
408
+ # | "customFulfillment5";
409
+ #
410
+ # * numerical_field =<br>
411
+ # <font color='grey'>
412
+ # *# The
413
+ # {::Google::Cloud::Retail::V2::PriceInfo#price PriceInfo.price}.<br>*
414
+ # </font>
415
+ # "price";
416
+ # <br>
417
+ # <font color='grey'>
418
+ # *# The discount. Computed by (original_price-price)/price <br>*
419
+ # </font>
420
+ # "discount";
421
+ # <br>
422
+ # <font color='grey'>
423
+ # *# The
424
+ # {::Google::Cloud::Retail::V2::Rating#average_rating Rating.average_rating}.<br>*
425
+ # </font>
426
+ # "rating";
427
+ # <br>
428
+ # <font color='grey'>
429
+ # *# The
430
+ # {::Google::Cloud::Retail::V2::Rating#rating_count Rating.rating_count}.<br>*
431
+ # </font>
432
+ # "ratingCount";
433
+ # <br>
434
+ # <font color='grey'>
435
+ # *# The numerical custom attribute in
436
+ # {::Google::Cloud::Retail::V2::Product Product} object. Key can<br>*
437
+ # *# be any key in the
438
+ # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes}
439
+ # map<br>*
440
+ # *# if the attribute values are numerical.<br>*
441
+ # </font>
442
+ # | "attributes.key";
443
+ # @!attribute [rw] intervals
444
+ # @return [::Array<::Google::Cloud::Retail::V2::Interval>]
445
+ # Set only if values should be bucketized into intervals. Must be set
446
+ # for facets with numerical values. Must not be set for facet with text
447
+ # values. Maximum number of intervals is 30.
448
+ # @!attribute [rw] restricted_values
449
+ # @return [::Array<::String>]
450
+ # Only get facet for the given restricted values. For example, when using
451
+ # "pickupInStore" as key and set restricted values to
452
+ # ["store123", "store456"], only facets for "store123" and "store456" are
453
+ # returned. Only supported on textual fields and fulfillments.
454
+ # Maximum is 20.
455
+ #
456
+ # Must be set for the fulfillment facet keys:
457
+ #
458
+ # * pickupInStore
459
+ #
460
+ # * shipToStore
461
+ #
462
+ # * sameDayDelivery
463
+ #
464
+ # * nextDayDelivery
465
+ #
466
+ # * customFulfillment1
467
+ #
468
+ # * customFulfillment2
469
+ #
470
+ # * customFulfillment3
471
+ #
472
+ # * customFulfillment4
473
+ #
474
+ # * customFulfillment5
475
+ # @!attribute [rw] prefixes
476
+ # @return [::Array<::String>]
477
+ # Only get facet values that start with the given string prefix. For
478
+ # example, suppose "categories" has three values "Women > Shoe",
479
+ # "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
480
+ # "categories" facet will give only "Women > Shoe" and "Women > Dress".
481
+ # Only supported on textual fields. Maximum is 10.
482
+ # @!attribute [rw] contains
483
+ # @return [::Array<::String>]
484
+ # Only get facet values that contains the given strings. For example,
485
+ # suppose "categories" has three values "Women > Shoe",
486
+ # "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
487
+ # "categories" facet will give only "Women > Shoe" and "Men > Shoe".
488
+ # Only supported on textual fields. Maximum is 10.
489
+ # @!attribute [rw] order_by
490
+ # @return [::String]
491
+ # The order in which [Facet.values][] are returned.
492
+ #
493
+ # Allowed values are:
494
+ #
495
+ # * "count desc", which means order by [Facet.FacetValue.count][]
496
+ # descending.
497
+ #
498
+ # * "value desc", which means order by [Facet.FacetValue.value][]
499
+ # descending.
500
+ # Only applies to textual facets.
501
+ #
502
+ # If not set, textual values are sorted in [natural
503
+ # order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
504
+ # intervals are sorted in the order given by
505
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals};
506
+ # [FulfillmentInfo.ids][] are sorted in the order given by
507
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#restricted_values FacetSpec.FacetKey.restricted_values}.
508
+ # @!attribute [rw] query
509
+ # @return [::String]
510
+ # The query that is used to compute facet for the given facet key.
511
+ # When provided, it will override the default behavior of facet
512
+ # computation. The query syntax is the same as a filter expression. See
513
+ # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for
514
+ # detail syntax and limitations. Notice that there is no limitation on
515
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
516
+ # when query is specified.
517
+ #
518
+ # In the response, [FacetValue.value][] will be always "1" and
519
+ # [FacetValue.count][] will be the number of results that matches the
520
+ # query.
521
+ #
522
+ # For example, you can set a customized facet for "shipToStore",
523
+ # where
524
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
525
+ # is "customizedShipToStore", and
526
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#query FacetKey.query}
527
+ # is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
528
+ # Then the facet will count the products that are both in stock and ship
529
+ # to store "123".
530
+ class FacetKey
531
+ include ::Google::Protobuf::MessageExts
532
+ extend ::Google::Protobuf::MessageExts::ClassMethods
533
+ end
534
+ end
535
+
536
+ # The specifications of dynamically generated facets.
537
+ # @!attribute [rw] mode
538
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec::Mode]
539
+ # Mode of the DynamicFacet feature.
540
+ # Defaults to
541
+ # {::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec::Mode::DISABLED Mode.DISABLED}
542
+ # if it's unset.
543
+ class DynamicFacetSpec
544
+ include ::Google::Protobuf::MessageExts
545
+ extend ::Google::Protobuf::MessageExts::ClassMethods
546
+
547
+ # Enum to control DynamicFacet mode
548
+ module Mode
549
+ # Default value.
550
+ MODE_UNSPECIFIED = 0
551
+
552
+ # Disable Dynamic Facet.
553
+ DISABLED = 1
554
+
555
+ # Automatic mode built by Google Retail Search.
556
+ ENABLED = 2
557
+ end
558
+ end
559
+
560
+ # Boost specification to boost certain items.
561
+ # @!attribute [rw] condition_boost_specs
562
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::BoostSpec::ConditionBoostSpec>]
563
+ # Condition boost specifications. If a product matches multiple conditions
564
+ # in the specifictions, boost scores from these specifications are all
565
+ # applied and combined in a non-linear way. Maximum number of
566
+ # specifications is 10.
567
+ class BoostSpec
568
+ include ::Google::Protobuf::MessageExts
569
+ extend ::Google::Protobuf::MessageExts::ClassMethods
570
+
571
+ # Boost applies to products which match a condition.
572
+ # @!attribute [rw] condition
573
+ # @return [::String]
574
+ # An expression which specifies a boost condition. The syntax and
575
+ # supported fields are the same as a filter expression. See
576
+ # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for
577
+ # detail syntax and limitations.
578
+ #
579
+ # Examples:
580
+ #
581
+ # * To boost products with product ID "product_1" or "product_2", and
582
+ # color
583
+ # "Red" or "Blue":<br>
584
+ # *(id: ANY("product_1", "product_2"))<br>*
585
+ # *AND<br>*
586
+ # *(colorFamilies: ANY("Red", "Blue"))<br>*
587
+ # @!attribute [rw] boost
588
+ # @return [::Float]
589
+ # Strength of the condition boost, which should be in [-1, 1]. Negative
590
+ # boost means demotion. Default is 0.0.
591
+ #
592
+ # Setting to 1.0 gives the item a big promotion. However, it does not
593
+ # necessarily mean that the boosted item will be the top result at all
594
+ # times, nor that other items will be excluded. Results could still be
595
+ # shown even when none of them matches the condition. And results that
596
+ # are significantly more relevant to the search query can still trump
597
+ # your heavily favored but irrelevant items.
598
+ #
599
+ # Setting to -1.0 gives the item a big demotion. However, results that
600
+ # are deeply relevant might still be shown. The item will have an
601
+ # upstream battle to get a fairly high ranking, but it is not blocked out
602
+ # completely.
603
+ #
604
+ # Setting to 0.0 means no boost applied. The boosting condition is
605
+ # ignored.
606
+ class ConditionBoostSpec
607
+ include ::Google::Protobuf::MessageExts
608
+ extend ::Google::Protobuf::MessageExts::ClassMethods
609
+ end
610
+ end
611
+
612
+ # Specification to determine under which conditions query expansion should
613
+ # occur.
614
+ # @!attribute [rw] condition
615
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition]
616
+ # The condition under which query expansion should occur. Default to
617
+ # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
618
+ class QueryExpansionSpec
619
+ include ::Google::Protobuf::MessageExts
620
+ extend ::Google::Protobuf::MessageExts::ClassMethods
621
+
622
+ # Enum describing under which condition query expansion should occur.
623
+ module Condition
624
+ # Unspecified query expansion condition. This defaults to
625
+ # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
626
+ CONDITION_UNSPECIFIED = 0
627
+
628
+ # Disabled query expansion. Only the exact search query is used, even if
629
+ # {::Google::Cloud::Retail::V2::SearchResponse#total_size SearchResponse.total_size}
630
+ # is zero.
631
+ DISABLED = 1
632
+
633
+ # Automatic query expansion built by Google Retail Search.
634
+ AUTO = 3
635
+ end
636
+ end
637
+ end
638
+
639
+ # Response message for
640
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} method.
641
+ # @!attribute [rw] results
642
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>]
643
+ # A list of matched items. The order represents the ranking.
644
+ # @!attribute [rw] facets
645
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet>]
646
+ # Results of facets requested by user.
647
+ # @!attribute [rw] total_size
648
+ # @return [::Integer]
649
+ # The estimated total count of matched items irrespective of pagination. The
650
+ # count of {::Google::Cloud::Retail::V2::SearchResponse#results results} returned
651
+ # by pagination may be less than the
652
+ # {::Google::Cloud::Retail::V2::SearchResponse#total_size total_size} that
653
+ # matches.
654
+ # @!attribute [rw] corrected_query
655
+ # @return [::String]
656
+ # If spell correction applies, the corrected query. Otherwise, empty.
657
+ # @!attribute [rw] attribution_token
658
+ # @return [::String]
659
+ # A unique search token. This should be included in the
660
+ # {::Google::Cloud::Retail::V2::UserEvent UserEvent} logs resulting from this
661
+ # search, which enables accurate attribution of search model performance.
662
+ # @!attribute [rw] next_page_token
663
+ # @return [::String]
664
+ # A token that can be sent as
665
+ # {::Google::Cloud::Retail::V2::SearchRequest#page_token SearchRequest.page_token}
666
+ # to retrieve the next page. If this field is omitted, there are no
667
+ # subsequent pages.
668
+ # @!attribute [rw] query_expansion_info
669
+ # @return [::Google::Cloud::Retail::V2::SearchResponse::QueryExpansionInfo]
670
+ # Query expansion information for the returned results.
671
+ # @!attribute [rw] redirect_uri
672
+ # @return [::String]
673
+ # The URI of a customer-defined redirect page. If redirect action is
674
+ # triggered, no search will be performed, and only
675
+ # {::Google::Cloud::Retail::V2::SearchResponse#redirect_uri redirect_uri} and
676
+ # {::Google::Cloud::Retail::V2::SearchResponse#attribution_token attribution_token}
677
+ # will be set in the response.
678
+ class SearchResponse
679
+ include ::Google::Protobuf::MessageExts
680
+ extend ::Google::Protobuf::MessageExts::ClassMethods
681
+
682
+ # Represents the search results.
683
+ # @!attribute [rw] id
684
+ # @return [::String]
685
+ # {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
686
+ # {::Google::Cloud::Retail::V2::Product Product}.
687
+ # @!attribute [rw] product
688
+ # @return [::Google::Cloud::Retail::V2::Product]
689
+ # The product data snippet in the search response. Only
690
+ # {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
691
+ # populated.
692
+ #
693
+ # {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
694
+ # product variants that match the search query. If there are multiple
695
+ # product variants matching the query, top 5 most relevant product variants
696
+ # are returned and ordered by relevancy.
697
+ #
698
+ # If relevancy can be deternmined, use
699
+ # {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
700
+ # to look up matched product variants fields. If relevancy cannot be
701
+ # determined, e.g. when searching "shoe" all products in a shoe product can
702
+ # be a match, 5 product variants are returned but order is meaningless.
703
+ # @!attribute [rw] matching_variant_count
704
+ # @return [::Integer]
705
+ # The count of matched
706
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
707
+ # {::Google::Cloud::Retail::V2::Product Product}s.
708
+ # @!attribute [rw] matching_variant_fields
709
+ # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
710
+ # If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
711
+ # {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
712
+ # map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
713
+ # matched. The key is the
714
+ # {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
715
+ # mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
716
+ # matched attributes cannot be determined, this map will be empty.
717
+ #
718
+ # For example, a key "sku1" with field mask
719
+ # "products.color_info" indicates there is a match between
720
+ # "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
721
+ # @!attribute [rw] variant_rollup_values
722
+ # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
723
+ # The rollup matching
724
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
725
+ # {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
726
+ # the
727
+ # {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
728
+ # The values are the merged and de-duplicated
729
+ # {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
730
+ # rollup values are respect filter. For example, when filtering by
731
+ # "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
732
+ # returned.
733
+ #
734
+ # For textual and numerical attributes, the rollup values is a list of
735
+ # string or double values with type
736
+ # {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
737
+ # there are two variants with colors "red" and "blue", the rollup values
738
+ # are { key: "colorFamilies"
739
+ # value {
740
+ # list_value {
741
+ # values { string_value: "red" }
742
+ # values { string_value: "blue" }
743
+ # }
744
+ # }
745
+ # }
746
+ #
747
+ # For
748
+ # {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info},
749
+ # the rollup values is a double value with type
750
+ # {::Google::Protobuf::Value google.protobuf.Value}. For example, {key:
751
+ # "pickupInStore.store1" value { number_value: 10 }} means a there are 10
752
+ # variants in this product are available in the store "store1".
753
+ class SearchResult
754
+ include ::Google::Protobuf::MessageExts
755
+ extend ::Google::Protobuf::MessageExts::ClassMethods
756
+
757
+ # @!attribute [rw] key
758
+ # @return [::String]
759
+ # @!attribute [rw] value
760
+ # @return [::Google::Protobuf::FieldMask]
761
+ class MatchingVariantFieldsEntry
762
+ include ::Google::Protobuf::MessageExts
763
+ extend ::Google::Protobuf::MessageExts::ClassMethods
764
+ end
765
+
766
+ # @!attribute [rw] key
767
+ # @return [::String]
768
+ # @!attribute [rw] value
769
+ # @return [::Google::Protobuf::Value]
770
+ class VariantRollupValuesEntry
771
+ include ::Google::Protobuf::MessageExts
772
+ extend ::Google::Protobuf::MessageExts::ClassMethods
773
+ end
774
+ end
775
+
776
+ # A facet result.
777
+ # @!attribute [rw] key
778
+ # @return [::String]
779
+ # The key for this facet. E.g., "colorFamilies" or "price" or
780
+ # "attributes.attr1".
781
+ # @!attribute [rw] values
782
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
783
+ # The facet values for this field.
784
+ # @!attribute [rw] dynamic_facet
785
+ # @return [::Boolean]
786
+ # Whether the facet is dynamically generated.
787
+ class Facet
788
+ include ::Google::Protobuf::MessageExts
789
+ extend ::Google::Protobuf::MessageExts::ClassMethods
790
+
791
+ # A facet value which contains value names and their count.
792
+ # @!attribute [rw] value
793
+ # @return [::String]
794
+ # Text value of a facet, such as "Black" for facet "colorFamilies".
795
+ # @!attribute [rw] interval
796
+ # @return [::Google::Cloud::Retail::V2::Interval]
797
+ # Interval value for a facet, such as [10, 20) for facet "price".
798
+ # @!attribute [rw] count
799
+ # @return [::Integer]
800
+ # Number of items that have this facet value.
801
+ class FacetValue
802
+ include ::Google::Protobuf::MessageExts
803
+ extend ::Google::Protobuf::MessageExts::ClassMethods
804
+ end
805
+ end
806
+
807
+ # Information describing query expansion including whether expansion has
808
+ # occurred.
809
+ # @!attribute [rw] expanded_query
810
+ # @return [::Boolean]
811
+ # Bool describing whether query expansion has occurred.
812
+ class QueryExpansionInfo
813
+ include ::Google::Protobuf::MessageExts
814
+ extend ::Google::Protobuf::MessageExts::ClassMethods
815
+ end
816
+ end
817
+ end
818
+ end
819
+ end
820
+ end