google-cloud-retail-v2 0.6.4 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -6
  3. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -4
  4. data/lib/google/cloud/retail/v2/catalog_service/client.rb +9 -9
  5. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +3 -1
  6. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +0 -8
  7. data/lib/google/cloud/retail/v2/common_pb.rb +8 -5
  8. data/lib/google/cloud/retail/v2/completion_service/client.rb +20 -21
  9. data/lib/google/cloud/retail/v2/completion_service/operations.rb +3 -0
  10. data/lib/google/cloud/retail/v2/completion_service.rb +1 -2
  11. data/lib/google/cloud/retail/v2/completion_service_pb.rb +2 -1
  12. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +7 -7
  13. data/lib/google/cloud/retail/v2/import_config_pb.rb +2 -2
  14. data/lib/google/cloud/retail/v2/prediction_service/client.rb +17 -4
  15. data/lib/google/cloud/retail/v2/prediction_service_pb.rb +2 -1
  16. data/lib/google/cloud/retail/v2/product_pb.rb +3 -2
  17. data/lib/google/cloud/retail/v2/product_service/client.rb +337 -23
  18. data/lib/google/cloud/retail/v2/product_service/operations.rb +3 -0
  19. data/lib/google/cloud/retail/v2/product_service_pb.rb +29 -2
  20. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +47 -9
  21. data/lib/google/cloud/retail/v2/promotion_pb.rb +22 -0
  22. data/lib/google/cloud/retail/v2/purge_config_pb.rb +3 -2
  23. data/lib/google/cloud/retail/v2/search_service/client.rb +56 -19
  24. data/lib/google/cloud/retail/v2/search_service.rb +1 -2
  25. data/lib/google/cloud/retail/v2/search_service_pb.rb +28 -3
  26. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +2 -4
  27. data/lib/google/cloud/retail/v2/user_event_pb.rb +2 -2
  28. data/lib/google/cloud/retail/v2/user_event_service/client.rb +4 -3
  29. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +3 -0
  30. data/lib/google/cloud/retail/v2/user_event_service_pb.rb +3 -1
  31. data/lib/google/cloud/retail/v2/user_event_service_services_pb.rb +4 -3
  32. data/lib/google/cloud/retail/v2/version.rb +1 -1
  33. data/lib/google/cloud/retail/v2.rb +2 -0
  34. data/proto_docs/google/cloud/retail/v2/catalog.rb +8 -8
  35. data/proto_docs/google/cloud/retail/v2/catalog_service.rb +9 -0
  36. data/proto_docs/google/cloud/retail/v2/common.rb +100 -25
  37. data/proto_docs/google/cloud/retail/v2/completion_service.rb +28 -18
  38. data/proto_docs/google/cloud/retail/v2/import_config.rb +38 -23
  39. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +19 -6
  40. data/proto_docs/google/cloud/retail/v2/product.rb +50 -41
  41. data/proto_docs/google/cloud/retail/v2/product_service.rb +154 -6
  42. data/proto_docs/google/cloud/retail/v2/promotion.rb +43 -0
  43. data/proto_docs/google/cloud/retail/v2/search_service.rb +162 -28
  44. data/proto_docs/google/cloud/retail/v2/user_event.rb +30 -14
  45. data/proto_docs/google/protobuf/any.rb +3 -3
  46. data/proto_docs/google/protobuf/struct.rb +2 -2
  47. metadata +14 -12
@@ -91,6 +91,11 @@ module Google
91
91
  #
92
92
  # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
93
93
  # is returned.
94
+ #
95
+ # The attribute key can be updated by setting the mask path as
96
+ # "attributes.$\\{key_name}". If a key name is present in the mask but not in
97
+ # the patching product from the request, this key will be deleted after the
98
+ # update.
94
99
  # @!attribute [rw] allow_missing
95
100
  # @return [::Boolean]
96
101
  # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
@@ -263,6 +268,24 @@ module Google
263
268
  # provided or default value for
264
269
  # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}.
265
270
  #
271
+ # The caller can replace place IDs for a subset of fulfillment types in the
272
+ # following ways:
273
+ #
274
+ # * Adds "fulfillment_info" in
275
+ # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}
276
+ # * Specifies only the desired fulfillment types and corresponding place IDs
277
+ # to update in [SetInventoryRequest.inventory.fulfillment_info][]
278
+ #
279
+ # The caller can clear all place IDs from a subset of fulfillment types in
280
+ # the following ways:
281
+ #
282
+ # * Adds "fulfillment_info" in
283
+ # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}
284
+ # * Specifies only the desired fulfillment types to clear in
285
+ # [SetInventoryRequest.inventory.fulfillment_info][]
286
+ # * Checks that only the desired fulfillment info types have empty
287
+ # [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
288
+ #
266
289
  # The last update time is recorded for the following inventory fields:
267
290
  # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
268
291
  # * {::Google::Cloud::Retail::V2::Product#availability Product.availability}
@@ -274,8 +297,9 @@ module Google
274
297
  # @!attribute [rw] set_mask
275
298
  # @return [::Google::Protobuf::FieldMask]
276
299
  # Indicates which inventory fields in the provided
277
- # {::Google::Cloud::Retail::V2::Product Product} to update. If not set or set with
278
- # empty paths, all inventory fields will be updated.
300
+ # {::Google::Cloud::Retail::V2::Product Product} to update.
301
+ #
302
+ # At least one field must be provided.
279
303
  #
280
304
  # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
281
305
  # is returned and the entire update will be ignored.
@@ -313,7 +337,9 @@ module Google
313
337
  extend ::Google::Protobuf::MessageExts::ClassMethods
314
338
  end
315
339
 
316
- # Request message for [AddFulfillmentPlaces][] method.
340
+ # Request message for
341
+ # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces}
342
+ # method.
317
343
  # @!attribute [rw] product
318
344
  # @return [::String]
319
345
  # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
@@ -381,20 +407,141 @@ module Google
381
407
 
382
408
  # Metadata related to the progress of the AddFulfillmentPlaces operation.
383
409
  # Currently empty because there is no meaningful metadata populated from the
384
- # [AddFulfillmentPlaces][] method.
410
+ # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces}
411
+ # method.
385
412
  class AddFulfillmentPlacesMetadata
386
413
  include ::Google::Protobuf::MessageExts
387
414
  extend ::Google::Protobuf::MessageExts::ClassMethods
388
415
  end
389
416
 
390
417
  # Response of the AddFulfillmentPlacesRequest. Currently empty because
391
- # there is no meaningful response populated from the [AddFulfillmentPlaces][]
418
+ # there is no meaningful response populated from the
419
+ # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces}
392
420
  # method.
393
421
  class AddFulfillmentPlacesResponse
394
422
  include ::Google::Protobuf::MessageExts
395
423
  extend ::Google::Protobuf::MessageExts::ClassMethods
396
424
  end
397
425
 
426
+ # Request message for
427
+ # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories}
428
+ # method.
429
+ # @!attribute [rw] product
430
+ # @return [::String]
431
+ # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
432
+ # such as
433
+ # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
434
+ #
435
+ # If the caller does not have permission to access the
436
+ # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
437
+ # exists, a PERMISSION_DENIED error is returned.
438
+ # @!attribute [rw] local_inventories
439
+ # @return [::Array<::Google::Cloud::Retail::V2::LocalInventory>]
440
+ # Required. A list of inventory information at difference places. Each place
441
+ # is identified by its place ID. At most 3000 inventories are allowed per
442
+ # request.
443
+ # @!attribute [rw] add_mask
444
+ # @return [::Google::Protobuf::FieldMask]
445
+ # Indicates which inventory fields in the provided list of
446
+ # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory} to update. The
447
+ # field is updated to the provided value.
448
+ #
449
+ # If a field is set while the place does not have a previous local inventory,
450
+ # the local inventory at that store is created.
451
+ #
452
+ # If a field is set while the value of that field is not provided, the
453
+ # original field value, if it exists, is deleted.
454
+ #
455
+ # If the mask is not set or set with empty paths, all inventory fields will
456
+ # be updated.
457
+ #
458
+ # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
459
+ # is returned and the entire update will be ignored.
460
+ # @!attribute [rw] add_time
461
+ # @return [::Google::Protobuf::Timestamp]
462
+ # The time when the inventory updates are issued. Used to prevent
463
+ # out-of-order updates on local inventory fields. If not provided, the
464
+ # internal system time will be used.
465
+ # @!attribute [rw] allow_missing
466
+ # @return [::Boolean]
467
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
468
+ # found, the local inventory will still be processed and retained for at most
469
+ # 1 day and processed once the {::Google::Cloud::Retail::V2::Product Product} is
470
+ # created. If set to false, a NOT_FOUND error is returned if the
471
+ # {::Google::Cloud::Retail::V2::Product Product} is not found.
472
+ class AddLocalInventoriesRequest
473
+ include ::Google::Protobuf::MessageExts
474
+ extend ::Google::Protobuf::MessageExts::ClassMethods
475
+ end
476
+
477
+ # Metadata related to the progress of the AddLocalInventories operation.
478
+ # Currently empty because there is no meaningful metadata populated from the
479
+ # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories}
480
+ # method.
481
+ class AddLocalInventoriesMetadata
482
+ include ::Google::Protobuf::MessageExts
483
+ extend ::Google::Protobuf::MessageExts::ClassMethods
484
+ end
485
+
486
+ # Response of the
487
+ # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories}
488
+ # API. Currently empty because there is no meaningful response populated from
489
+ # the
490
+ # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories}
491
+ # method.
492
+ class AddLocalInventoriesResponse
493
+ include ::Google::Protobuf::MessageExts
494
+ extend ::Google::Protobuf::MessageExts::ClassMethods
495
+ end
496
+
497
+ # Request message for [RemoveLocalInventories][] method.
498
+ # @!attribute [rw] product
499
+ # @return [::String]
500
+ # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
501
+ # such as
502
+ # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
503
+ #
504
+ # If the caller does not have permission to access the
505
+ # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
506
+ # exists, a PERMISSION_DENIED error is returned.
507
+ # @!attribute [rw] place_ids
508
+ # @return [::Array<::String>]
509
+ # Required. A list of place IDs to have their inventory deleted.
510
+ # At most 3000 place IDs are allowed per request.
511
+ # @!attribute [rw] remove_time
512
+ # @return [::Google::Protobuf::Timestamp]
513
+ # The time when the inventory deletions are issued. Used to prevent
514
+ # out-of-order updates and deletions on local inventory fields. If not
515
+ # provided, the internal system time will be used.
516
+ # @!attribute [rw] allow_missing
517
+ # @return [::Boolean]
518
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
519
+ # found, the local inventory removal request will still be processed and
520
+ # retained for at most 1 day and processed once the
521
+ # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a
522
+ # NOT_FOUND error is returned if the
523
+ # {::Google::Cloud::Retail::V2::Product Product} is not found.
524
+ class RemoveLocalInventoriesRequest
525
+ include ::Google::Protobuf::MessageExts
526
+ extend ::Google::Protobuf::MessageExts::ClassMethods
527
+ end
528
+
529
+ # Metadata related to the progress of the RemoveLocalInventories operation.
530
+ # Currently empty because there is no meaningful metadata populated from the
531
+ # [RemoveLocalInventories][] method.
532
+ class RemoveLocalInventoriesMetadata
533
+ include ::Google::Protobuf::MessageExts
534
+ extend ::Google::Protobuf::MessageExts::ClassMethods
535
+ end
536
+
537
+ # Response of the [RemoveLocalInventories][] API. Currently empty because
538
+ # there is no meaningful response populated from the [RemoveLocalInventories][]
539
+ # method.
540
+ class RemoveLocalInventoriesResponse
541
+ include ::Google::Protobuf::MessageExts
542
+ extend ::Google::Protobuf::MessageExts::ClassMethods
543
+ end
544
+
398
545
  # Request message for [RemoveFulfillmentPlaces][] method.
399
546
  # @!attribute [rw] product
400
547
  # @return [::String]
@@ -425,7 +572,8 @@ module Google
425
572
  # If this field is set to an invalid value other than these, an
426
573
  # INVALID_ARGUMENT error is returned.
427
574
  #
428
- # This field directly corresponds to [Product.fulfillment_info.type][].
575
+ # This field directly corresponds to
576
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}.
429
577
  # @!attribute [rw] place_ids
430
578
  # @return [::Array<::String>]
431
579
  # Required. The IDs for this
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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
+ # Promotion information.
25
+ # @!attribute [rw] promotion_id
26
+ # @return [::String]
27
+ # ID of the promotion. For example, "free gift".
28
+ #
29
+ # The value must be a UTF-8 encoded string with a length limit of 128
30
+ # characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
31
+ # id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
32
+ # returned.
33
+ #
34
+ # Google Merchant Center property
35
+ # [promotion](https://support.google.com/merchants/answer/7050148).
36
+ class Promotion
37
+ include ::Google::Protobuf::MessageExts
38
+ extend ::Google::Protobuf::MessageExts::ClassMethods
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -39,6 +39,11 @@ module Google
39
39
  # @!attribute [rw] query
40
40
  # @return [::String]
41
41
  # Raw search query.
42
+ #
43
+ # If this field is empty, the request is considered a category browsing
44
+ # request and returned results are based on
45
+ # {::Google::Cloud::Retail::V2::SearchRequest#filter filter} and
46
+ # {::Google::Cloud::Retail::V2::SearchRequest#page_categories page_categories}.
42
47
  # @!attribute [rw] visitor_id
43
48
  # @return [::String]
44
49
  # Required. A unique identifier for tracking visitors. For example, this
@@ -46,6 +51,9 @@ module Google
46
51
  # identify a visitor on a single device. This unique identifier should not
47
52
  # change if the visitor logs in or out of the website.
48
53
  #
54
+ # This should be the same identifier as
55
+ # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}.
56
+ #
49
57
  # The field must be a UTF-8 encoded string with a length limit of 128
50
58
  # characters. Otherwise, an INVALID_ARGUMENT error is returned.
51
59
  # @!attribute [rw] user_info
@@ -89,6 +97,9 @@ module Google
89
97
  # If this field is unrecognizable, an INVALID_ARGUMENT is returned.
90
98
  # @!attribute [rw] canonical_filter
91
99
  # @return [::String]
100
+ # The default filter that is applied when a user performs a search without
101
+ # checking any filters on the search page.
102
+ #
92
103
  # The filter applied to every search request when quality improvement such as
93
104
  # query expansion is needed. For example, if a query does not have enough
94
105
  # results, an expanded query with
@@ -115,21 +126,21 @@ module Google
115
126
  # is returned.
116
127
  # @!attribute [rw] dynamic_facet_spec
117
128
  # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec]
129
+ # Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
130
+ # to enable dynamic facets. Do not set this field.
131
+ #
118
132
  # The specification for dynamically generated facets. Notice that only
119
133
  # textual facets can be dynamically generated.
120
- #
121
- # This feature requires additional allowlisting. Contact Retail Search
122
- # support team if you are interested in using dynamic facet feature.
123
134
  # @!attribute [rw] boost_spec
124
135
  # @return [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec]
125
136
  # Boost specification to boost certain products. See more details at this
126
137
  # [user guide](https://cloud.google.com/retail/docs/boosting).
127
138
  #
128
139
  # 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.
140
+ # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec}
141
+ # are set, the boost conditions from both places are evaluated. If a search
142
+ # request matches multiple boost conditions, the final boost score is equal
143
+ # to the sum of the boost scores from all matched boost conditions.
133
144
  # @!attribute [rw] query_expansion_spec
134
145
  # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec]
135
146
  # The query expansion specification that specifies the conditions under which
@@ -139,12 +150,15 @@ module Google
139
150
  # @return [::Array<::String>]
140
151
  # The keys to fetch and rollup the matching
141
152
  # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
142
- # {::Google::Cloud::Retail::V2::Product Product}s attributes. The attributes from
143
- # all the matching {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
144
- # {::Google::Cloud::Retail::V2::Product Product}s are merged and de-duplicated.
145
- # Notice that rollup {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
146
- # {::Google::Cloud::Retail::V2::Product Product}s attributes will lead to extra
147
- # query latency. Maximum number of keys is 10.
153
+ # {::Google::Cloud::Retail::V2::Product Product}s attributes,
154
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo} or
155
+ # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s attributes. The
156
+ # attributes from all the matching
157
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
158
+ # {::Google::Cloud::Retail::V2::Product Product}s or
159
+ # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s are merged and
160
+ # de-duplicated. Notice that rollup attributes will lead to extra query
161
+ # latency. Maximum number of keys is 30.
148
162
  #
149
163
  # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, a
150
164
  # fulfillment type and a fulfillment ID must be provided in the format of
@@ -159,8 +173,10 @@ module Google
159
173
  # * discount
160
174
  # * variantId
161
175
  # * inventory(place_id,price)
176
+ # * inventory(place_id,original_price)
162
177
  # * inventory(place_id,attributes.key), where key is any key in the
163
- # [Product.inventories.attributes][] map.
178
+ # {::Google::Cloud::Retail::V2::LocalInventory#attributes Product.local_inventories.attributes}
179
+ # map.
164
180
  # * attributes.key, where key is any key in the
165
181
  # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map.
166
182
  # * pickupInStore.id, where id is any
@@ -220,6 +236,32 @@ module Google
220
236
  # @return [::Google::Cloud::Retail::V2::SearchRequest::SearchMode]
221
237
  # The search mode of the search request. If not specified, a single search
222
238
  # request triggers both product search and faceted search.
239
+ # @!attribute [rw] personalization_spec
240
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec]
241
+ # The specification for personalization.
242
+ # @!attribute [rw] labels
243
+ # @return [::Google::Protobuf::Map{::String => ::String}]
244
+ # The labels applied to a resource must meet the following requirements:
245
+ #
246
+ # * Each resource can have multiple labels, up to a maximum of 64.
247
+ # * Each label must be a key-value pair.
248
+ # * Keys have a minimum length of 1 character and a maximum length of 63
249
+ # characters and cannot be empty. Values can be empty and have a maximum
250
+ # length of 63 characters.
251
+ # * Keys and values can contain only lowercase letters, numeric characters,
252
+ # underscores, and dashes. All characters must use UTF-8 encoding, and
253
+ # international characters are allowed.
254
+ # * The key portion of a label must be unique. However, you can use the same
255
+ # key with multiple resources.
256
+ # * Keys must start with a lowercase letter or international character.
257
+ #
258
+ # See [Google Cloud
259
+ # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
260
+ # for more details.
261
+ # @!attribute [rw] spell_correction_spec
262
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec]
263
+ # The spell correction specification that specifies the mode under
264
+ # which spell correction will take effect.
223
265
  class SearchRequest
224
266
  include ::Google::Protobuf::MessageExts
225
267
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -239,19 +281,29 @@ module Google
239
281
  # @return [::Array<::String>]
240
282
  # List of keys to exclude when faceting.
241
283
  #
284
+ #
242
285
  # By default,
243
286
  # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
244
287
  # is not excluded from the filter unless it is listed in this field.
245
288
  #
246
- # For example, suppose there are 100 products with color facet "Red" and
247
- # 200 products with color facet "Blue". A query containing the filter
248
- # "colorFamilies:ANY("Red")" and have "colorFamilies" as
289
+ # Listing a facet key in this field allows its values to appear as facet
290
+ # results, even when they are filtered out of search results. Using this
291
+ # field does not affect what search results are returned.
292
+ #
293
+ # For example, suppose there are 100 products with the color facet "Red"
294
+ # and 200 products with the color facet "Blue". A query containing the
295
+ # filter "colorFamilies:ANY("Red")" and having "colorFamilies" as
249
296
  # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
250
- # will by default return the "Red" with count 100.
297
+ # would by default return only "Red" products in the search results, and
298
+ # also return "Red" with count 100 as the only color facet. Although there
299
+ # are also blue products available, "Blue" would not be shown as an
300
+ # available facet value.
251
301
  #
252
- # If this field contains "colorFamilies", then the query returns both the
253
- # "Red" with count 100 and "Blue" with count 200, because the
254
- # "colorFamilies" key is now excluded from the filter.
302
+ # If "colorFamilies" is listed in "excludedFilterKeys", then the query
303
+ # returns the facet values "Red" with count 100 and "Blue" with count
304
+ # 200, because the "colorFamilies" key is now excluded from the filter.
305
+ # Because this field doesn't affect search results, the search results
306
+ # are still correctly filtered to return only "Red" products.
255
307
  #
256
308
  # A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
257
309
  # is returned.
@@ -331,6 +383,7 @@ module Google
331
383
  # * "ratingCount"
332
384
  # * "attributes.key"
333
385
  # * "inventory(place_id,price)"
386
+ # * "inventory(place_id,original_price)"
334
387
  # * "inventory(place_id,attributes.key)"
335
388
  # @!attribute [rw] intervals
336
389
  # @return [::Array<::Google::Cloud::Retail::V2::Interval>]
@@ -342,8 +395,8 @@ module Google
342
395
  # Only get facet for the given restricted values. For example, when using
343
396
  # "pickupInStore" as key and set restricted values to
344
397
  # ["store123", "store456"], only facets for "store123" and "store456" are
345
- # returned. Only supported on textual fields and fulfillments.
346
- # Maximum is 20.
398
+ # returned. Only supported on predefined textual fields, custom textual
399
+ # attributes and fulfillments. Maximum is 20.
347
400
  #
348
401
  # Must be set for the fulfillment facet keys:
349
402
  #
@@ -456,7 +509,15 @@ module Google
456
509
  # Condition boost specifications. If a product matches multiple conditions
457
510
  # in the specifictions, boost scores from these specifications are all
458
511
  # applied and combined in a non-linear way. Maximum number of
459
- # specifications is 10.
512
+ # specifications is 20.
513
+ # @!attribute [rw] skip_boost_spec_validation
514
+ # @return [::Boolean]
515
+ # Whether to skip boostspec validation. If this field is set to true,
516
+ # invalid
517
+ # {::Google::Cloud::Retail::V2::SearchRequest::BoostSpec#condition_boost_specs BoostSpec.condition_boost_specs}
518
+ # will be ignored and valid
519
+ # {::Google::Cloud::Retail::V2::SearchRequest::BoostSpec#condition_boost_specs BoostSpec.condition_boost_specs}
520
+ # will still be applied.
460
521
  class BoostSpec
461
522
  include ::Google::Protobuf::MessageExts
462
523
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -532,6 +593,66 @@ module Google
532
593
  end
533
594
  end
534
595
 
596
+ # The specification for personalization.
597
+ # @!attribute [rw] mode
598
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode]
599
+ # Defaults to
600
+ # {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
601
+ class PersonalizationSpec
602
+ include ::Google::Protobuf::MessageExts
603
+ extend ::Google::Protobuf::MessageExts::ClassMethods
604
+
605
+ # The personalization mode of each search request.
606
+ module Mode
607
+ # Default value. Defaults to
608
+ # {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
609
+ MODE_UNSPECIFIED = 0
610
+
611
+ # Let CRS decide whether to use personalization.
612
+ AUTO = 1
613
+
614
+ # Disable personalization.
615
+ DISABLED = 2
616
+ end
617
+ end
618
+
619
+ # The specification for query spell correction.
620
+ # @!attribute [rw] mode
621
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec::Mode]
622
+ # The mode under which spell correction should take effect to
623
+ # replace the original search query. Default to
624
+ # {::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
625
+ class SpellCorrectionSpec
626
+ include ::Google::Protobuf::MessageExts
627
+ extend ::Google::Protobuf::MessageExts::ClassMethods
628
+
629
+ # Enum describing under which mode spell correction should occur.
630
+ module Mode
631
+ # Unspecified spell correction mode. This defaults to
632
+ # {::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
633
+ MODE_UNSPECIFIED = 0
634
+
635
+ # Google Retail Search will try to find a spell suggestion if there
636
+ # is any and put in the
637
+ # {::Google::Cloud::Retail::V2::SearchResponse#corrected_query SearchResponse.corrected_query}.
638
+ # The spell suggestion will not be used as the search query.
639
+ SUGGESTION_ONLY = 1
640
+
641
+ # Automatic spell correction built by Google Retail Search. Search will
642
+ # be based on the corrected query if found.
643
+ AUTO = 2
644
+ end
645
+ end
646
+
647
+ # @!attribute [rw] key
648
+ # @return [::String]
649
+ # @!attribute [rw] value
650
+ # @return [::String]
651
+ class LabelsEntry
652
+ include ::Google::Protobuf::MessageExts
653
+ extend ::Google::Protobuf::MessageExts::ClassMethods
654
+ end
655
+
535
656
  # The search mode of each search request.
536
657
  module SearchMode
537
658
  # Default value. In this case both product search and faceted search will
@@ -553,7 +674,9 @@ module Google
553
674
  # Only faceted search will be performed. The product search will be
554
675
  # disabled.
555
676
  #
556
- # When in this mode, one or both of [SearchRequest.facet_spec][] and
677
+ # When in this mode, one or both of
678
+ # {::Google::Cloud::Retail::V2::SearchRequest#facet_specs SearchRequest.facet_specs}
679
+ # and
557
680
  # {::Google::Cloud::Retail::V2::SearchRequest#dynamic_facet_spec SearchRequest.dynamic_facet_spec}
558
681
  # should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
559
682
  # [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult]
@@ -579,7 +702,9 @@ module Google
579
702
  # matches.
580
703
  # @!attribute [rw] corrected_query
581
704
  # @return [::String]
582
- # If spell correction applies, the corrected query. Otherwise, empty.
705
+ # Contains the spell corrected query, if found. If the spell correction type
706
+ # is AUTOMATIC, then the search results are based on corrected_query.
707
+ # Otherwise the original query will be used for search.
583
708
  # @!attribute [rw] attribution_token
584
709
  # @return [::String]
585
710
  # A unique search token. This should be included in the
@@ -597,10 +722,19 @@ module Google
597
722
  # @!attribute [rw] redirect_uri
598
723
  # @return [::String]
599
724
  # The URI of a customer-defined redirect page. If redirect action is
600
- # triggered, no search will be performed, and only
725
+ # triggered, no search is performed, and only
601
726
  # {::Google::Cloud::Retail::V2::SearchResponse#redirect_uri redirect_uri} and
602
727
  # {::Google::Cloud::Retail::V2::SearchResponse#attribution_token attribution_token}
603
- # will be set in the response.
728
+ # are set in the response.
729
+ # @!attribute [rw] applied_controls
730
+ # @return [::Array<::String>]
731
+ # The fully qualified resource name of applied
732
+ # [controls](https://cloud.google.com/retail/docs/serving-control-rules).
733
+ # @!attribute [rw] invalid_condition_boost_specs
734
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::BoostSpec::ConditionBoostSpec>]
735
+ # The invalid
736
+ # {::Google::Cloud::Retail::V2::SearchRequest::BoostSpec#condition_boost_specs SearchRequest.BoostSpec.condition_boost_specs}
737
+ # that are not applied during serving.
604
738
  class SearchResponse
605
739
  include ::Google::Protobuf::MessageExts
606
740
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -30,7 +30,6 @@ module Google
30
30
  # * `add-to-cart`: Products being added to cart.
31
31
  # * `category-page-view`: Special pages such as sale or promotion pages
32
32
  # viewed.
33
- # * `completion`: Completion query result showed/clicked.
34
33
  # * `detail-page-view`: Products detail page viewed.
35
34
  # * `home-page-view`: Homepage viewed.
36
35
  # * `promotion-offered`: Promotion is offered to a user.
@@ -46,11 +45,15 @@ module Google
46
45
  # able to uniquely identify a visitor on a single device. This unique
47
46
  # identifier should not change if the visitor log in/out of the website.
48
47
  #
48
+ # Don't set the field to the same fixed ID for different users. This mixes
49
+ # the event history of those users together, which results in degraded model
50
+ # quality.
51
+ #
49
52
  # The field must be a UTF-8 encoded string with a length limit of 128
50
53
  # characters. Otherwise, an INVALID_ARGUMENT error is returned.
51
54
  #
52
55
  # The field should not contain PII or user-data. We recommend to use Google
53
- # Analystics [Client
56
+ # Analytics [Client
54
57
  # ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
55
58
  # for this field.
56
59
  # @!attribute [rw] session_id
@@ -103,7 +106,7 @@ module Google
103
106
  # @return [::Array<::Google::Cloud::Retail::V2::ProductDetail>]
104
107
  # The main product details related to the event.
105
108
  #
106
- # This field is required for the following event types:
109
+ # This field is optional except for the following event types:
107
110
  #
108
111
  # * `add-to-cart`
109
112
  # * `detail-page-view`
@@ -118,22 +121,35 @@ module Google
118
121
  # desired. The end user may have not finished browsing the whole page yet.
119
122
  # @!attribute [rw] completion_detail
120
123
  # @return [::Google::Cloud::Retail::V2::CompletionDetail]
121
- # The main completion details related to the event.
124
+ # The main auto-completion details related to the event.
122
125
  #
123
- # In a `completion` event, this field represents the completions returned to
124
- # the end user and the clicked completion by the end user. In a `search`
125
- # event, it represents the search event happens after clicking completion.
126
+ # This field should be set for `search` event when autocomplete function is
127
+ # enabled and the user clicks a suggestion for search.
126
128
  # @!attribute [rw] attributes
127
129
  # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}]
128
130
  # Extra user event features to include in the recommendation model.
129
131
  #
130
- # The key must be a UTF-8 encoded string with a length limit of 5,000
131
- # characters. Otherwise, an INVALID_ARGUMENT error is returned.
132
- #
133
- # For product recommendation, an example of extra user information is
134
- # traffic_channel, i.e. how user arrives at the site. Users can arrive
135
- # at the site by coming to the site directly, or coming through Google
136
- # search, and etc.
132
+ # If you provide custom attributes for ingested user events, also include
133
+ # them in the user events that you associate with prediction requests. Custom
134
+ # attribute formatting must be consistent between imported events and events
135
+ # provided with prediction requests. This lets the Retail API use
136
+ # those custom attributes when training models and serving predictions, which
137
+ # helps improve recommendation quality.
138
+ #
139
+ # This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
140
+ # error is returned:
141
+ #
142
+ # * The key must be a UTF-8 encoded string with a length limit of 5,000
143
+ # characters.
144
+ # * For text attributes, at most 400 values are allowed. Empty values are not
145
+ # allowed. Each value must be a UTF-8 encoded string with a length limit of
146
+ # 256 characters.
147
+ # * For number attributes, at most 400 values are allowed.
148
+ #
149
+ # For product recommendations, an example of extra user information is
150
+ # traffic_channel, which is how a user arrives at the site. Users can arrive
151
+ # at the site by coming to the site directly, coming through Google
152
+ # search, or in other ways.
137
153
  # @!attribute [rw] cart_id
138
154
  # @return [::String]
139
155
  # The ID or name of the associated shopping cart. This ID is used