google-cloud-retail-v2 0.16.0 → 0.17.0

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_service/client.rb +14 -3
  3. data/lib/google/cloud/retail/v2/catalog_service/rest/client.rb +184 -2
  4. data/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb +11 -11
  5. data/lib/google/cloud/retail/v2/completion_service/client.rb +14 -3
  6. data/lib/google/cloud/retail/v2/completion_service/operations.rb +13 -2
  7. data/lib/google/cloud/retail/v2/completion_service/rest/client.rb +43 -2
  8. data/lib/google/cloud/retail/v2/completion_service/rest/operations.rb +82 -5
  9. data/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb +2 -2
  10. data/lib/google/cloud/retail/v2/control_service/client.rb +14 -3
  11. data/lib/google/cloud/retail/v2/control_service/rest/client.rb +88 -2
  12. data/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb +5 -5
  13. data/lib/google/cloud/retail/v2/model_service/client.rb +14 -3
  14. data/lib/google/cloud/retail/v2/model_service/operations.rb +13 -2
  15. data/lib/google/cloud/retail/v2/model_service/rest/client.rb +150 -2
  16. data/lib/google/cloud/retail/v2/model_service/rest/operations.rb +82 -5
  17. data/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb +8 -8
  18. data/lib/google/cloud/retail/v2/prediction_service/client.rb +14 -3
  19. data/lib/google/cloud/retail/v2/prediction_service/rest/client.rb +20 -2
  20. data/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb +1 -1
  21. data/lib/google/cloud/retail/v2/product_service/client.rb +14 -3
  22. data/lib/google/cloud/retail/v2/product_service/operations.rb +13 -2
  23. data/lib/google/cloud/retail/v2/product_service/rest/client.rb +226 -2
  24. data/lib/google/cloud/retail/v2/product_service/rest/operations.rb +82 -5
  25. data/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb +11 -11
  26. data/lib/google/cloud/retail/v2/search_service/client.rb +14 -3
  27. data/lib/google/cloud/retail/v2/search_service/rest/client.rb +24 -2
  28. data/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb +1 -1
  29. data/lib/google/cloud/retail/v2/serving_config_service/client.rb +14 -3
  30. data/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb +120 -2
  31. data/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb +7 -7
  32. data/lib/google/cloud/retail/v2/user_event_service/client.rb +14 -3
  33. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +13 -2
  34. data/lib/google/cloud/retail/v2/user_event_service/rest/client.rb +105 -2
  35. data/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb +82 -5
  36. data/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb +5 -5
  37. data/lib/google/cloud/retail/v2/version.rb +1 -1
  38. data/proto_docs/google/api/field_behavior.rb +14 -0
  39. metadata +5 -5
@@ -131,7 +131,7 @@ module Google
131
131
  credentials = @config.credentials
132
132
  # Use self-signed JWT if the endpoint is unchanged from default,
133
133
  # but only if the default endpoint does not have a region prefix.
134
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
134
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
135
135
  !@config.endpoint.split(".").first.include?("-")
136
136
  credentials ||= Credentials.default scope: @config.scope,
137
137
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -219,6 +219,22 @@ module Google
219
219
  # @return [::Google::Cloud::Retail::V2::Product]
220
220
  #
221
221
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
222
+ #
223
+ # @example Basic example
224
+ # require "google/cloud/retail/v2"
225
+ #
226
+ # # Create a client object. The client can be reused for multiple calls.
227
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
228
+ #
229
+ # # Create a request. To set request fields, pass in keyword arguments.
230
+ # request = Google::Cloud::Retail::V2::CreateProductRequest.new
231
+ #
232
+ # # Call the create_product method.
233
+ # result = client.create_product request
234
+ #
235
+ # # The returned object is of type Google::Cloud::Retail::V2::Product.
236
+ # p result
237
+ #
222
238
  def create_product request, options = nil
223
239
  raise ::ArgumentError, "request must be provided" if request.nil?
224
240
 
@@ -290,6 +306,22 @@ module Google
290
306
  # @return [::Google::Cloud::Retail::V2::Product]
291
307
  #
292
308
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
309
+ #
310
+ # @example Basic example
311
+ # require "google/cloud/retail/v2"
312
+ #
313
+ # # Create a client object. The client can be reused for multiple calls.
314
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
315
+ #
316
+ # # Create a request. To set request fields, pass in keyword arguments.
317
+ # request = Google::Cloud::Retail::V2::GetProductRequest.new
318
+ #
319
+ # # Call the get_product method.
320
+ # result = client.get_product request
321
+ #
322
+ # # The returned object is of type Google::Cloud::Retail::V2::Product.
323
+ # p result
324
+ #
293
325
  def get_product request, options = nil
294
326
  raise ::ArgumentError, "request must be provided" if request.nil?
295
327
 
@@ -423,6 +455,26 @@ module Google
423
455
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Product>]
424
456
  #
425
457
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
458
+ #
459
+ # @example Basic example
460
+ # require "google/cloud/retail/v2"
461
+ #
462
+ # # Create a client object. The client can be reused for multiple calls.
463
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
464
+ #
465
+ # # Create a request. To set request fields, pass in keyword arguments.
466
+ # request = Google::Cloud::Retail::V2::ListProductsRequest.new
467
+ #
468
+ # # Call the list_products method.
469
+ # result = client.list_products request
470
+ #
471
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
472
+ # # over elements, and API calls will be issued to fetch pages as needed.
473
+ # result.each do |item|
474
+ # # Each element is of type ::Google::Cloud::Retail::V2::Product.
475
+ # p item
476
+ # end
477
+ #
426
478
  def list_products request, options = nil
427
479
  raise ::ArgumentError, "request must be provided" if request.nil?
428
480
 
@@ -512,6 +564,22 @@ module Google
512
564
  # @return [::Google::Cloud::Retail::V2::Product]
513
565
  #
514
566
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
567
+ #
568
+ # @example Basic example
569
+ # require "google/cloud/retail/v2"
570
+ #
571
+ # # Create a client object. The client can be reused for multiple calls.
572
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
573
+ #
574
+ # # Create a request. To set request fields, pass in keyword arguments.
575
+ # request = Google::Cloud::Retail::V2::UpdateProductRequest.new
576
+ #
577
+ # # Call the update_product method.
578
+ # result = client.update_product request
579
+ #
580
+ # # The returned object is of type Google::Cloud::Retail::V2::Product.
581
+ # p result
582
+ #
515
583
  def update_product request, options = nil
516
584
  raise ::ArgumentError, "request must be provided" if request.nil?
517
585
 
@@ -594,6 +662,22 @@ module Google
594
662
  # @return [::Google::Protobuf::Empty]
595
663
  #
596
664
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
665
+ #
666
+ # @example Basic example
667
+ # require "google/cloud/retail/v2"
668
+ #
669
+ # # Create a client object. The client can be reused for multiple calls.
670
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
671
+ #
672
+ # # Create a request. To set request fields, pass in keyword arguments.
673
+ # request = Google::Cloud::Retail::V2::DeleteProductRequest.new
674
+ #
675
+ # # Call the delete_product method.
676
+ # result = client.delete_product request
677
+ #
678
+ # # The returned object is of type Google::Protobuf::Empty.
679
+ # p result
680
+ #
597
681
  def delete_product request, options = nil
598
682
  raise ::ArgumentError, "request must be provided" if request.nil?
599
683
 
@@ -691,6 +775,29 @@ module Google
691
775
  # @return [::Gapic::Operation]
692
776
  #
693
777
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
778
+ #
779
+ # @example Basic example
780
+ # require "google/cloud/retail/v2"
781
+ #
782
+ # # Create a client object. The client can be reused for multiple calls.
783
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
784
+ #
785
+ # # Create a request. To set request fields, pass in keyword arguments.
786
+ # request = Google::Cloud::Retail::V2::ImportProductsRequest.new
787
+ #
788
+ # # Call the import_products method.
789
+ # result = client.import_products request
790
+ #
791
+ # # The returned object is of type Gapic::Operation. You can use it to
792
+ # # check the status of an operation, cancel it, or wait for results.
793
+ # # Here is how to wait for a response.
794
+ # result.wait_until_done! timeout: 60
795
+ # if result.response?
796
+ # p result.response
797
+ # else
798
+ # puts "No response received."
799
+ # end
800
+ #
694
801
  def import_products request, options = nil
695
802
  raise ::ArgumentError, "request must be provided" if request.nil?
696
803
 
@@ -878,6 +985,29 @@ module Google
878
985
  # @return [::Gapic::Operation]
879
986
  #
880
987
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
988
+ #
989
+ # @example Basic example
990
+ # require "google/cloud/retail/v2"
991
+ #
992
+ # # Create a client object. The client can be reused for multiple calls.
993
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
994
+ #
995
+ # # Create a request. To set request fields, pass in keyword arguments.
996
+ # request = Google::Cloud::Retail::V2::SetInventoryRequest.new
997
+ #
998
+ # # Call the set_inventory method.
999
+ # result = client.set_inventory request
1000
+ #
1001
+ # # The returned object is of type Gapic::Operation. You can use it to
1002
+ # # check the status of an operation, cancel it, or wait for results.
1003
+ # # Here is how to wait for a response.
1004
+ # result.wait_until_done! timeout: 60
1005
+ # if result.response?
1006
+ # p result.response
1007
+ # else
1008
+ # puts "No response received."
1009
+ # end
1010
+ #
881
1011
  def set_inventory request, options = nil
882
1012
  raise ::ArgumentError, "request must be provided" if request.nil?
883
1013
 
@@ -1023,6 +1153,29 @@ module Google
1023
1153
  # @return [::Gapic::Operation]
1024
1154
  #
1025
1155
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1156
+ #
1157
+ # @example Basic example
1158
+ # require "google/cloud/retail/v2"
1159
+ #
1160
+ # # Create a client object. The client can be reused for multiple calls.
1161
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
1162
+ #
1163
+ # # Create a request. To set request fields, pass in keyword arguments.
1164
+ # request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new
1165
+ #
1166
+ # # Call the add_fulfillment_places method.
1167
+ # result = client.add_fulfillment_places request
1168
+ #
1169
+ # # The returned object is of type Gapic::Operation. You can use it to
1170
+ # # check the status of an operation, cancel it, or wait for results.
1171
+ # # Here is how to wait for a response.
1172
+ # result.wait_until_done! timeout: 60
1173
+ # if result.response?
1174
+ # p result.response
1175
+ # else
1176
+ # puts "No response received."
1177
+ # end
1178
+ #
1026
1179
  def add_fulfillment_places request, options = nil
1027
1180
  raise ::ArgumentError, "request must be provided" if request.nil?
1028
1181
 
@@ -1163,6 +1316,29 @@ module Google
1163
1316
  # @return [::Gapic::Operation]
1164
1317
  #
1165
1318
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1319
+ #
1320
+ # @example Basic example
1321
+ # require "google/cloud/retail/v2"
1322
+ #
1323
+ # # Create a client object. The client can be reused for multiple calls.
1324
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
1325
+ #
1326
+ # # Create a request. To set request fields, pass in keyword arguments.
1327
+ # request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new
1328
+ #
1329
+ # # Call the remove_fulfillment_places method.
1330
+ # result = client.remove_fulfillment_places request
1331
+ #
1332
+ # # The returned object is of type Gapic::Operation. You can use it to
1333
+ # # check the status of an operation, cancel it, or wait for results.
1334
+ # # Here is how to wait for a response.
1335
+ # result.wait_until_done! timeout: 60
1336
+ # if result.response?
1337
+ # p result.response
1338
+ # else
1339
+ # puts "No response received."
1340
+ # end
1341
+ #
1166
1342
  def remove_fulfillment_places request, options = nil
1167
1343
  raise ::ArgumentError, "request must be provided" if request.nil?
1168
1344
 
@@ -1289,6 +1465,29 @@ module Google
1289
1465
  # @return [::Gapic::Operation]
1290
1466
  #
1291
1467
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1468
+ #
1469
+ # @example Basic example
1470
+ # require "google/cloud/retail/v2"
1471
+ #
1472
+ # # Create a client object. The client can be reused for multiple calls.
1473
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
1474
+ #
1475
+ # # Create a request. To set request fields, pass in keyword arguments.
1476
+ # request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new
1477
+ #
1478
+ # # Call the add_local_inventories method.
1479
+ # result = client.add_local_inventories request
1480
+ #
1481
+ # # The returned object is of type Gapic::Operation. You can use it to
1482
+ # # check the status of an operation, cancel it, or wait for results.
1483
+ # # Here is how to wait for a response.
1484
+ # result.wait_until_done! timeout: 60
1485
+ # if result.response?
1486
+ # p result.response
1487
+ # else
1488
+ # puts "No response received."
1489
+ # end
1490
+ #
1292
1491
  def add_local_inventories request, options = nil
1293
1492
  raise ::ArgumentError, "request must be provided" if request.nil?
1294
1493
 
@@ -1397,6 +1596,29 @@ module Google
1397
1596
  # @return [::Gapic::Operation]
1398
1597
  #
1399
1598
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1599
+ #
1600
+ # @example Basic example
1601
+ # require "google/cloud/retail/v2"
1602
+ #
1603
+ # # Create a client object. The client can be reused for multiple calls.
1604
+ # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new
1605
+ #
1606
+ # # Create a request. To set request fields, pass in keyword arguments.
1607
+ # request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new
1608
+ #
1609
+ # # Call the remove_local_inventories method.
1610
+ # result = client.remove_local_inventories request
1611
+ #
1612
+ # # The returned object is of type Gapic::Operation. You can use it to
1613
+ # # check the status of an operation, cancel it, or wait for results.
1614
+ # # Here is how to wait for a response.
1615
+ # result.wait_until_done! timeout: 60
1616
+ # if result.response?
1617
+ # p result.response
1618
+ # else
1619
+ # puts "No response received."
1620
+ # end
1621
+ #
1400
1622
  def remove_local_inventories request, options = nil
1401
1623
  raise ::ArgumentError, "request must be provided" if request.nil?
1402
1624
 
@@ -1506,7 +1728,9 @@ module Google
1506
1728
  class Configuration
1507
1729
  extend ::Gapic::Config
1508
1730
 
1509
- config_attr :endpoint, "retail.googleapis.com", ::String
1731
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
1732
+
1733
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1510
1734
  config_attr :credentials, nil do |value|
1511
1735
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1512
1736
  allowed.any? { |klass| klass === value }
@@ -136,6 +136,26 @@ module Google
136
136
  # @return [::Gapic::Operation]
137
137
  #
138
138
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
139
+ #
140
+ # @example Basic example
141
+ # require "google/longrunning"
142
+ #
143
+ # # Create a client object. The client can be reused for multiple calls.
144
+ # client = Google::Longrunning::Operations::Rest::Client.new
145
+ #
146
+ # # Create a request. To set request fields, pass in keyword arguments.
147
+ # request = Google::Longrunning::ListOperationsRequest.new
148
+ #
149
+ # # Call the list_operations method.
150
+ # result = client.list_operations request
151
+ #
152
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
153
+ # # over elements, and API calls will be issued to fetch pages as needed.
154
+ # result.each do |item|
155
+ # # Each element is of type ::Google::Longrunning::Operation.
156
+ # p item
157
+ # end
158
+ #
139
159
  def list_operations request, options = nil
140
160
  raise ::ArgumentError, "request must be provided" if request.nil?
141
161
 
@@ -201,6 +221,29 @@ module Google
201
221
  # @return [::Gapic::Operation]
202
222
  #
203
223
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
224
+ #
225
+ # @example Basic example
226
+ # require "google/longrunning"
227
+ #
228
+ # # Create a client object. The client can be reused for multiple calls.
229
+ # client = Google::Longrunning::Operations::Rest::Client.new
230
+ #
231
+ # # Create a request. To set request fields, pass in keyword arguments.
232
+ # request = Google::Longrunning::GetOperationRequest.new
233
+ #
234
+ # # Call the get_operation method.
235
+ # result = client.get_operation request
236
+ #
237
+ # # The returned object is of type Gapic::Operation. You can use it to
238
+ # # check the status of an operation, cancel it, or wait for results.
239
+ # # Here is how to wait for a response.
240
+ # result.wait_until_done! timeout: 60
241
+ # if result.response?
242
+ # p result.response
243
+ # else
244
+ # puts "No response received."
245
+ # end
246
+ #
204
247
  def get_operation request, options = nil
205
248
  raise ::ArgumentError, "request must be provided" if request.nil?
206
249
 
@@ -267,6 +310,22 @@ module Google
267
310
  # @return [::Google::Protobuf::Empty]
268
311
  #
269
312
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
313
+ #
314
+ # @example Basic example
315
+ # require "google/longrunning"
316
+ #
317
+ # # Create a client object. The client can be reused for multiple calls.
318
+ # client = Google::Longrunning::Operations::Rest::Client.new
319
+ #
320
+ # # Create a request. To set request fields, pass in keyword arguments.
321
+ # request = Google::Longrunning::DeleteOperationRequest.new
322
+ #
323
+ # # Call the delete_operation method.
324
+ # result = client.delete_operation request
325
+ #
326
+ # # The returned object is of type Google::Protobuf::Empty.
327
+ # p result
328
+ #
270
329
  def delete_operation request, options = nil
271
330
  raise ::ArgumentError, "request must be provided" if request.nil?
272
331
 
@@ -338,6 +397,22 @@ module Google
338
397
  # @return [::Google::Protobuf::Empty]
339
398
  #
340
399
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
400
+ #
401
+ # @example Basic example
402
+ # require "google/longrunning"
403
+ #
404
+ # # Create a client object. The client can be reused for multiple calls.
405
+ # client = Google::Longrunning::Operations::Rest::Client.new
406
+ #
407
+ # # Create a request. To set request fields, pass in keyword arguments.
408
+ # request = Google::Longrunning::CancelOperationRequest.new
409
+ #
410
+ # # Call the cancel_operation method.
411
+ # result = client.cancel_operation request
412
+ #
413
+ # # The returned object is of type Google::Protobuf::Empty.
414
+ # p result
415
+ #
341
416
  def cancel_operation request, options = nil
342
417
  raise ::ArgumentError, "request must be provided" if request.nil?
343
418
 
@@ -446,7 +521,9 @@ module Google
446
521
  class Configuration
447
522
  extend ::Gapic::Config
448
523
 
449
- config_attr :endpoint, "retail.googleapis.com", ::String
524
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
525
+
526
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
450
527
  config_attr :credentials, nil do |value|
451
528
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
452
529
  allowed.any? { |klass| klass === value }
@@ -567,7 +644,7 @@ module Google
567
644
 
568
645
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb
569
646
  query_string_params = if query_string_params.any?
570
- query_string_params.to_h { |p| p.split("=", 2) }
647
+ query_string_params.to_h { |p| p.split "=", 2 }
571
648
  else
572
649
  {}
573
650
  end
@@ -605,7 +682,7 @@ module Google
605
682
 
606
683
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb
607
684
  query_string_params = if query_string_params.any?
608
- query_string_params.to_h { |p| p.split("=", 2) }
685
+ query_string_params.to_h { |p| p.split "=", 2 }
609
686
  else
610
687
  {}
611
688
  end
@@ -643,7 +720,7 @@ module Google
643
720
 
644
721
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb
645
722
  query_string_params = if query_string_params.any?
646
- query_string_params.to_h { |p| p.split("=", 2) }
723
+ query_string_params.to_h { |p| p.split "=", 2 }
647
724
  else
648
725
  {}
649
726
  end
@@ -681,7 +758,7 @@ module Google
681
758
 
682
759
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb
683
760
  query_string_params = if query_string_params.any?
684
- query_string_params.to_h { |p| p.split("=", 2) }
761
+ query_string_params.to_h { |p| p.split "=", 2 }
685
762
  else
686
763
  {}
687
764
  end
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_create_product_request request_pb
61
61
  query_string_params = if query_string_params.any?
62
- query_string_params.to_h { |p| p.split("=", 2) }
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
63
  else
64
64
  {}
65
65
  end
@@ -97,7 +97,7 @@ module Google
97
97
 
98
98
  verb, uri, query_string_params, body = ServiceStub.transcode_get_product_request request_pb
99
99
  query_string_params = if query_string_params.any?
100
- query_string_params.to_h { |p| p.split("=", 2) }
100
+ query_string_params.to_h { |p| p.split "=", 2 }
101
101
  else
102
102
  {}
103
103
  end
@@ -135,7 +135,7 @@ module Google
135
135
 
136
136
  verb, uri, query_string_params, body = ServiceStub.transcode_list_products_request request_pb
137
137
  query_string_params = if query_string_params.any?
138
- query_string_params.to_h { |p| p.split("=", 2) }
138
+ query_string_params.to_h { |p| p.split "=", 2 }
139
139
  else
140
140
  {}
141
141
  end
@@ -173,7 +173,7 @@ module Google
173
173
 
174
174
  verb, uri, query_string_params, body = ServiceStub.transcode_update_product_request request_pb
175
175
  query_string_params = if query_string_params.any?
176
- query_string_params.to_h { |p| p.split("=", 2) }
176
+ query_string_params.to_h { |p| p.split "=", 2 }
177
177
  else
178
178
  {}
179
179
  end
@@ -211,7 +211,7 @@ module Google
211
211
 
212
212
  verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_request request_pb
213
213
  query_string_params = if query_string_params.any?
214
- query_string_params.to_h { |p| p.split("=", 2) }
214
+ query_string_params.to_h { |p| p.split "=", 2 }
215
215
  else
216
216
  {}
217
217
  end
@@ -249,7 +249,7 @@ module Google
249
249
 
250
250
  verb, uri, query_string_params, body = ServiceStub.transcode_import_products_request request_pb
251
251
  query_string_params = if query_string_params.any?
252
- query_string_params.to_h { |p| p.split("=", 2) }
252
+ query_string_params.to_h { |p| p.split "=", 2 }
253
253
  else
254
254
  {}
255
255
  end
@@ -287,7 +287,7 @@ module Google
287
287
 
288
288
  verb, uri, query_string_params, body = ServiceStub.transcode_set_inventory_request request_pb
289
289
  query_string_params = if query_string_params.any?
290
- query_string_params.to_h { |p| p.split("=", 2) }
290
+ query_string_params.to_h { |p| p.split "=", 2 }
291
291
  else
292
292
  {}
293
293
  end
@@ -325,7 +325,7 @@ module Google
325
325
 
326
326
  verb, uri, query_string_params, body = ServiceStub.transcode_add_fulfillment_places_request request_pb
327
327
  query_string_params = if query_string_params.any?
328
- query_string_params.to_h { |p| p.split("=", 2) }
328
+ query_string_params.to_h { |p| p.split "=", 2 }
329
329
  else
330
330
  {}
331
331
  end
@@ -363,7 +363,7 @@ module Google
363
363
 
364
364
  verb, uri, query_string_params, body = ServiceStub.transcode_remove_fulfillment_places_request request_pb
365
365
  query_string_params = if query_string_params.any?
366
- query_string_params.to_h { |p| p.split("=", 2) }
366
+ query_string_params.to_h { |p| p.split "=", 2 }
367
367
  else
368
368
  {}
369
369
  end
@@ -401,7 +401,7 @@ module Google
401
401
 
402
402
  verb, uri, query_string_params, body = ServiceStub.transcode_add_local_inventories_request request_pb
403
403
  query_string_params = if query_string_params.any?
404
- query_string_params.to_h { |p| p.split("=", 2) }
404
+ query_string_params.to_h { |p| p.split "=", 2 }
405
405
  else
406
406
  {}
407
407
  end
@@ -439,7 +439,7 @@ module Google
439
439
 
440
440
  verb, uri, query_string_params, body = ServiceStub.transcode_remove_local_inventories_request request_pb
441
441
  query_string_params = if query_string_params.any?
442
- query_string_params.to_h { |p| p.split("=", 2) }
442
+ query_string_params.to_h { |p| p.split "=", 2 }
443
443
  else
444
444
  {}
445
445
  end
@@ -132,7 +132,7 @@ module Google
132
132
  credentials = @config.credentials
133
133
  # Use self-signed JWT if the endpoint is unchanged from default,
134
134
  # but only if the default endpoint does not have a region prefix.
135
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
135
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
136
136
  !@config.endpoint.split(".").first.include?("-")
137
137
  credentials ||= Credentials.default scope: @config.scope,
138
138
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -153,7 +153,8 @@ module Google
153
153
  credentials: credentials,
154
154
  endpoint: @config.endpoint,
155
155
  channel_args: @config.channel_args,
156
- interceptors: @config.interceptors
156
+ interceptors: @config.interceptors,
157
+ channel_pool_config: @config.channel_pool
157
158
  )
158
159
  end
159
160
 
@@ -577,7 +578,9 @@ module Google
577
578
  class Configuration
578
579
  extend ::Gapic::Config
579
580
 
580
- config_attr :endpoint, "retail.googleapis.com", ::String
581
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
582
+
583
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
581
584
  config_attr :credentials, nil do |value|
582
585
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
583
586
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -612,6 +615,14 @@ module Google
612
615
  end
613
616
  end
614
617
 
618
+ ##
619
+ # Configuration for the channel pool
620
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
621
+ #
622
+ def channel_pool
623
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
624
+ end
625
+
615
626
  ##
616
627
  # Configuration RPC class for the SearchService API.
617
628
  #
@@ -128,7 +128,7 @@ module Google
128
128
  credentials = @config.credentials
129
129
  # Use self-signed JWT if the endpoint is unchanged from default,
130
130
  # but only if the default endpoint does not have a region prefix.
131
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
131
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
132
132
  !@config.endpoint.split(".").first.include?("-")
133
133
  credentials ||= Credentials.default scope: @config.scope,
134
134
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -423,6 +423,26 @@ module Google
423
423
  # @return [::Google::Cloud::Retail::V2::SearchResponse]
424
424
  #
425
425
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
426
+ #
427
+ # @example Basic example
428
+ # require "google/cloud/retail/v2"
429
+ #
430
+ # # Create a client object. The client can be reused for multiple calls.
431
+ # client = Google::Cloud::Retail::V2::SearchService::Rest::Client.new
432
+ #
433
+ # # Create a request. To set request fields, pass in keyword arguments.
434
+ # request = Google::Cloud::Retail::V2::SearchRequest.new
435
+ #
436
+ # # Call the search method.
437
+ # result = client.search request
438
+ #
439
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
440
+ # # over elements, and API calls will be issued to fetch pages as needed.
441
+ # result.each do |item|
442
+ # # Each element is of type ::Google::Cloud::Retail::V2::SearchResponse::SearchResult.
443
+ # p item
444
+ # end
445
+ #
426
446
  def search request, options = nil
427
447
  raise ::ArgumentError, "request must be provided" if request.nil?
428
448
 
@@ -531,7 +551,9 @@ module Google
531
551
  class Configuration
532
552
  extend ::Gapic::Config
533
553
 
534
- config_attr :endpoint, "retail.googleapis.com", ::String
554
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
555
+
556
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
535
557
  config_attr :credentials, nil do |value|
536
558
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
537
559
  allowed.any? { |klass| klass === value }
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_search_request request_pb
61
61
  query_string_params = if query_string_params.any?
62
- query_string_params.to_h { |p| p.split("=", 2) }
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
63
  else
64
64
  {}
65
65
  end