google-cloud-retail-v2 0.4.1 → 0.6.0

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 +47 -46
  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 +49 -50
  8. data/lib/google/cloud/retail/v2/completion_service/operations.rb +30 -21
  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 +34 -39
  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 +74 -58
  18. data/lib/google/cloud/retail/v2/product_service/operations.rb +30 -21
  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 +101 -79
  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 +56 -43
  28. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +30 -21
  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 +3 -3
  34. data/proto_docs/google/cloud/retail/v2/completion_service.rb +9 -7
  35. data/proto_docs/google/cloud/retail/v2/import_config.rb +4 -4
  36. data/proto_docs/google/cloud/retail/v2/product.rb +22 -16
  37. data/proto_docs/google/cloud/retail/v2/product_service.rb +6 -6
  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 +4 -4
@@ -30,8 +30,8 @@ module Google
30
30
  # Service for search.
31
31
  #
32
32
  # This feature is only available for users who have Retail Search enabled.
33
- # Contact Retail Support (retail-search-support@google.com) if you are
34
- # interested in using Retail Search.
33
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
34
+ # cloud sales if you are interested in using Retail Search.
35
35
  #
36
36
  class Client
37
37
  include Paths
@@ -45,13 +45,12 @@ module Google
45
45
  # See {::Google::Cloud::Retail::V2::SearchService::Client::Configuration}
46
46
  # for a description of the configuration fields.
47
47
  #
48
- # ## Example
48
+ # @example
49
49
  #
50
- # To modify the configuration for all SearchService clients:
51
- #
52
- # ::Google::Cloud::Retail::V2::SearchService::Client.configure do |config|
53
- # config.timeout = 10.0
54
- # end
50
+ # # Modify the configuration for all SearchService clients
51
+ # ::Google::Cloud::Retail::V2::SearchService::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
55
54
  #
56
55
  # @yield [config] Configure the Client client.
57
56
  # @yieldparam config [Client::Configuration]
@@ -69,9 +68,9 @@ module Google
69
68
  end
70
69
  default_config = Client::Configuration.new parent_config
71
70
 
72
- default_config.timeout = 60.0
71
+ default_config.timeout = 5.0
73
72
  default_config.retry_policy = {
74
- initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
73
+ initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4]
75
74
  }
76
75
 
77
76
  default_config
@@ -103,19 +102,15 @@ module Google
103
102
  ##
104
103
  # Create a new SearchService client object.
105
104
  #
106
- # ## Examples
107
- #
108
- # To create a new SearchService client with the default
109
- # configuration:
110
- #
111
- # client = ::Google::Cloud::Retail::V2::SearchService::Client.new
105
+ # @example
112
106
  #
113
- # To create a new SearchService client with a custom
114
- # configuration:
107
+ # # Create a client using the default configuration
108
+ # client = ::Google::Cloud::Retail::V2::SearchService::Client.new
115
109
  #
116
- # client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config|
117
- # config.timeout = 10.0
118
- # end
110
+ # # Create a client using a custom configuration
111
+ # client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config|
112
+ # config.timeout = 10.0
113
+ # end
119
114
  #
120
115
  # @yield [config] Configure the SearchService client.
121
116
  # @yieldparam config [Client::Configuration]
@@ -135,10 +130,9 @@ module Google
135
130
 
136
131
  # Create credentials
137
132
  credentials = @config.credentials
138
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
133
+ # Use self-signed JWT if the endpoint is unchanged from default,
139
134
  # but only if the default endpoint does not have a region prefix.
140
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
141
- @config.endpoint == Client.configure.endpoint &&
135
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
142
136
  !@config.endpoint.split(".").first.include?("-")
143
137
  credentials ||= Credentials.default scope: @config.scope,
144
138
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -163,8 +157,8 @@ module Google
163
157
  # Performs a search.
164
158
  #
165
159
  # This feature is only available for users who have Retail Search enabled.
166
- # Contact Retail Support (retail-search-support@google.com) if you are
167
- # interested in using Retail Search.
160
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
161
+ # cloud sales if you are interested in using Retail Search.
168
162
  #
169
163
  # @overload search(request, options = nil)
170
164
  # Pass arguments to `search` via a request object, either of type
@@ -176,7 +170,7 @@ module Google
176
170
  # @param options [::Gapic::CallOptions, ::Hash]
177
171
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
178
172
  #
179
- # @overload search(placement: nil, branch: nil, query: nil, visitor_id: nil, user_info: nil, page_size: nil, page_token: nil, offset: nil, filter: nil, canonical_filter: nil, order_by: nil, facet_specs: nil, dynamic_facet_spec: nil, boost_spec: nil, query_expansion_spec: nil, variant_rollup_keys: nil, page_categories: nil)
173
+ # @overload search(placement: nil, branch: nil, query: nil, visitor_id: nil, user_info: nil, page_size: nil, page_token: nil, offset: nil, filter: nil, canonical_filter: nil, order_by: nil, facet_specs: nil, dynamic_facet_spec: nil, boost_spec: nil, query_expansion_spec: nil, variant_rollup_keys: nil, page_categories: nil, search_mode: nil)
180
174
  # Pass arguments to `search` via keyword arguments. Note that at
181
175
  # least one keyword argument is required. To specify no parameters, or to keep all
182
176
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -184,12 +178,8 @@ module Google
184
178
  # @param placement [::String]
185
179
  # Required. The resource name of the search engine placement, such as
186
180
  # `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
187
- # This field is used to identify the set of models that will be used to make
188
- # the search.
189
- #
190
- # We currently support one placement with the following ID:
191
- #
192
- # * `default_search`.
181
+ # This field is used to identify the serving configuration name and the set
182
+ # of models that will be used to make the search.
193
183
  # @param branch [::String]
194
184
  # The branch resource name, such as
195
185
  # `projects/*/locations/global/catalogs/default_catalog/branches/0`.
@@ -236,7 +226,8 @@ module Google
236
226
  # @param filter [::String]
237
227
  # The filter syntax consists of an expression language for constructing a
238
228
  # predicate from one or more fields of the products being filtered. Filter
239
- # expression is case-sensitive.
229
+ # expression is case-sensitive. See more details at this [user
230
+ # guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
240
231
  #
241
232
  # If this field is unrecognizable, an INVALID_ARGUMENT is returned.
242
233
  # @param canonical_filter [::String]
@@ -252,7 +243,9 @@ module Google
252
243
  # @param order_by [::String]
253
244
  # The order in which products are returned. Products can be ordered by
254
245
  # a field in an {::Google::Cloud::Retail::V2::Product Product} object. Leave it
255
- # unset if ordered by relevance. OrderBy expression is case-sensitive.
246
+ # unset if ordered by relevance. OrderBy expression is case-sensitive. See
247
+ # more details at this [user
248
+ # guide](https://cloud.google.com/retail/docs/filter-and-order#order).
256
249
  #
257
250
  # If this field is unrecognizable, an INVALID_ARGUMENT is returned.
258
251
  # @param facet_specs [::Array<::Google::Cloud::Retail::V2::SearchRequest::FacetSpec, ::Hash>]
@@ -264,14 +257,21 @@ module Google
264
257
  # The specification for dynamically generated facets. Notice that only
265
258
  # textual facets can be dynamically generated.
266
259
  #
267
- # This feature requires additional allowlisting. Contact Retail Support
268
- # (retail-search-support@google.com) if you are interested in using dynamic
269
- # facet feature.
260
+ # This feature requires additional allowlisting. Contact Retail Search
261
+ # support team if you are interested in using dynamic facet feature.
270
262
  # @param boost_spec [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec, ::Hash]
271
- # Boost specification to boost certain products.
263
+ # Boost specification to boost certain products. See more details at this
264
+ # [user guide](https://cloud.google.com/retail/docs/boosting).
265
+ #
266
+ # Notice that if both [ServingConfig.boost_control_ids][] and
267
+ # [SearchRequest.boost_spec] are set, the boost conditions from both places
268
+ # are evaluated. If a search request matches multiple boost conditions,
269
+ # the final boost score is equal to the sum of the boost scores from all
270
+ # matched boost conditions.
272
271
  # @param query_expansion_spec [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec, ::Hash]
273
272
  # The query expansion specification that specifies the conditions under which
274
- # query expansion will occur.
273
+ # query expansion will occur. See more details at this [user
274
+ # guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
275
275
  # @param variant_rollup_keys [::Array<::String>]
276
276
  # The keys to fetch and rollup the matching
277
277
  # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
@@ -282,10 +282,9 @@ module Google
282
282
  # {::Google::Cloud::Retail::V2::Product Product}s attributes will lead to extra
283
283
  # query latency. Maximum number of keys is 10.
284
284
  #
285
- # For
286
- # {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info},
287
- # a fulfillment type and a fulfillment ID must be provided in the format of
288
- # "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
285
+ # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, a
286
+ # fulfillment type and a fulfillment ID must be provided in the format of
287
+ # "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
289
288
  # "pickupInStore" is fulfillment type and "store123" is the store ID.
290
289
  #
291
290
  # Supported keys are:
@@ -294,26 +293,45 @@ module Google
294
293
  # * price
295
294
  # * originalPrice
296
295
  # * discount
296
+ # * inventory(place_id,price)
297
297
  # * attributes.key, where key is any key in the
298
298
  # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map.
299
- # * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
300
- # [FulfillmentInfo.Type.PICKUP_IN_STORE][].
301
- # * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
302
- # [FulfillmentInfo.Type.SHIP_TO_STORE][].
303
- # * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
304
- # [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
305
- # * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
306
- # [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
307
- # * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
308
- # [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
309
- # * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
310
- # [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
311
- # * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
312
- # [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
313
- # * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
314
- # [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
315
- # * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
316
- # [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
299
+ # * pickupInStore.id, where id is any
300
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
301
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
302
+ # "pickup-in-store".
303
+ # * shipToStore.id, where id is any
304
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
305
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
306
+ # "ship-to-store".
307
+ # * sameDayDelivery.id, where id is any
308
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
309
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
310
+ # "same-day-delivery".
311
+ # * nextDayDelivery.id, where id is any
312
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
313
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
314
+ # "next-day-delivery".
315
+ # * customFulfillment1.id, where id is any
316
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
317
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
318
+ # "custom-type-1".
319
+ # * customFulfillment2.id, where id is any
320
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
321
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
322
+ # "custom-type-2".
323
+ # * customFulfillment3.id, where id is any
324
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
325
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
326
+ # "custom-type-3".
327
+ # * customFulfillment4.id, where id is any
328
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
329
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
330
+ # "custom-type-4".
331
+ # * customFulfillment5.id, where id is any
332
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids}
333
+ # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}
334
+ # "custom-type-5".
317
335
  #
318
336
  # If this field is set to an invalid value other than these, an
319
337
  # INVALID_ARGUMENT error is returned.
@@ -330,6 +348,9 @@ module Google
330
348
  # Category pages include special pages such as sales or promotions. For
331
349
  # instance, a special sale page may have the category hierarchy:
332
350
  # "pageCategories" : ["Sales > 2017 Black Friday Deals"].
351
+ # @param search_mode [::Google::Cloud::Retail::V2::SearchRequest::SearchMode]
352
+ # The search mode of the search request. If not specified, a single search
353
+ # request triggers both product search and faceted search.
333
354
  #
334
355
  # @yield [response, operation] Access the result along with the RPC operation
335
356
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>]
@@ -365,7 +386,9 @@ module Google
365
386
  options.apply_defaults timeout: @config.rpcs.search.timeout,
366
387
  metadata: metadata,
367
388
  retry_policy: @config.rpcs.search.retry_policy
368
- options.apply_defaults metadata: @config.metadata,
389
+
390
+ options.apply_defaults timeout: @config.timeout,
391
+ metadata: @config.metadata,
369
392
  retry_policy: @config.retry_policy
370
393
 
371
394
  @search_service_stub.call_rpc :search, request, options: options do |response, operation|
@@ -390,22 +413,21 @@ module Google
390
413
  # Configuration can be applied globally to all clients, or to a single client
391
414
  # on construction.
392
415
  #
393
- # # Examples
394
- #
395
- # To modify the global config, setting the timeout for search
396
- # to 20 seconds, and all remaining timeouts to 10 seconds:
397
- #
398
- # ::Google::Cloud::Retail::V2::SearchService::Client.configure do |config|
399
- # config.timeout = 10.0
400
- # config.rpcs.search.timeout = 20.0
401
- # end
402
- #
403
- # To apply the above configuration only to a new client:
404
- #
405
- # client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config|
406
- # config.timeout = 10.0
407
- # config.rpcs.search.timeout = 20.0
408
- # end
416
+ # @example
417
+ #
418
+ # # Modify the global config, setting the timeout for
419
+ # # search to 20 seconds,
420
+ # # and all remaining timeouts to 10 seconds.
421
+ # ::Google::Cloud::Retail::V2::SearchService::Client.configure do |config|
422
+ # config.timeout = 10.0
423
+ # config.rpcs.search.timeout = 20.0
424
+ # end
425
+ #
426
+ # # Apply the above configuration only to a new client.
427
+ # client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config|
428
+ # config.timeout = 10.0
429
+ # config.rpcs.search.timeout = 20.0
430
+ # end
409
431
  #
410
432
  # @!attribute [rw] endpoint
411
433
  # The hostname or hostname:port of the service endpoint.
@@ -34,8 +34,8 @@ module Google
34
34
  # Service for search.
35
35
  #
36
36
  # This feature is only available for users who have Retail Search enabled.
37
- # Contact Retail Support (retail-search-support@google.com) if you are
38
- # interested in using Retail Search.
37
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
38
+ # cloud sales if you are interested in using Retail Search.
39
39
  #
40
40
  # To load this service and instantiate a client:
41
41
  #
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/search_service.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -13,6 +11,8 @@ require 'google/protobuf/field_mask_pb'
13
11
  require 'google/protobuf/struct_pb'
14
12
  require 'google/protobuf/timestamp_pb'
15
13
  require 'google/protobuf/wrappers_pb'
14
+ require 'google/protobuf'
15
+
16
16
  Google::Protobuf::DescriptorPool.generated_pool.build do
17
17
  add_file("google/cloud/retail/v2/search_service.proto", :syntax => :proto3) do
18
18
  add_message "google.cloud.retail.v2.SearchRequest" do
@@ -33,6 +33,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
33
33
  optional :query_expansion_spec, :message, 14, "google.cloud.retail.v2.SearchRequest.QueryExpansionSpec"
34
34
  repeated :variant_rollup_keys, :string, 17
35
35
  repeated :page_categories, :string, 23
36
+ optional :search_mode, :enum, 31, "google.cloud.retail.v2.SearchRequest.SearchMode"
36
37
  end
37
38
  add_message "google.cloud.retail.v2.SearchRequest.FacetSpec" do
38
39
  optional :facet_key, :message, 1, "google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey"
@@ -66,12 +67,18 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
66
67
  end
67
68
  add_message "google.cloud.retail.v2.SearchRequest.QueryExpansionSpec" do
68
69
  optional :condition, :enum, 1, "google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition"
70
+ optional :pin_unexpanded_results, :bool, 2
69
71
  end
70
72
  add_enum "google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition" do
71
73
  value :CONDITION_UNSPECIFIED, 0
72
74
  value :DISABLED, 1
73
75
  value :AUTO, 3
74
76
  end
77
+ add_enum "google.cloud.retail.v2.SearchRequest.SearchMode" do
78
+ value :SEARCH_MODE_UNSPECIFIED, 0
79
+ value :PRODUCT_SEARCH_ONLY, 1
80
+ value :FACETED_SEARCH_ONLY, 2
81
+ end
75
82
  add_message "google.cloud.retail.v2.SearchResponse" do
76
83
  repeated :results, :message, 1, "google.cloud.retail.v2.SearchResponse.SearchResult"
77
84
  repeated :facets, :message, 2, "google.cloud.retail.v2.SearchResponse.Facet"
@@ -103,6 +110,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
103
110
  end
104
111
  add_message "google.cloud.retail.v2.SearchResponse.QueryExpansionInfo" do
105
112
  optional :expanded_query, :bool, 1
113
+ optional :pinned_result_count, :int64, 2
106
114
  end
107
115
  end
108
116
  end
@@ -120,6 +128,7 @@ module Google
120
128
  SearchRequest::BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec").msgclass
121
129
  SearchRequest::QueryExpansionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.QueryExpansionSpec").msgclass
122
130
  SearchRequest::QueryExpansionSpec::Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition").enummodule
131
+ SearchRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.SearchMode").enummodule
123
132
  SearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse").msgclass
124
133
  SearchResponse::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.SearchResult").msgclass
125
134
  SearchResponse::Facet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet").msgclass
@@ -27,11 +27,11 @@ module Google
27
27
  # Service for search.
28
28
  #
29
29
  # This feature is only available for users who have Retail Search enabled.
30
- # Contact Retail Support (retail-search-support@google.com) if you are
31
- # interested in using Retail Search.
30
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
31
+ # cloud sales if you are interested in using Retail Search.
32
32
  class Service
33
33
 
34
- include GRPC::GenericService
34
+ include ::GRPC::GenericService
35
35
 
36
36
  self.marshal_class_method = :encode
37
37
  self.unmarshal_class_method = :decode
@@ -40,8 +40,8 @@ module Google
40
40
  # Performs a search.
41
41
  #
42
42
  # This feature is only available for users who have Retail Search enabled.
43
- # Contact Retail Support (retail-search-support@google.com) if you are
44
- # interested in using Retail Search.
43
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
44
+ # cloud sales if you are interested in using Retail Search.
45
45
  rpc :Search, ::Google::Cloud::Retail::V2::SearchRequest, ::Google::Cloud::Retail::V2::SearchResponse
46
46
  end
47
47
 
@@ -1,14 +1,14 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/user_event.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/field_behavior_pb'
8
6
  require 'google/cloud/retail/v2/common_pb'
9
7
  require 'google/cloud/retail/v2/product_pb'
10
8
  require 'google/protobuf/timestamp_pb'
11
9
  require 'google/protobuf/wrappers_pb'
10
+ require 'google/protobuf'
11
+
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/cloud/retail/v2/user_event.proto", :syntax => :proto3) do
14
14
  add_message "google.cloud.retail.v2.UserEvent" do
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Retail::V2::UserEventService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all UserEventService clients:
47
- #
48
- # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all UserEventService clients
47
+ # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -65,9 +64,19 @@ module Google
65
64
  end
66
65
  default_config = Client::Configuration.new parent_config
67
66
 
68
- default_config.timeout = 60.0
67
+ default_config.timeout = 5.0
69
68
  default_config.retry_policy = {
70
- initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
69
+ initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4]
70
+ }
71
+
72
+ default_config.rpcs.purge_user_events.timeout = 30.0
73
+ default_config.rpcs.purge_user_events.retry_policy = {
74
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14, 4]
75
+ }
76
+
77
+ default_config.rpcs.import_user_events.timeout = 300.0
78
+ default_config.rpcs.import_user_events.retry_policy = {
79
+ initial_delay: 0.1, max_delay: 300.0, multiplier: 1.3, retry_codes: [14, 4]
71
80
  }
72
81
 
73
82
  default_config
@@ -99,19 +108,15 @@ module Google
99
108
  ##
100
109
  # Create a new UserEventService client object.
101
110
  #
102
- # ## Examples
103
- #
104
- # To create a new UserEventService client with the default
105
- # configuration:
111
+ # @example
106
112
  #
107
- # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new
113
+ # # Create a client using the default configuration
114
+ # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new
108
115
  #
109
- # To create a new UserEventService client with a custom
110
- # configuration:
111
- #
112
- # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config|
113
- # config.timeout = 10.0
114
- # end
116
+ # # Create a client using a custom configuration
117
+ # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config|
118
+ # config.timeout = 10.0
119
+ # end
115
120
  #
116
121
  # @yield [config] Configure the UserEventService client.
117
122
  # @yieldparam config [Client::Configuration]
@@ -131,10 +136,9 @@ module Google
131
136
 
132
137
  # Create credentials
133
138
  credentials = @config.credentials
134
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
139
+ # Use self-signed JWT if the endpoint is unchanged from default,
135
140
  # but only if the default endpoint does not have a region prefix.
136
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
137
- @config.endpoint == Client.configure.endpoint &&
141
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
138
142
  !@config.endpoint.split(".").first.include?("-")
139
143
  credentials ||= Credentials.default scope: @config.scope,
140
144
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -225,7 +229,9 @@ module Google
225
229
  options.apply_defaults timeout: @config.rpcs.write_user_event.timeout,
226
230
  metadata: metadata,
227
231
  retry_policy: @config.rpcs.write_user_event.retry_policy
228
- options.apply_defaults metadata: @config.metadata,
232
+
233
+ options.apply_defaults timeout: @config.timeout,
234
+ metadata: @config.metadata,
229
235
  retry_policy: @config.retry_policy
230
236
 
231
237
  @user_event_service_stub.call_rpc :write_user_event, request, options: options do |response, operation|
@@ -308,7 +314,9 @@ module Google
308
314
  options.apply_defaults timeout: @config.rpcs.collect_user_event.timeout,
309
315
  metadata: metadata,
310
316
  retry_policy: @config.rpcs.collect_user_event.retry_policy
311
- options.apply_defaults metadata: @config.metadata,
317
+
318
+ options.apply_defaults timeout: @config.timeout,
319
+ metadata: @config.metadata,
312
320
  retry_policy: @config.retry_policy
313
321
 
314
322
  @user_event_service_stub.call_rpc :collect_user_event, request, options: options do |response, operation|
@@ -407,7 +415,9 @@ module Google
407
415
  options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout,
408
416
  metadata: metadata,
409
417
  retry_policy: @config.rpcs.purge_user_events.retry_policy
410
- options.apply_defaults metadata: @config.metadata,
418
+
419
+ options.apply_defaults timeout: @config.timeout,
420
+ metadata: @config.metadata,
411
421
  retry_policy: @config.retry_policy
412
422
 
413
423
  @user_event_service_stub.call_rpc :purge_user_events, request, options: options do |response, operation|
@@ -485,7 +495,9 @@ module Google
485
495
  options.apply_defaults timeout: @config.rpcs.import_user_events.timeout,
486
496
  metadata: metadata,
487
497
  retry_policy: @config.rpcs.import_user_events.retry_policy
488
- options.apply_defaults metadata: @config.metadata,
498
+
499
+ options.apply_defaults timeout: @config.timeout,
500
+ metadata: @config.metadata,
489
501
  retry_policy: @config.retry_policy
490
502
 
491
503
  @user_event_service_stub.call_rpc :import_user_events, request, options: options do |response, operation|
@@ -564,7 +576,9 @@ module Google
564
576
  options.apply_defaults timeout: @config.rpcs.rejoin_user_events.timeout,
565
577
  metadata: metadata,
566
578
  retry_policy: @config.rpcs.rejoin_user_events.retry_policy
567
- options.apply_defaults metadata: @config.metadata,
579
+
580
+ options.apply_defaults timeout: @config.timeout,
581
+ metadata: @config.metadata,
568
582
  retry_policy: @config.retry_policy
569
583
 
570
584
  @user_event_service_stub.call_rpc :rejoin_user_events, request, options: options do |response, operation|
@@ -589,22 +603,21 @@ module Google
589
603
  # Configuration can be applied globally to all clients, or to a single client
590
604
  # on construction.
591
605
  #
592
- # # Examples
593
- #
594
- # To modify the global config, setting the timeout for write_user_event
595
- # to 20 seconds, and all remaining timeouts to 10 seconds:
596
- #
597
- # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config|
598
- # config.timeout = 10.0
599
- # config.rpcs.write_user_event.timeout = 20.0
600
- # end
601
- #
602
- # To apply the above configuration only to a new client:
603
- #
604
- # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config|
605
- # config.timeout = 10.0
606
- # config.rpcs.write_user_event.timeout = 20.0
607
- # end
606
+ # @example
607
+ #
608
+ # # Modify the global config, setting the timeout for
609
+ # # write_user_event to 20 seconds,
610
+ # # and all remaining timeouts to 10 seconds.
611
+ # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config|
612
+ # config.timeout = 10.0
613
+ # config.rpcs.write_user_event.timeout = 20.0
614
+ # end
615
+ #
616
+ # # Apply the above configuration only to a new client.
617
+ # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config|
618
+ # config.timeout = 10.0
619
+ # config.rpcs.write_user_event.timeout = 20.0
620
+ # end
608
621
  #
609
622
  # @!attribute [rw] endpoint
610
623
  # The hostname or hostname:port of the service endpoint.