google-cloud-retail-v2 0.5.1 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) 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 +86 -12
  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 +1 -1
  6. data/lib/google/cloud/retail/v2/common_pb.rb +2 -2
  7. data/lib/google/cloud/retail/v2/completion_service/client.rb +52 -11
  8. data/lib/google/cloud/retail/v2/completion_service/operations.rb +115 -12
  9. data/lib/google/cloud/retail/v2/completion_service_pb.rb +2 -2
  10. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +1 -1
  11. data/lib/google/cloud/retail/v2/import_config_pb.rb +2 -2
  12. data/lib/google/cloud/retail/v2/prediction_service/client.rb +20 -3
  13. data/lib/google/cloud/retail/v2/prediction_service_pb.rb +2 -2
  14. data/lib/google/cloud/retail/v2/prediction_service_services_pb.rb +1 -1
  15. data/lib/google/cloud/retail/v2/product_pb.rb +2 -2
  16. data/lib/google/cloud/retail/v2/product_service/client.rb +222 -35
  17. data/lib/google/cloud/retail/v2/product_service/operations.rb +115 -12
  18. data/lib/google/cloud/retail/v2/product_service_pb.rb +3 -2
  19. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +1 -1
  20. data/lib/google/cloud/retail/v2/purge_config_pb.rb +2 -2
  21. data/lib/google/cloud/retail/v2/search_service/client.rb +51 -14
  22. data/lib/google/cloud/retail/v2/search_service_pb.rb +9 -2
  23. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +1 -1
  24. data/lib/google/cloud/retail/v2/user_event_pb.rb +2 -2
  25. data/lib/google/cloud/retail/v2/user_event_service/client.rb +122 -16
  26. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +115 -12
  27. data/lib/google/cloud/retail/v2/user_event_service_pb.rb +2 -2
  28. data/lib/google/cloud/retail/v2/user_event_service_services_pb.rb +1 -1
  29. data/lib/google/cloud/retail/v2/version.rb +1 -1
  30. data/proto_docs/google/api/httpbody.rb +7 -3
  31. data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
  32. data/proto_docs/google/cloud/retail/v2/common.rb +6 -5
  33. data/proto_docs/google/cloud/retail/v2/completion_service.rb +5 -5
  34. data/proto_docs/google/cloud/retail/v2/import_config.rb +1 -1
  35. data/proto_docs/google/cloud/retail/v2/product.rb +12 -9
  36. data/proto_docs/google/cloud/retail/v2/product_service.rb +8 -8
  37. data/proto_docs/google/cloud/retail/v2/search_service.rb +59 -11
  38. data/proto_docs/google/cloud/retail/v2/user_event.rb +4 -4
  39. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 422025455c4fa8d251bfa6ce1ac4a943b1888ecc0efdbaf16803ea3545926a52
4
- data.tar.gz: dfc946b2a39132d32a90da0defa43aab97f8e24009573e405e6e691ca2ab3a36
3
+ metadata.gz: b966107ef96cb36b48c8895dcabd38957a62c60655f46e6a5f985139f951f76c
4
+ data.tar.gz: 50bf59d49d31f05a6ac3578791614dd648edf8192f75bad48159fae8c985c490
5
5
  SHA512:
6
- metadata.gz: 82cb4d8e176954b73e53e73fd89ca45ef04655fa7e1fd57b2d1abf2e4801b22f937bd36d2fbd717d0db76477c25c6ada69c6e923d72ca384625194f07274a330
7
- data.tar.gz: bfce46bb79939b1de5189510ff0230eedced58551f49de189104f2e47949965ce4c24d59df170bb85e4fdaf10921997682afada6412074f09ebce6d8388d905a
6
+ metadata.gz: 8ce36b09614960fb6e24d38fa1da8bdad8ec06eea03350ee230e3ceafdf4aecf0623058287fe92c92bef1303357cf026ee752a094bff81135d1354ff72a8e680
7
+ data.tar.gz: 2e1a89c079d14e614de1f960481fb802a740af1db8474bdf98bce863d4a5b914e73ca136cedbe1e5c526f3acbeb1f71418850506703894b212fcee76093ddd98
@@ -1,13 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/catalog.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/api/resource_pb'
9
7
  require 'google/cloud/retail/v2/common_pb'
10
8
  require 'google/cloud/retail/v2/import_config_pb'
9
+ require 'google/protobuf'
10
+
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/cloud/retail/v2/catalog.proto", :syntax => :proto3) do
13
13
  add_message "google.cloud.retail.v2.ProductLevelConfig" do
@@ -201,6 +201,27 @@ module Google
201
201
  #
202
202
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
203
203
  #
204
+ # @example Basic example
205
+ # require "google/cloud/retail/v2"
206
+ #
207
+ # # Create a client object. The client can be reused for multiple calls.
208
+ # client = Google::Cloud::Retail::V2::CatalogService::Client.new
209
+ #
210
+ # # Create a request. To set request fields, pass in keyword arguments.
211
+ # request = Google::Cloud::Retail::V2::ListCatalogsRequest.new
212
+ #
213
+ # # Call the list_catalogs method.
214
+ # result = client.list_catalogs request
215
+ #
216
+ # # The returned object is of type Gapic::PagedEnumerable. You can
217
+ # # iterate over all elements by calling #each, and the enumerable
218
+ # # will lazily make API calls to fetch subsequent pages. Other
219
+ # # methods are also available for managing paging directly.
220
+ # result.each do |response|
221
+ # # Each element is of type ::Google::Cloud::Retail::V2::Catalog.
222
+ # p response
223
+ # end
224
+ #
204
225
  def list_catalogs request, options = nil
205
226
  raise ::ArgumentError, "request must be provided" if request.nil?
206
227
 
@@ -218,9 +239,11 @@ module Google
218
239
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
219
240
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
220
241
 
221
- header_params = {
222
- "parent" => request.parent
223
- }
242
+ header_params = {}
243
+ if request.parent
244
+ header_params["parent"] = request.parent
245
+ end
246
+
224
247
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
225
248
  metadata[:"x-goog-request-params"] ||= request_params_header
226
249
 
@@ -283,6 +306,21 @@ module Google
283
306
  #
284
307
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
285
308
  #
309
+ # @example Basic example
310
+ # require "google/cloud/retail/v2"
311
+ #
312
+ # # Create a client object. The client can be reused for multiple calls.
313
+ # client = Google::Cloud::Retail::V2::CatalogService::Client.new
314
+ #
315
+ # # Create a request. To set request fields, pass in keyword arguments.
316
+ # request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new
317
+ #
318
+ # # Call the update_catalog method.
319
+ # result = client.update_catalog request
320
+ #
321
+ # # The returned object is of type Google::Cloud::Retail::V2::Catalog.
322
+ # p result
323
+ #
286
324
  def update_catalog request, options = nil
287
325
  raise ::ArgumentError, "request must be provided" if request.nil?
288
326
 
@@ -300,9 +338,11 @@ module Google
300
338
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
301
339
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
302
340
 
303
- header_params = {
304
- "catalog.name" => request.catalog.name
305
- }
341
+ header_params = {}
342
+ if request.catalog&.name
343
+ header_params["catalog.name"] = request.catalog.name
344
+ end
345
+
306
346
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
307
347
  metadata[:"x-goog-request-params"] ||= request_params_header
308
348
 
@@ -400,6 +440,21 @@ module Google
400
440
  #
401
441
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
402
442
  #
443
+ # @example Basic example
444
+ # require "google/cloud/retail/v2"
445
+ #
446
+ # # Create a client object. The client can be reused for multiple calls.
447
+ # client = Google::Cloud::Retail::V2::CatalogService::Client.new
448
+ #
449
+ # # Create a request. To set request fields, pass in keyword arguments.
450
+ # request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new
451
+ #
452
+ # # Call the set_default_branch method.
453
+ # result = client.set_default_branch request
454
+ #
455
+ # # The returned object is of type Google::Protobuf::Empty.
456
+ # p result
457
+ #
403
458
  def set_default_branch request, options = nil
404
459
  raise ::ArgumentError, "request must be provided" if request.nil?
405
460
 
@@ -417,9 +472,11 @@ module Google
417
472
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
418
473
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
419
474
 
420
- header_params = {
421
- "catalog" => request.catalog
422
- }
475
+ header_params = {}
476
+ if request.catalog
477
+ header_params["catalog"] = request.catalog
478
+ end
479
+
423
480
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
424
481
  metadata[:"x-goog-request-params"] ||= request_params_header
425
482
 
@@ -475,6 +532,21 @@ module Google
475
532
  #
476
533
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
477
534
  #
535
+ # @example Basic example
536
+ # require "google/cloud/retail/v2"
537
+ #
538
+ # # Create a client object. The client can be reused for multiple calls.
539
+ # client = Google::Cloud::Retail::V2::CatalogService::Client.new
540
+ #
541
+ # # Create a request. To set request fields, pass in keyword arguments.
542
+ # request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new
543
+ #
544
+ # # Call the get_default_branch method.
545
+ # result = client.get_default_branch request
546
+ #
547
+ # # The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse.
548
+ # p result
549
+ #
478
550
  def get_default_branch request, options = nil
479
551
  raise ::ArgumentError, "request must be provided" if request.nil?
480
552
 
@@ -492,9 +564,11 @@ module Google
492
564
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
493
565
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
494
566
 
495
- header_params = {
496
- "catalog" => request.catalog
497
- }
567
+ header_params = {}
568
+ if request.catalog
569
+ header_params["catalog"] = request.catalog
570
+ end
571
+
498
572
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
499
573
  metadata[:"x-goog-request-params"] ||= request_params_header
500
574
 
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/catalog_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'
@@ -11,6 +9,8 @@ require 'google/cloud/retail/v2/catalog_pb'
11
9
  require 'google/protobuf/empty_pb'
12
10
  require 'google/protobuf/field_mask_pb'
13
11
  require 'google/protobuf/timestamp_pb'
12
+ require 'google/protobuf'
13
+
14
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
15
15
  add_file("google/cloud/retail/v2/catalog_service.proto", :syntax => :proto3) do
16
16
  add_message "google.cloud.retail.v2.ListCatalogsRequest" do
@@ -27,7 +27,7 @@ module Google
27
27
  # Service for managing catalog configuration.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -1,11 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/common.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/protobuf/timestamp_pb'
7
+ require 'google/protobuf'
8
+
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/cloud/retail/v2/common.proto", :syntax => :proto3) do
11
11
  add_message "google.cloud.retail.v2.Audience" do
@@ -215,18 +215,18 @@ module Google
215
215
  # @param device_type [::String]
216
216
  # The device type context for completion suggestions.
217
217
  # It is useful to apply different suggestions on different device types, e.g.
218
- # DESKTOP, MOBILE. If it is empty, the suggestions are across all device
218
+ # `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
219
219
  # types.
220
220
  #
221
221
  # Supported formats:
222
222
  #
223
- # * UNKNOWN_DEVICE_TYPE
223
+ # * `UNKNOWN_DEVICE_TYPE`
224
224
  #
225
- # * DESKTOP
225
+ # * `DESKTOP`
226
226
  #
227
- # * MOBILE
227
+ # * `MOBILE`
228
228
  #
229
- # * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
229
+ # * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
230
230
  # @param dataset [::String]
231
231
  # Determines which dataset to use for fetching completion. "user-data" will
232
232
  # use the imported dataset through
@@ -256,6 +256,21 @@ module Google
256
256
  #
257
257
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
258
258
  #
259
+ # @example Basic example
260
+ # require "google/cloud/retail/v2"
261
+ #
262
+ # # Create a client object. The client can be reused for multiple calls.
263
+ # client = Google::Cloud::Retail::V2::CompletionService::Client.new
264
+ #
265
+ # # Create a request. To set request fields, pass in keyword arguments.
266
+ # request = Google::Cloud::Retail::V2::CompleteQueryRequest.new
267
+ #
268
+ # # Call the complete_query method.
269
+ # result = client.complete_query request
270
+ #
271
+ # # The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse.
272
+ # p result
273
+ #
259
274
  def complete_query request, options = nil
260
275
  raise ::ArgumentError, "request must be provided" if request.nil?
261
276
 
@@ -273,9 +288,11 @@ module Google
273
288
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
274
289
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
275
290
 
276
- header_params = {
277
- "catalog" => request.catalog
278
- }
291
+ header_params = {}
292
+ if request.catalog
293
+ header_params["catalog"] = request.catalog
294
+ end
295
+
279
296
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
280
297
  metadata[:"x-goog-request-params"] ||= request_params_header
281
298
 
@@ -340,6 +357,28 @@ module Google
340
357
  #
341
358
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
342
359
  #
360
+ # @example Basic example
361
+ # require "google/cloud/retail/v2"
362
+ #
363
+ # # Create a client object. The client can be reused for multiple calls.
364
+ # client = Google::Cloud::Retail::V2::CompletionService::Client.new
365
+ #
366
+ # # Create a request. To set request fields, pass in keyword arguments.
367
+ # request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new
368
+ #
369
+ # # Call the import_completion_data method.
370
+ # result = client.import_completion_data request
371
+ #
372
+ # # The returned object is of type Gapic::Operation. You can use this
373
+ # # object to check the status of an operation, cancel it, or wait
374
+ # # for results. Here is how to block until completion:
375
+ # result.wait_until_done! timeout: 60
376
+ # if result.response?
377
+ # p result.response
378
+ # else
379
+ # puts "Error!"
380
+ # end
381
+ #
343
382
  def import_completion_data request, options = nil
344
383
  raise ::ArgumentError, "request must be provided" if request.nil?
345
384
 
@@ -357,9 +396,11 @@ module Google
357
396
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
358
397
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
359
398
 
360
- header_params = {
361
- "parent" => request.parent
362
- }
399
+ header_params = {}
400
+ if request.parent
401
+ header_params["parent"] = request.parent
402
+ end
403
+
363
404
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
364
405
  metadata[:"x-goog-request-params"] ||= request_params_header
365
406
 
@@ -143,6 +143,27 @@ module Google
143
143
  #
144
144
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
145
145
  #
146
+ # @example Basic example
147
+ # require "google/longrunning"
148
+ #
149
+ # # Create a client object. The client can be reused for multiple calls.
150
+ # client = Google::Longrunning::Operations::Client.new
151
+ #
152
+ # # Create a request. To set request fields, pass in keyword arguments.
153
+ # request = Google::Longrunning::ListOperationsRequest.new
154
+ #
155
+ # # Call the list_operations method.
156
+ # result = client.list_operations request
157
+ #
158
+ # # The returned object is of type Gapic::PagedEnumerable. You can
159
+ # # iterate over all elements by calling #each, and the enumerable
160
+ # # will lazily make API calls to fetch subsequent pages. Other
161
+ # # methods are also available for managing paging directly.
162
+ # result.each do |response|
163
+ # # Each element is of type ::Google::Longrunning::Operation.
164
+ # p response
165
+ # end
166
+ #
146
167
  def list_operations request, options = nil
147
168
  raise ::ArgumentError, "request must be provided" if request.nil?
148
169
 
@@ -160,9 +181,11 @@ module Google
160
181
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
161
182
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
162
183
 
163
- header_params = {
164
- "name" => request.name
165
- }
184
+ header_params = {}
185
+ if request.name
186
+ header_params["name"] = request.name
187
+ end
188
+
166
189
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
167
190
  metadata[:"x-goog-request-params"] ||= request_params_header
168
191
 
@@ -215,6 +238,28 @@ module Google
215
238
  #
216
239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
240
  #
241
+ # @example Basic example
242
+ # require "google/longrunning"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Longrunning::Operations::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Longrunning::GetOperationRequest.new
249
+ #
250
+ # # Call the get_operation method.
251
+ # result = client.get_operation request
252
+ #
253
+ # # The returned object is of type Gapic::Operation. You can use this
254
+ # # object to check the status of an operation, cancel it, or wait
255
+ # # for results. Here is how to block until completion:
256
+ # result.wait_until_done! timeout: 60
257
+ # if result.response?
258
+ # p result.response
259
+ # else
260
+ # puts "Error!"
261
+ # end
262
+ #
218
263
  def get_operation request, options = nil
219
264
  raise ::ArgumentError, "request must be provided" if request.nil?
220
265
 
@@ -232,9 +277,11 @@ module Google
232
277
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
233
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
279
 
235
- header_params = {
236
- "name" => request.name
237
- }
280
+ header_params = {}
281
+ if request.name
282
+ header_params["name"] = request.name
283
+ end
284
+
238
285
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
239
286
  metadata[:"x-goog-request-params"] ||= request_params_header
240
287
 
@@ -287,6 +334,21 @@ module Google
287
334
  #
288
335
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
336
  #
337
+ # @example Basic example
338
+ # require "google/longrunning"
339
+ #
340
+ # # Create a client object. The client can be reused for multiple calls.
341
+ # client = Google::Longrunning::Operations::Client.new
342
+ #
343
+ # # Create a request. To set request fields, pass in keyword arguments.
344
+ # request = Google::Longrunning::DeleteOperationRequest.new
345
+ #
346
+ # # Call the delete_operation method.
347
+ # result = client.delete_operation request
348
+ #
349
+ # # The returned object is of type Google::Protobuf::Empty.
350
+ # p result
351
+ #
290
352
  def delete_operation request, options = nil
291
353
  raise ::ArgumentError, "request must be provided" if request.nil?
292
354
 
@@ -304,9 +366,11 @@ module Google
304
366
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
305
367
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
368
 
307
- header_params = {
308
- "name" => request.name
309
- }
369
+ header_params = {}
370
+ if request.name
371
+ header_params["name"] = request.name
372
+ end
373
+
310
374
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
375
  metadata[:"x-goog-request-params"] ||= request_params_header
312
376
 
@@ -364,6 +428,21 @@ module Google
364
428
  #
365
429
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
366
430
  #
431
+ # @example Basic example
432
+ # require "google/longrunning"
433
+ #
434
+ # # Create a client object. The client can be reused for multiple calls.
435
+ # client = Google::Longrunning::Operations::Client.new
436
+ #
437
+ # # Create a request. To set request fields, pass in keyword arguments.
438
+ # request = Google::Longrunning::CancelOperationRequest.new
439
+ #
440
+ # # Call the cancel_operation method.
441
+ # result = client.cancel_operation request
442
+ #
443
+ # # The returned object is of type Google::Protobuf::Empty.
444
+ # p result
445
+ #
367
446
  def cancel_operation request, options = nil
368
447
  raise ::ArgumentError, "request must be provided" if request.nil?
369
448
 
@@ -381,9 +460,11 @@ module Google
381
460
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
382
461
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
383
462
 
384
- header_params = {
385
- "name" => request.name
386
- }
463
+ header_params = {}
464
+ if request.name
465
+ header_params["name"] = request.name
466
+ end
467
+
387
468
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
388
469
  metadata[:"x-goog-request-params"] ||= request_params_header
389
470
 
@@ -444,6 +525,28 @@ module Google
444
525
  #
445
526
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
446
527
  #
528
+ # @example Basic example
529
+ # require "google/longrunning"
530
+ #
531
+ # # Create a client object. The client can be reused for multiple calls.
532
+ # client = Google::Longrunning::Operations::Client.new
533
+ #
534
+ # # Create a request. To set request fields, pass in keyword arguments.
535
+ # request = Google::Longrunning::WaitOperationRequest.new
536
+ #
537
+ # # Call the wait_operation method.
538
+ # result = client.wait_operation request
539
+ #
540
+ # # The returned object is of type Gapic::Operation. You can use this
541
+ # # object to check the status of an operation, cancel it, or wait
542
+ # # for results. Here is how to block until completion:
543
+ # result.wait_until_done! timeout: 60
544
+ # if result.response?
545
+ # p result.response
546
+ # else
547
+ # puts "Error!"
548
+ # end
549
+ #
447
550
  def wait_operation request, options = nil
448
551
  raise ::ArgumentError, "request must be provided" if request.nil?
449
552
 
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/completion_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'
@@ -10,6 +8,8 @@ require 'google/api/resource_pb'
10
8
  require 'google/cloud/retail/v2/common_pb'
11
9
  require 'google/cloud/retail/v2/import_config_pb'
12
10
  require 'google/longrunning/operations_pb'
11
+ require 'google/protobuf'
12
+
13
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_file("google/cloud/retail/v2/completion_service.proto", :syntax => :proto3) do
15
15
  add_message "google.cloud.retail.v2.CompleteQueryRequest" do
@@ -31,7 +31,7 @@ module Google
31
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
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/import_config.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/api/resource_pb'
@@ -12,6 +10,8 @@ require 'google/protobuf/field_mask_pb'
12
10
  require 'google/protobuf/timestamp_pb'
13
11
  require 'google/rpc/status_pb'
14
12
  require 'google/type/date_pb'
13
+ require 'google/protobuf'
14
+
15
15
  Google::Protobuf::DescriptorPool.generated_pool.build do
16
16
  add_file("google/cloud/retail/v2/import_config.proto", :syntax => :proto3) do
17
17
  add_message "google.cloud.retail.v2.GcsSource" do
@@ -274,6 +274,21 @@ module Google
274
274
  #
275
275
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
276
276
  #
277
+ # @example Basic example
278
+ # require "google/cloud/retail/v2"
279
+ #
280
+ # # Create a client object. The client can be reused for multiple calls.
281
+ # client = Google::Cloud::Retail::V2::PredictionService::Client.new
282
+ #
283
+ # # Create a request. To set request fields, pass in keyword arguments.
284
+ # request = Google::Cloud::Retail::V2::PredictRequest.new
285
+ #
286
+ # # Call the predict method.
287
+ # result = client.predict request
288
+ #
289
+ # # The returned object is of type Google::Cloud::Retail::V2::PredictResponse.
290
+ # p result
291
+ #
277
292
  def predict request, options = nil
278
293
  raise ::ArgumentError, "request must be provided" if request.nil?
279
294
 
@@ -291,9 +306,11 @@ module Google
291
306
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
292
307
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
293
308
 
294
- header_params = {
295
- "placement" => request.placement
296
- }
309
+ header_params = {}
310
+ if request.placement
311
+ header_params["placement"] = request.placement
312
+ end
313
+
297
314
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
298
315
  metadata[:"x-goog-request-params"] ||= request_params_header
299
316
 
@@ -1,13 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/prediction_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'
9
7
  require 'google/cloud/retail/v2/user_event_pb'
10
8
  require 'google/protobuf/struct_pb'
9
+ require 'google/protobuf'
10
+
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/cloud/retail/v2/prediction_service.proto", :syntax => :proto3) do
13
13
  add_message "google.cloud.retail.v2.PredictRequest" do
@@ -27,7 +27,7 @@ module Google
27
27
  # Service for making recommendation prediction.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/product.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/api/resource_pb'
@@ -11,6 +9,8 @@ require 'google/protobuf/duration_pb'
11
9
  require 'google/protobuf/field_mask_pb'
12
10
  require 'google/protobuf/timestamp_pb'
13
11
  require 'google/protobuf/wrappers_pb'
12
+ require 'google/protobuf'
13
+
14
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
15
15
  add_file("google/cloud/retail/v2/product.proto", :syntax => :proto3) do
16
16
  add_message "google.cloud.retail.v2.Product" do