google-cloud-retail-v2 0.5.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) 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 +88 -14
  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 +54 -13
  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 +22 -5
  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 +229 -37
  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 +45 -16
  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 +133 -17
  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/common.rb +6 -5
  32. data/proto_docs/google/cloud/retail/v2/completion_service.rb +5 -5
  33. data/proto_docs/google/cloud/retail/v2/import_config.rb +1 -1
  34. data/proto_docs/google/cloud/retail/v2/product.rb +16 -10
  35. data/proto_docs/google/cloud/retail/v2/product_service.rb +8 -8
  36. data/proto_docs/google/cloud/retail/v2/search_service.rb +52 -15
  37. data/proto_docs/google/cloud/retail/v2/user_event.rb +4 -4
  38. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4362ee1ee1297de1e4f20da8c2e02d5b20a38f5334da03e58db621276d2d767b
4
- data.tar.gz: 7de1bf1b00e922ab9b07c4b7912161f3af7dce3cd46fb4bf4f139d4dd53fba1d
3
+ metadata.gz: 35215e1d3d5140386a8e08763025e0a07c99c687e1bf1542c6bb4339a7e2655c
4
+ data.tar.gz: b5fb941505e7c27c0caea1a80efe0742a4a3faae2719401e9feae4e2541abc47
5
5
  SHA512:
6
- metadata.gz: 1dca8e4dc874b55df773716b5115820d4e4f528a88673cf55107acaae041fd3aa8ee236b5bfaa20244172ae23a9b92053dfb10c77c6ee252610c635f19cc35a9
7
- data.tar.gz: 66bc9026d1216894564f36f5fe8ed093225e7213ed85e3571dce187a4b9ab672023b51706d727ca4acee795ced47cbcfdb9e1aab84146ca75866546ffc15a8e4
6
+ metadata.gz: fda3f7dcb3d866875e857ca6cf01407a67e470a6f37667f78f658da607b3f1ffd774a34adaee1b18ef16f3384a5ce49625ec410b487cc473aa2e1df2771f7be0
7
+ data.tar.gz: 843c7d75995780b23316185e421aec2f11b782eed90300db75f32a68e1198e02df254602014e7cea773bdc110730b0248d7b00d7b5fd8ecc89f9737ec236388c
@@ -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
@@ -64,9 +64,9 @@ module Google
64
64
  end
65
65
  default_config = Client::Configuration.new parent_config
66
66
 
67
- default_config.timeout = 60.0
67
+ default_config.timeout = 5.0
68
68
  default_config.retry_policy = {
69
- 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
70
  }
71
71
 
72
72
  default_config
@@ -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
@@ -68,9 +68,9 @@ module Google
68
68
  end
69
69
  default_config = Client::Configuration.new parent_config
70
70
 
71
- default_config.timeout = 60.0
71
+ default_config.timeout = 5.0
72
72
  default_config.retry_policy = {
73
- 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]
74
74
  }
75
75
 
76
76
  default_config
@@ -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
@@ -64,9 +64,9 @@ module Google
64
64
  end
65
65
  default_config = Client::Configuration.new parent_config
66
66
 
67
- default_config.timeout = 60.0
67
+ default_config.timeout = 5.0
68
68
  default_config.retry_policy = {
69
- 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
70
  }
71
71
 
72
72
  default_config
@@ -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