google-cloud-retail-v2 0.4.2 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -2
  3. data/lib/google/cloud/retail/v2/catalog_service/client.rb +26 -18
  4. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +2 -2
  5. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +5 -5
  6. data/lib/google/cloud/retail/v2/common_pb.rb +2 -2
  7. data/lib/google/cloud/retail/v2/completion_service/client.rb +29 -23
  8. data/lib/google/cloud/retail/v2/completion_service/operations.rb +20 -12
  9. data/lib/google/cloud/retail/v2/completion_service.rb +2 -2
  10. data/lib/google/cloud/retail/v2/completion_service_pb.rb +2 -2
  11. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +7 -7
  12. data/lib/google/cloud/retail/v2/import_config_pb.rb +2 -2
  13. data/lib/google/cloud/retail/v2/prediction_service/client.rb +7 -5
  14. data/lib/google/cloud/retail/v2/prediction_service_pb.rb +2 -2
  15. data/lib/google/cloud/retail/v2/prediction_service_services_pb.rb +1 -1
  16. data/lib/google/cloud/retail/v2/product_pb.rb +2 -2
  17. data/lib/google/cloud/retail/v2/product_service/client.rb +66 -43
  18. data/lib/google/cloud/retail/v2/product_service/operations.rb +20 -12
  19. data/lib/google/cloud/retail/v2/product_service_pb.rb +3 -2
  20. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +7 -7
  21. data/lib/google/cloud/retail/v2/purge_config_pb.rb +2 -2
  22. data/lib/google/cloud/retail/v2/search_service/client.rb +74 -45
  23. data/lib/google/cloud/retail/v2/search_service.rb +2 -2
  24. data/lib/google/cloud/retail/v2/search_service_pb.rb +11 -2
  25. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +5 -5
  26. data/lib/google/cloud/retail/v2/user_event_pb.rb +2 -2
  27. data/lib/google/cloud/retail/v2/user_event_service/client.rb +37 -17
  28. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +20 -12
  29. data/lib/google/cloud/retail/v2/user_event_service_pb.rb +2 -2
  30. data/lib/google/cloud/retail/v2/user_event_service_services_pb.rb +1 -1
  31. data/lib/google/cloud/retail/v2/version.rb +1 -1
  32. data/proto_docs/google/api/httpbody.rb +7 -3
  33. data/proto_docs/google/cloud/retail/v2/common.rb +6 -5
  34. data/proto_docs/google/cloud/retail/v2/completion_service.rb +14 -12
  35. data/proto_docs/google/cloud/retail/v2/import_config.rb +5 -5
  36. data/proto_docs/google/cloud/retail/v2/product.rb +23 -17
  37. data/proto_docs/google/cloud/retail/v2/product_service.rb +8 -8
  38. data/proto_docs/google/cloud/retail/v2/search_service.rb +141 -74
  39. data/proto_docs/google/cloud/retail/v2/user_event.rb +19 -7
  40. metadata +2 -2
@@ -27,12 +27,8 @@ module Google
27
27
  # @return [::String]
28
28
  # Required. The resource name of the search engine placement, such as
29
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`.
30
+ # This field is used to identify the serving configuration name and the set
31
+ # of models that will be used to make the search.
36
32
  # @!attribute [rw] branch
37
33
  # @return [::String]
38
34
  # The branch resource name, such as
@@ -87,7 +83,8 @@ module Google
87
83
  # @return [::String]
88
84
  # The filter syntax consists of an expression language for constructing a
89
85
  # predicate from one or more fields of the products being filtered. Filter
90
- # expression is case-sensitive.
86
+ # expression is case-sensitive. See more details at this [user
87
+ # guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
91
88
  #
92
89
  # If this field is unrecognizable, an INVALID_ARGUMENT is returned.
93
90
  # @!attribute [rw] canonical_filter
@@ -105,7 +102,9 @@ module Google
105
102
  # @return [::String]
106
103
  # The order in which products are returned. Products can be ordered by
107
104
  # a field in an {::Google::Cloud::Retail::V2::Product Product} object. Leave it
108
- # unset if ordered by relevance. OrderBy expression is case-sensitive.
105
+ # unset if ordered by relevance. OrderBy expression is case-sensitive. See
106
+ # more details at this [user
107
+ # guide](https://cloud.google.com/retail/docs/filter-and-order#order).
109
108
  #
110
109
  # If this field is unrecognizable, an INVALID_ARGUMENT is returned.
111
110
  # @!attribute [rw] facet_specs
@@ -119,16 +118,23 @@ module Google
119
118
  # The specification for dynamically generated facets. Notice that only
120
119
  # textual facets can be dynamically generated.
121
120
  #
122
- # This feature requires additional allowlisting. Contact Retail Support
123
- # (retail-search-support@google.com) if you are interested in using dynamic
124
- # facet feature.
121
+ # This feature requires additional allowlisting. Contact Retail Search
122
+ # support team if you are interested in using dynamic facet feature.
125
123
  # @!attribute [rw] boost_spec
126
124
  # @return [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec]
127
- # Boost specification to boost certain products.
125
+ # Boost specification to boost certain products. See more details at this
126
+ # [user guide](https://cloud.google.com/retail/docs/boosting).
127
+ #
128
+ # Notice that if both [ServingConfig.boost_control_ids][] and
129
+ # [SearchRequest.boost_spec] are set, the boost conditions from both places
130
+ # are evaluated. If a search request matches multiple boost conditions,
131
+ # the final boost score is equal to the sum of the boost scores from all
132
+ # matched boost conditions.
128
133
  # @!attribute [rw] query_expansion_spec
129
134
  # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec]
130
135
  # The query expansion specification that specifies the conditions under which
131
- # query expansion will occur.
136
+ # query expansion will occur. See more details at this [user
137
+ # guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
132
138
  # @!attribute [rw] variant_rollup_keys
133
139
  # @return [::Array<::String>]
134
140
  # The keys to fetch and rollup the matching
@@ -140,10 +146,9 @@ module Google
140
146
  # {::Google::Cloud::Retail::V2::Product Product}s attributes will lead to extra
141
147
  # query latency. Maximum number of keys is 10.
142
148
  #
143
- # For
144
- # {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info},
145
- # a fulfillment type and a fulfillment ID must be provided in the format of
146
- # "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
149
+ # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, a
150
+ # fulfillment type and a fulfillment ID must be provided in the format of
151
+ # "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
147
152
  # "pickupInStore" is fulfillment type and "store123" is the store ID.
148
153
  #
149
154
  # Supported keys are:
@@ -152,26 +157,45 @@ module Google
152
157
  # * price
153
158
  # * originalPrice
154
159
  # * discount
160
+ # * inventory(place_id,price)
155
161
  # * attributes.key, where key is any key in the
156
162
  # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map.
157
- # * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
158
- # [FulfillmentInfo.Type.PICKUP_IN_STORE][].
159
- # * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
160
- # [FulfillmentInfo.Type.SHIP_TO_STORE][].
161
- # * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
162
- # [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
163
- # * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
164
- # [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
165
- # * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
166
- # [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
167
- # * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
168
- # [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
169
- # * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
170
- # [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
171
- # * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
172
- # [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
173
- # * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
174
- # [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
163
+ # * pickupInStore.id, where id is any
164
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
165
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
166
+ # "pickup-in-store".
167
+ # * shipToStore.id, where id is any
168
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
169
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
170
+ # "ship-to-store".
171
+ # * sameDayDelivery.id, where id is any
172
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
173
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
174
+ # "same-day-delivery".
175
+ # * nextDayDelivery.id, where id is any
176
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
177
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
178
+ # "next-day-delivery".
179
+ # * customFulfillment1.id, where id is any
180
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
181
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
182
+ # "custom-type-1".
183
+ # * customFulfillment2.id, where id is any
184
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
185
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
186
+ # "custom-type-2".
187
+ # * customFulfillment3.id, where id is any
188
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
189
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
190
+ # "custom-type-3".
191
+ # * customFulfillment4.id, where id is any
192
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
193
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
194
+ # "custom-type-4".
195
+ # * customFulfillment5.id, where id is any
196
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
197
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
198
+ # "custom-type-5".
175
199
  #
176
200
  # If this field is set to an invalid value other than these, an
177
201
  # INVALID_ARGUMENT error is returned.
@@ -189,6 +213,10 @@ module Google
189
213
  # Category pages include special pages such as sales or promotions. For
190
214
  # instance, a special sale page may have the category hierarchy:
191
215
  # "pageCategories" : ["Sales > 2017 Black Friday Deals"].
216
+ # @!attribute [rw] search_mode
217
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::SearchMode]
218
+ # The search mode of the search request. If not specified, a single search
219
+ # request triggers both product search and faceted search.
192
220
  class SearchRequest
193
221
  include ::Google::Protobuf::MessageExts
194
222
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -269,35 +297,36 @@ module Google
269
297
  # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#query FacetKey.query}
270
298
  # is not specified:
271
299
  #
272
- # Textual facet keys:
273
- # * brands
274
- # * categories
275
- # * genders
276
- # * ageGroups
277
- # * availability
278
- # * colorFamilies
279
- # * colors
280
- # * sizes
281
- # * materials
282
- # * patterns
283
- # * conditions
284
- # * attributes.key
285
- # * pickupInStore
286
- # * shipToStore
287
- # * sameDayDelivery
288
- # * nextDayDelivery
289
- # * customFulfillment1
290
- # * customFulfillment2
291
- # * customFulfillment3
292
- # * customFulfillment4
293
- # * customFulfillment5
300
+ # * textual_field =
301
+ # * "brands"
302
+ # * "categories"
303
+ # * "genders"
304
+ # * "ageGroups"
305
+ # * "availability"
306
+ # * "colorFamilies"
307
+ # * "colors"
308
+ # * "sizes"
309
+ # * "materials"
310
+ # * "patterns"
311
+ # * "conditions"
312
+ # * "attributes.key"
313
+ # * "pickupInStore"
314
+ # * "shipToStore"
315
+ # * "sameDayDelivery"
316
+ # * "nextDayDelivery"
317
+ # * "customFulfillment1"
318
+ # * "customFulfillment2"
319
+ # * "customFulfillment3"
320
+ # * "customFulfillment4"
321
+ # * "customFulfillment5"
294
322
  #
295
- # Numeric facet keys:
296
- # * price
297
- # * discount
298
- # * rating
299
- # * ratingCount
300
- # * attributes.key
323
+ # * numerical_field =
324
+ # * "price"
325
+ # * "discount"
326
+ # * "rating"
327
+ # * "ratingCount"
328
+ # * "attributes.key"
329
+ # * "inventory(place_id,price)"
301
330
  # @!attribute [rw] intervals
302
331
  # @return [::Array<::Google::Cloud::Retail::V2::Interval>]
303
332
  # Set only if values should be bucketized into intervals. Must be set
@@ -361,7 +390,8 @@ module Google
361
390
  # order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
362
391
  # intervals are sorted in the order given by
363
392
  # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals};
364
- # [FulfillmentInfo.ids][] are sorted in the order given by
393
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
394
+ # are sorted in the order given by
365
395
  # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#restricted_values FacetSpec.FacetKey.restricted_values}.
366
396
  # @!attribute [rw] query
367
397
  # @return [::String]
@@ -437,12 +467,10 @@ module Google
437
467
  # Examples:
438
468
  #
439
469
  # * To boost products with product ID "product_1" or "product_2", and
440
- # color "Red" or "Blue":
441
- # ```
442
- # (id: ANY("product_1", "product_2"))
443
- # AND
444
- # (colorFamilies: ANY("Red", "Blue"))
445
- # ```
470
+ # color
471
+ # "Red" or "Blue":
472
+ # * (id: ANY("product_1", "product_2")) AND (colorFamilies:
473
+ # ANY("Red","Blue"))
446
474
  # @!attribute [rw] boost
447
475
  # @return [::Float]
448
476
  # Strength of the condition boost, which should be in [-1, 1]. Negative
@@ -474,6 +502,11 @@ module Google
474
502
  # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition]
475
503
  # The condition under which query expansion should occur. Default to
476
504
  # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
505
+ # @!attribute [rw] pin_unexpanded_results
506
+ # @return [::Boolean]
507
+ # Whether to pin unexpanded results. If this field is set to true,
508
+ # unexpanded products are always at the top of the search results, followed
509
+ # by the expanded results.
477
510
  class QueryExpansionSpec
478
511
  include ::Google::Protobuf::MessageExts
479
512
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -493,6 +526,35 @@ module Google
493
526
  AUTO = 3
494
527
  end
495
528
  end
529
+
530
+ # The search mode of each search request.
531
+ module SearchMode
532
+ # Default value. In this case both product search and faceted search will
533
+ # be performed. Both [SearchResponse.SearchResult] and
534
+ # [SearchResponse.Facet] will be returned.
535
+ SEARCH_MODE_UNSPECIFIED = 0
536
+
537
+ # Only product search will be performed. The faceted search will be
538
+ # disabled.
539
+ #
540
+ # Only [SearchResponse.SearchResult] will be returned.
541
+ # [SearchResponse.Facet] will not be returned, even if
542
+ # {::Google::Cloud::Retail::V2::SearchRequest#facet_specs SearchRequest.facet_specs}
543
+ # or
544
+ # {::Google::Cloud::Retail::V2::SearchRequest#dynamic_facet_spec SearchRequest.dynamic_facet_spec}
545
+ # is set.
546
+ PRODUCT_SEARCH_ONLY = 1
547
+
548
+ # Only faceted search will be performed. The product search will be
549
+ # disabled.
550
+ #
551
+ # When in this mode, one or both of [SearchRequest.facet_spec][] and
552
+ # {::Google::Cloud::Retail::V2::SearchRequest#dynamic_facet_spec SearchRequest.dynamic_facet_spec}
553
+ # should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
554
+ # [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult]
555
+ # will not be returned.
556
+ FACETED_SEARCH_ONLY = 2
557
+ end
496
558
  end
497
559
 
498
560
  # Response message for
@@ -605,10 +667,9 @@ module Google
605
667
  # }
606
668
  # }
607
669
  #
608
- # For
609
- # {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info},
610
- # the rollup values is a double value with type
611
- # {::Google::Protobuf::Value google.protobuf.Value}. For example:
670
+ # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
671
+ # values is a double value with type
672
+ # {::Google::Protobuf::Value google.protobuf.Value}. For example,
612
673
  # `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
613
674
  # are 10 variants in this product are available in the store "store1".
614
675
  class SearchResult
@@ -670,6 +731,12 @@ module Google
670
731
  # @!attribute [rw] expanded_query
671
732
  # @return [::Boolean]
672
733
  # Bool describing whether query expansion has occurred.
734
+ # @!attribute [rw] pinned_result_count
735
+ # @return [::Integer]
736
+ # Number of pinned results. This field will only be set when expansion
737
+ # happens and
738
+ # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
739
+ # is set to true.
673
740
  class QueryExpansionInfo
674
741
  include ::Google::Protobuf::MessageExts
675
742
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -110,12 +110,12 @@ module Google
110
110
  # * `purchase-complete`
111
111
  #
112
112
  # In a `search` event, this field represents the products returned to the end
113
- # user on the current page (the end user may have not finished broswing the
113
+ # user on the current page (the end user may have not finished browsing the
114
114
  # whole page yet). When a new page is returned to the end user, after
115
115
  # pagination/filtering/ordering even for the same query, a new `search` event
116
116
  # with different
117
117
  # {::Google::Cloud::Retail::V2::UserEvent#product_details product_details} is
118
- # desired. The end user may have not finished broswing the whole page yet.
118
+ # desired. The end user may have not finished browsing the whole page yet.
119
119
  # @!attribute [rw] completion_detail
120
120
  # @return [::Google::Cloud::Retail::V2::CompletionDetail]
121
121
  # The main completion details related to the event.
@@ -136,7 +136,7 @@ module Google
136
136
  # search, and etc.
137
137
  # @!attribute [rw] cart_id
138
138
  # @return [::String]
139
- # The id or name of the associated shopping cart. This id is used
139
+ # The ID or name of the associated shopping cart. This ID is used
140
140
  # to associate multiple items added or present in the cart before purchase.
141
141
  #
142
142
  # This can only be set for `add-to-cart`, `purchase-complete`, or
@@ -231,7 +231,7 @@ module Google
231
231
  # Tag Manager, this value is filled in automatically.
232
232
  # @!attribute [rw] page_view_id
233
233
  # @return [::String]
234
- # A unique id of a web page view.
234
+ # A unique ID of a web page view.
235
235
  #
236
236
  # This should be kept the same for all user events triggered from the same
237
237
  # pageview. For example, an item detail page view could trigger multiple
@@ -260,9 +260,21 @@ module Google
260
260
  # @return [::Google::Cloud::Retail::V2::Product]
261
261
  # Required. {::Google::Cloud::Retail::V2::Product Product} information.
262
262
  #
263
- # Only {::Google::Cloud::Retail::V2::Product#id Product.id} field is used when
264
- # ingesting an event, all other product fields are ignored as we will look
265
- # them up from the catalog.
263
+ # Required field(s):
264
+ #
265
+ # * {::Google::Cloud::Retail::V2::Product#id Product.id}
266
+ #
267
+ # Optional override field(s):
268
+ #
269
+ # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
270
+ #
271
+ # If any supported optional fields are provided, we will treat them as a full
272
+ # override when looking up product information from the catalog. Thus, it is
273
+ # important to ensure that the overriding fields are accurate and
274
+ # complete.
275
+ #
276
+ # All other product fields are ignored and instead populated via catalog
277
+ # lookup after event ingestion.
266
278
  # @!attribute [rw] quantity
267
279
  # @return [::Google::Protobuf::Int32Value]
268
280
  # Quantity of the product associated with the user event.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-retail-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2021-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common