google-cloud-retail-v2 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/retail/v2.rb +2 -0
  3. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -0
  4. data/lib/google/cloud/retail/v2/catalog_service/client.rb +203 -4
  5. data/lib/google/cloud/retail/v2/catalog_service/paths.rb +21 -0
  6. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +16 -0
  7. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +46 -0
  8. data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
  9. data/lib/google/cloud/retail/v2/completion_service.rb +54 -0
  10. data/lib/google/cloud/retail/v2/completion_service/client.rb +546 -0
  11. data/lib/google/cloud/retail/v2/completion_service/credentials.rb +51 -0
  12. data/lib/google/cloud/retail/v2/completion_service/operations.rb +655 -0
  13. data/lib/google/cloud/retail/v2/completion_service/paths.rb +52 -0
  14. data/lib/google/cloud/retail/v2/completion_service_pb.rb +50 -0
  15. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +61 -0
  16. data/lib/google/cloud/retail/v2/import_config_pb.rb +32 -0
  17. data/lib/google/cloud/retail/v2/prediction_service/client.rb +34 -33
  18. data/lib/google/cloud/retail/v2/product_pb.rb +21 -0
  19. data/lib/google/cloud/retail/v2/product_service/client.rb +632 -4
  20. data/lib/google/cloud/retail/v2/product_service_pb.rb +56 -0
  21. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +75 -0
  22. data/lib/google/cloud/retail/v2/search_service.rb +53 -0
  23. data/lib/google/cloud/retail/v2/search_service/client.rb +541 -0
  24. data/lib/google/cloud/retail/v2/search_service/credentials.rb +51 -0
  25. data/lib/google/cloud/retail/v2/search_service/paths.rb +54 -0
  26. data/lib/google/cloud/retail/v2/search_service_pb.rb +131 -0
  27. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +53 -0
  28. data/lib/google/cloud/retail/v2/user_event_pb.rb +11 -0
  29. data/lib/google/cloud/retail/v2/user_event_service/client.rb +1 -1
  30. data/lib/google/cloud/retail/v2/user_event_service/paths.rb +19 -0
  31. data/lib/google/cloud/retail/v2/version.rb +1 -1
  32. data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
  33. data/proto_docs/google/cloud/retail/v2/catalog_service.rb +53 -4
  34. data/proto_docs/google/cloud/retail/v2/common.rb +272 -4
  35. data/proto_docs/google/cloud/retail/v2/completion_service.rb +162 -0
  36. data/proto_docs/google/cloud/retail/v2/import_config.rb +122 -6
  37. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +32 -31
  38. data/proto_docs/google/cloud/retail/v2/product.rb +266 -10
  39. data/proto_docs/google/cloud/retail/v2/product_service.rb +362 -2
  40. data/proto_docs/google/cloud/retail/v2/purge_config.rb +1 -1
  41. data/proto_docs/google/cloud/retail/v2/search_service.rb +820 -0
  42. data/proto_docs/google/cloud/retail/v2/user_event.rb +95 -3
  43. data/proto_docs/google/type/date.rb +53 -0
  44. metadata +18 -2
@@ -21,8 +21,79 @@ module Google
21
21
  module Cloud
22
22
  module Retail
23
23
  module V2
24
+ # An intended audience of the {::Google::Cloud::Retail::V2::Product Product} for
25
+ # whom it's sold.
26
+ # @!attribute [rw] genders
27
+ # @return [::Array<::String>]
28
+ # The genders of the audience. Strongly encouraged to use the standard
29
+ # values: "male", "female", "unisex".
30
+ #
31
+ # At most 5 values are allowed. Each value must be a UTF-8 encoded string
32
+ # with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
33
+ # is returned.
34
+ #
35
+ # Google Merchant Center property
36
+ # [gender](https://support.google.com/merchants/answer/6324479). Schema.org
37
+ # property
38
+ # [Product.audience.suggestedGender](https://schema.org/suggestedGender).
39
+ # @!attribute [rw] age_groups
40
+ # @return [::Array<::String>]
41
+ # The age groups of the audience. Strongly encouraged to use the standard
42
+ # values: "newborn" (up to 3 months old), "infant" (3–12 months old),
43
+ # "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
44
+ # teens or older).
45
+ #
46
+ # At most 5 values are allowed. Each value must be a UTF-8 encoded string
47
+ # with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
48
+ # is returned.
49
+ #
50
+ # Google Merchant Center property
51
+ # [age_group](https://support.google.com/merchants/answer/6324463).
52
+ # Schema.org property
53
+ # [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
54
+ # [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
55
+ class Audience
56
+ include ::Google::Protobuf::MessageExts
57
+ extend ::Google::Protobuf::MessageExts::ClassMethods
58
+ end
59
+
60
+ # The color information of a {::Google::Cloud::Retail::V2::Product Product}.
61
+ # @!attribute [rw] color_families
62
+ # @return [::Array<::String>]
63
+ # The standard color families. Strongly recommended to use the following
64
+ # standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
65
+ # "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
66
+ # "Mixed". Normally it is expected to have only 1 color family. May consider
67
+ # using single "Mixed" instead of multiple values.
68
+ #
69
+ # A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
70
+ # string with a length limit of 128 characters. Otherwise, an
71
+ # INVALID_ARGUMENT error is returned.
72
+ #
73
+ # Google Merchant Center property
74
+ # [color](https://support.google.com/merchants/answer/6324487). Schema.org
75
+ # property [Product.color](https://schema.org/color).
76
+ # @!attribute [rw] colors
77
+ # @return [::Array<::String>]
78
+ # The color display names, which may be different from standard color family
79
+ # names, such as the color aliases used in the website frontend. Normally
80
+ # it is expected to have only 1 color. May consider using single "Mixed"
81
+ # instead of multiple values.
82
+ #
83
+ # A maximum of 5 colors are allowed. Each value must be a UTF-8 encoded
84
+ # string with a length limit of 128 characters. Otherwise, an
85
+ # INVALID_ARGUMENT error is returned.
86
+ #
87
+ # Google Merchant Center property
88
+ # [color](https://support.google.com/merchants/answer/6324487). Schema.org
89
+ # property [Product.color](https://schema.org/color).
90
+ class ColorInfo
91
+ include ::Google::Protobuf::MessageExts
92
+ extend ::Google::Protobuf::MessageExts::ClassMethods
93
+ end
94
+
24
95
  # A custom attribute that is not explicitly modeled in
25
- # {::Google::Cloud::Retail::V2::Product Product}].
96
+ # {::Google::Cloud::Retail::V2::Product Product}.
26
97
  # @!attribute [rw] text
27
98
  # @return [::Array<::String>]
28
99
  # The textual values of this custom attribute. For example, `["yellow",
@@ -46,11 +117,71 @@ module Google
46
117
  # Exactly one of {::Google::Cloud::Retail::V2::CustomAttribute#text text} or
47
118
  # {::Google::Cloud::Retail::V2::CustomAttribute#numbers numbers} should be set.
48
119
  # Otherwise, an INVALID_ARGUMENT error is returned.
120
+ # @!attribute [rw] searchable
121
+ # @return [::Boolean]
122
+ # If true, custom attribute values are searchable by text queries in
123
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}.
124
+ #
125
+ # This field is ignored in a {::Google::Cloud::Retail::V2::UserEvent UserEvent}.
126
+ #
127
+ # Only set if type {::Google::Cloud::Retail::V2::CustomAttribute#text text} is
128
+ # set. Otherwise, a INVALID_ARGUMENT error is returned.
129
+ # @!attribute [rw] indexable
130
+ # @return [::Boolean]
131
+ # If true, custom attribute values are indexed, so that it can be filtered,
132
+ # faceted or boosted in
133
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}.
134
+ #
135
+ # This field is ignored in a {::Google::Cloud::Retail::V2::UserEvent UserEvent}.
136
+ #
137
+ # See {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},
138
+ # {::Google::Cloud::Retail::V2::SearchRequest#facet_specs SearchRequest.facet_specs}
139
+ # and
140
+ # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec}
141
+ # for more details.
49
142
  class CustomAttribute
50
143
  include ::Google::Protobuf::MessageExts
51
144
  extend ::Google::Protobuf::MessageExts::ClassMethods
52
145
  end
53
146
 
147
+ # Fulfillment information, such as the store IDs for in-store pickup or region
148
+ # IDs for different shipping methods.
149
+ # @!attribute [rw] type
150
+ # @return [::String]
151
+ # The fulfillment type, including commonly used types (such as pickup in
152
+ # store and same day delivery), and custom types. Customers have to map
153
+ # custom types to their display names before rendering UI.
154
+ #
155
+ # Supported values:
156
+ #
157
+ # * "pickup-in-store"
158
+ # * "ship-to-store"
159
+ # * "same-day-delivery"
160
+ # * "next-day-delivery"
161
+ # * "custom-type-1"
162
+ # * "custom-type-2"
163
+ # * "custom-type-3"
164
+ # * "custom-type-4"
165
+ # * "custom-type-5"
166
+ #
167
+ # If this field is set to an invalid value other than these, an
168
+ # INVALID_ARGUMENT error is returned.
169
+ # @!attribute [rw] place_ids
170
+ # @return [::Array<::String>]
171
+ # The IDs for this {::Google::Cloud::Retail::V2::FulfillmentInfo#type type}, such
172
+ # as the store IDs for
173
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type.pickup-in-store}
174
+ # or the region IDs for
175
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type.same-day-delivery}.
176
+ #
177
+ # A maximum of 2000 values are allowed. Each value must be a string with a
178
+ # length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
179
+ # "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
180
+ class FulfillmentInfo
181
+ include ::Google::Protobuf::MessageExts
182
+ extend ::Google::Protobuf::MessageExts::ClassMethods
183
+ end
184
+
54
185
  # {::Google::Cloud::Retail::V2::Product Product} thumbnail/detail image.
55
186
  # @!attribute [rw] uri
56
187
  # @return [::String]
@@ -79,6 +210,24 @@ module Google
79
210
  extend ::Google::Protobuf::MessageExts::ClassMethods
80
211
  end
81
212
 
213
+ # A floating point interval.
214
+ # @!attribute [rw] minimum
215
+ # @return [::Float]
216
+ # Inclusive lower bound.
217
+ # @!attribute [rw] exclusive_minimum
218
+ # @return [::Float]
219
+ # Exclusive lower bound.
220
+ # @!attribute [rw] maximum
221
+ # @return [::Float]
222
+ # Inclusive upper bound.
223
+ # @!attribute [rw] exclusive_maximum
224
+ # @return [::Float]
225
+ # Exclusive upper bound.
226
+ class Interval
227
+ include ::Google::Protobuf::MessageExts
228
+ extend ::Google::Protobuf::MessageExts::ClassMethods
229
+ end
230
+
82
231
  # The price information of a {::Google::Cloud::Retail::V2::Product Product}.
83
232
  # @!attribute [rw] currency_code
84
233
  # @return [::String]
@@ -87,6 +236,13 @@ module Google
87
236
  #
88
237
  # If this field is an unrecognizable currency code, an INVALID_ARGUMENT
89
238
  # error is returned.
239
+ #
240
+ # The {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT}
241
+ # {::Google::Cloud::Retail::V2::Product Product}s with the same
242
+ # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id}
243
+ # must share the same
244
+ # {::Google::Cloud::Retail::V2::PriceInfo#currency_code currency_code}. Otherwise,
245
+ # a FAILED_PRECONDITION error is returned.
90
246
  # @!attribute [rw] price
91
247
  # @return [::Float]
92
248
  # Price of the product.
@@ -108,9 +264,102 @@ module Google
108
264
  #
109
265
  # Google Merchant Center property
110
266
  # [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
267
+ # @!attribute [rw] price_effective_time
268
+ # @return [::Google::Protobuf::Timestamp]
269
+ # The timestamp when the {::Google::Cloud::Retail::V2::PriceInfo#price price}
270
+ # starts to be effective. This can be set as a future timestamp, and the
271
+ # {::Google::Cloud::Retail::V2::PriceInfo#price price} is only used for search
272
+ # after
273
+ # {::Google::Cloud::Retail::V2::PriceInfo#price_effective_time price_effective_time}.
274
+ # If so, the
275
+ # {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} must be
276
+ # set and {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price}
277
+ # is used before
278
+ # {::Google::Cloud::Retail::V2::PriceInfo#price_effective_time price_effective_time}.
279
+ #
280
+ # Do not set if {::Google::Cloud::Retail::V2::PriceInfo#price price} is always
281
+ # effective because it will cause additional latency during search.
282
+ # @!attribute [rw] price_expire_time
283
+ # @return [::Google::Protobuf::Timestamp]
284
+ # The timestamp when the {::Google::Cloud::Retail::V2::PriceInfo#price price}
285
+ # stops to be effective. The {::Google::Cloud::Retail::V2::PriceInfo#price price}
286
+ # is used for search before
287
+ # {::Google::Cloud::Retail::V2::PriceInfo#price_expire_time price_expire_time}. If
288
+ # this field is set, the
289
+ # {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} must be
290
+ # set and {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price}
291
+ # is used after
292
+ # {::Google::Cloud::Retail::V2::PriceInfo#price_expire_time price_expire_time}.
293
+ #
294
+ # Do not set if {::Google::Cloud::Retail::V2::PriceInfo#price price} is always
295
+ # effective because it will cause additional latency during search.
296
+ # @!attribute [r] price_range
297
+ # @return [::Google::Cloud::Retail::V2::PriceInfo::PriceRange]
298
+ # Output only. The price range of all the child
299
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT}
300
+ # {::Google::Cloud::Retail::V2::Product Product}s grouped together on the
301
+ # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
302
+ # {::Google::Cloud::Retail::V2::Product Product}. Only populated for
303
+ # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
304
+ # {::Google::Cloud::Retail::V2::Product Product}s.
305
+ #
306
+ # Note: This field is OUTPUT_ONLY for
307
+ # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct}.
308
+ # Do not set this field in API requests.
111
309
  class PriceInfo
112
310
  include ::Google::Protobuf::MessageExts
113
311
  extend ::Google::Protobuf::MessageExts::ClassMethods
312
+
313
+ # The price range of all
314
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
315
+ # {::Google::Cloud::Retail::V2::Product Product} having the same
316
+ # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id}.
317
+ # @!attribute [rw] price
318
+ # @return [::Google::Cloud::Retail::V2::Interval]
319
+ # The inclusive
320
+ # {::Google::Cloud::Retail::V2::PriceInfo#price Product.pricing_info.price}
321
+ # interval of all {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
322
+ # {::Google::Cloud::Retail::V2::Product Product} having the same
323
+ # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id}.
324
+ # @!attribute [rw] original_price
325
+ # @return [::Google::Cloud::Retail::V2::Interval]
326
+ # The inclusive
327
+ # {::Google::Cloud::Retail::V2::PriceInfo#original_price Product.pricing_info.original_price}
328
+ # internal of all {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
329
+ # {::Google::Cloud::Retail::V2::Product Product} having the same
330
+ # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id}.
331
+ class PriceRange
332
+ include ::Google::Protobuf::MessageExts
333
+ extend ::Google::Protobuf::MessageExts::ClassMethods
334
+ end
335
+ end
336
+
337
+ # The rating of a {::Google::Cloud::Retail::V2::Product Product}.
338
+ # @!attribute [rw] rating_count
339
+ # @return [::Integer]
340
+ # The total number of ratings. This value is independent of the value of
341
+ # {::Google::Cloud::Retail::V2::Rating#rating_histogram rating_histogram}.
342
+ #
343
+ # This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
344
+ # returned.
345
+ # @!attribute [rw] average_rating
346
+ # @return [::Float]
347
+ # The average rating of the {::Google::Cloud::Retail::V2::Product Product}.
348
+ #
349
+ # The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
350
+ # returned.
351
+ # @!attribute [rw] rating_histogram
352
+ # @return [::Array<::Integer>]
353
+ # List of rating counts per rating value (index = rating - 1). The list is
354
+ # empty if there is no rating. If the list is non-empty, its size is
355
+ # always 5. Otherwise, an INVALID_ARGUMENT error is returned.
356
+ #
357
+ # For example, [41, 14, 13, 47, 303]. It means that the
358
+ # {::Google::Cloud::Retail::V2::Product Product} got 41 ratings with 1 star, 14
359
+ # ratings with 2 star, and so on.
360
+ class Rating
361
+ include ::Google::Protobuf::MessageExts
362
+ extend ::Google::Protobuf::MessageExts::ClassMethods
114
363
  end
115
364
 
116
365
  # Information of an end user.
@@ -123,8 +372,9 @@ module Google
123
372
  # characters. Otherwise, an INVALID_ARGUMENT error is returned.
124
373
  # @!attribute [rw] ip_address
125
374
  # @return [::String]
126
- # The end user's IP address. This field is used to extract location
127
- # information for personalization.
375
+ # The end user's IP address. Required for getting
376
+ # [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
377
+ # This field is used to extract location information for personalization.
128
378
  #
129
379
  # This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
130
380
  # address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
@@ -137,7 +387,8 @@ module Google
137
387
  # is set.
138
388
  # @!attribute [rw] user_agent
139
389
  # @return [::String]
140
- # User agent as included in the HTTP header.
390
+ # User agent as included in the HTTP header. Required for getting
391
+ # [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
141
392
  #
142
393
  # The field must be a UTF-8 encoded string with a length limit of 1,000
143
394
  # characters. Otherwise, an INVALID_ARGUMENT error is returned.
@@ -163,6 +414,23 @@ module Google
163
414
  include ::Google::Protobuf::MessageExts
164
415
  extend ::Google::Protobuf::MessageExts::ClassMethods
165
416
  end
417
+
418
+ # Promotion information.
419
+ # @!attribute [rw] promotion_id
420
+ # @return [::String]
421
+ # ID of the promotion. For example, "free gift".
422
+ #
423
+ # The value value must be a UTF-8 encoded string with a length limit of 128
424
+ # characters, and match the pattern: [a-zA-Z][a-zA-Z0-9_]*. For example,
425
+ # id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
426
+ # returned.
427
+ #
428
+ # Google Merchant Center property
429
+ # [promotion](https://support.google.com/merchants/answer/7050148).
430
+ class Promotion
431
+ include ::Google::Protobuf::MessageExts
432
+ extend ::Google::Protobuf::MessageExts::ClassMethods
433
+ end
166
434
  end
167
435
  end
168
436
  end
@@ -0,0 +1,162 @@
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
+ # Auto-complete parameters.
25
+ # @!attribute [rw] catalog
26
+ # @return [::String]
27
+ # Required. Catalog for which the completion is performed.
28
+ #
29
+ # Full resource name of catalog, such as
30
+ # `projects/*/locations/global/catalogs/default_catalog`.
31
+ # @!attribute [rw] query
32
+ # @return [::String]
33
+ # Required. The query used to generate suggestions.
34
+ #
35
+ # The maximum number of allowed characters is 255.
36
+ # @!attribute [rw] visitor_id
37
+ # @return [::String]
38
+ # A unique identifier for tracking visitors. For example, this could be
39
+ # implemented with an HTTP cookie, which should be able to uniquely identify
40
+ # a visitor on a single device. This unique identifier should not change if
41
+ # the visitor logs in or out of the website.
42
+ #
43
+ # The field must be a UTF-8 encoded string with a length limit of 128
44
+ # characters. Otherwise, an INVALID_ARGUMENT error is returned.
45
+ # @!attribute [rw] language_codes
46
+ # @return [::Array<::String>]
47
+ # The list of languages of the query. This is
48
+ # the BCP-47 language code, such as "en-US" or "sr-Latn".
49
+ # For more information, see
50
+ # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47).
51
+ #
52
+ # The maximum number of allowed characters is 255.
53
+ # Only "en-US" is currently supported.
54
+ # @!attribute [rw] device_type
55
+ # @return [::String]
56
+ # The device type context for completion suggestions.
57
+ # It is useful to apply different suggestions on different device types, e.g.
58
+ # DESKTOP, MOBILE. If it is empty, the suggestions are across all device
59
+ # types.
60
+ #
61
+ # Supported formats:
62
+ #
63
+ # * UNKNOWN_DEVICE_TYPE
64
+ #
65
+ # * DESKTOP
66
+ #
67
+ # * MOBILE
68
+ #
69
+ # * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
70
+ # @!attribute [rw] dataset
71
+ # @return [::String]
72
+ # Determines which dataset to use for fetching completion. "user-data" will
73
+ # use the imported dataset through
74
+ # {::Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data CompletionService.ImportCompletionData}.
75
+ # "cloud-retail" will use the dataset generated by cloud retail based on user
76
+ # events. If leave empty, it will use the "user-data".
77
+ #
78
+ # Current supported values:
79
+ #
80
+ # * user-data
81
+ #
82
+ # * cloud-retail
83
+ # This option is not automatically enabled. Before using cloud-retail,
84
+ # contact retail-search-support@google.com first.
85
+ # @!attribute [rw] max_suggestions
86
+ # @return [::Integer]
87
+ # Completion max suggestions.
88
+ #
89
+ # The maximum allowed max suggestions is 20. The default value is 20.
90
+ class CompleteQueryRequest
91
+ include ::Google::Protobuf::MessageExts
92
+ extend ::Google::Protobuf::MessageExts::ClassMethods
93
+ end
94
+
95
+ # Response of the auto-complete query.
96
+ # @!attribute [rw] completion_results
97
+ # @return [::Array<::Google::Cloud::Retail::V2::CompleteQueryResponse::CompletionResult>]
98
+ # Results of the matching suggestions. The result list is ordered and the
99
+ # first result is top suggestion.
100
+ # @!attribute [rw] attribution_token
101
+ # @return [::String]
102
+ # A unique complete token. This should be included in the
103
+ # {::Google::Cloud::Retail::V2::SearchRequest SearchRequest} resulting from this
104
+ # completion, which enables accurate attribution of complete model
105
+ # performance.
106
+ # @!attribute [rw] recent_search_results
107
+ # @return [::Array<::Google::Cloud::Retail::V2::CompleteQueryResponse::RecentSearchResult>]
108
+ # Matched recent searches of this user. This field is a restricted feature.
109
+ # Contact Retail Support (retail-search-support@google.com) if you are
110
+ # interested in enabling it.
111
+ #
112
+ # This feature is only available when
113
+ # {::Google::Cloud::Retail::V2::CompleteQueryRequest#visitor_id CompleteQueryRequest.visitor_id}
114
+ # field is set and {::Google::Cloud::Retail::V2::UserEvent UserEvent} is imported.
115
+ # The recent searches satisfy the follow rules:
116
+ # * They are ordered from latest to oldest.
117
+ # * They are matched with
118
+ # {::Google::Cloud::Retail::V2::CompleteQueryRequest#query CompleteQueryRequest.query}
119
+ # case insensitively.
120
+ # * They are transformed to lower cases.
121
+ # * They are UTF-8 safe.
122
+ #
123
+ # Recent searches are deduplicated. More recent searches will be reserved
124
+ # when duplication happens.
125
+ class CompleteQueryResponse
126
+ include ::Google::Protobuf::MessageExts
127
+ extend ::Google::Protobuf::MessageExts::ClassMethods
128
+
129
+ # Resource that represents completion results.
130
+ # @!attribute [rw] suggestion
131
+ # @return [::String]
132
+ # The suggestion for the query.
133
+ # @!attribute [rw] attributes
134
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}]
135
+ # Additional custom attributes ingested through BigQuery.
136
+ class CompletionResult
137
+ include ::Google::Protobuf::MessageExts
138
+ extend ::Google::Protobuf::MessageExts::ClassMethods
139
+
140
+ # @!attribute [rw] key
141
+ # @return [::String]
142
+ # @!attribute [rw] value
143
+ # @return [::Google::Cloud::Retail::V2::CustomAttribute]
144
+ class AttributesEntry
145
+ include ::Google::Protobuf::MessageExts
146
+ extend ::Google::Protobuf::MessageExts::ClassMethods
147
+ end
148
+ end
149
+
150
+ # Recent search of this user.
151
+ # @!attribute [rw] recent_search
152
+ # @return [::String]
153
+ # The recent search query.
154
+ class RecentSearchResult
155
+ include ::Google::Protobuf::MessageExts
156
+ extend ::Google::Protobuf::MessageExts::ClassMethods
157
+ end
158
+ end
159
+ end
160
+ end
161
+ end
162
+ end