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
@@ -136,7 +136,7 @@ module Google
136
136
  credentials = @config.credentials
137
137
  # Use self-signed JWT if the endpoint is unchanged from default,
138
138
  # but only if the default endpoint does not have a region prefix.
139
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
139
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
140
140
  !@config.endpoint.split(".").first.include?("-")
141
141
  credentials ||= Credentials.default scope: @config.scope,
142
142
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -212,6 +212,29 @@ module Google
212
212
  # @return [::Gapic::Operation]
213
213
  #
214
214
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
215
+ #
216
+ # @example Basic example
217
+ # require "google/cloud/retail/v2"
218
+ #
219
+ # # Create a client object. The client can be reused for multiple calls.
220
+ # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new
221
+ #
222
+ # # Create a request. To set request fields, pass in keyword arguments.
223
+ # request = Google::Cloud::Retail::V2::CreateModelRequest.new
224
+ #
225
+ # # Call the create_model method.
226
+ # result = client.create_model request
227
+ #
228
+ # # The returned object is of type Gapic::Operation. You can use it to
229
+ # # check the status of an operation, cancel it, or wait for results.
230
+ # # Here is how to wait for a response.
231
+ # result.wait_until_done! timeout: 60
232
+ # if result.response?
233
+ # p result.response
234
+ # else
235
+ # puts "No response received."
236
+ # end
237
+ #
215
238
  def create_model request, options = nil
216
239
  raise ::ArgumentError, "request must be provided" if request.nil?
217
240
 
@@ -277,6 +300,22 @@ module Google
277
300
  # @return [::Google::Cloud::Retail::V2::Model]
278
301
  #
279
302
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
303
+ #
304
+ # @example Basic example
305
+ # require "google/cloud/retail/v2"
306
+ #
307
+ # # Create a client object. The client can be reused for multiple calls.
308
+ # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new
309
+ #
310
+ # # Create a request. To set request fields, pass in keyword arguments.
311
+ # request = Google::Cloud::Retail::V2::GetModelRequest.new
312
+ #
313
+ # # Call the get_model method.
314
+ # result = client.get_model request
315
+ #
316
+ # # The returned object is of type Google::Cloud::Retail::V2::Model.
317
+ # p result
318
+ #
280
319
  def get_model request, options = nil
281
320
  raise ::ArgumentError, "request must be provided" if request.nil?
282
321
 
@@ -341,6 +380,22 @@ module Google
341
380
  # @return [::Google::Cloud::Retail::V2::Model]
342
381
  #
343
382
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
383
+ #
384
+ # @example Basic example
385
+ # require "google/cloud/retail/v2"
386
+ #
387
+ # # Create a client object. The client can be reused for multiple calls.
388
+ # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new
389
+ #
390
+ # # Create a request. To set request fields, pass in keyword arguments.
391
+ # request = Google::Cloud::Retail::V2::PauseModelRequest.new
392
+ #
393
+ # # Call the pause_model method.
394
+ # result = client.pause_model request
395
+ #
396
+ # # The returned object is of type Google::Cloud::Retail::V2::Model.
397
+ # p result
398
+ #
344
399
  def pause_model request, options = nil
345
400
  raise ::ArgumentError, "request must be provided" if request.nil?
346
401
 
@@ -405,6 +460,22 @@ module Google
405
460
  # @return [::Google::Cloud::Retail::V2::Model]
406
461
  #
407
462
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
463
+ #
464
+ # @example Basic example
465
+ # require "google/cloud/retail/v2"
466
+ #
467
+ # # Create a client object. The client can be reused for multiple calls.
468
+ # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new
469
+ #
470
+ # # Create a request. To set request fields, pass in keyword arguments.
471
+ # request = Google::Cloud::Retail::V2::ResumeModelRequest.new
472
+ #
473
+ # # Call the resume_model method.
474
+ # result = client.resume_model request
475
+ #
476
+ # # The returned object is of type Google::Cloud::Retail::V2::Model.
477
+ # p result
478
+ #
408
479
  def resume_model request, options = nil
409
480
  raise ::ArgumentError, "request must be provided" if request.nil?
410
481
 
@@ -469,6 +540,22 @@ module Google
469
540
  # @return [::Google::Protobuf::Empty]
470
541
  #
471
542
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
543
+ #
544
+ # @example Basic example
545
+ # require "google/cloud/retail/v2"
546
+ #
547
+ # # Create a client object. The client can be reused for multiple calls.
548
+ # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new
549
+ #
550
+ # # Create a request. To set request fields, pass in keyword arguments.
551
+ # request = Google::Cloud::Retail::V2::DeleteModelRequest.new
552
+ #
553
+ # # Call the delete_model method.
554
+ # result = client.delete_model request
555
+ #
556
+ # # The returned object is of type Google::Protobuf::Empty.
557
+ # p result
558
+ #
472
559
  def delete_model request, options = nil
473
560
  raise ::ArgumentError, "request must be provided" if request.nil?
474
561
 
@@ -539,6 +626,26 @@ module Google
539
626
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Model>]
540
627
  #
541
628
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
629
+ #
630
+ # @example Basic example
631
+ # require "google/cloud/retail/v2"
632
+ #
633
+ # # Create a client object. The client can be reused for multiple calls.
634
+ # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new
635
+ #
636
+ # # Create a request. To set request fields, pass in keyword arguments.
637
+ # request = Google::Cloud::Retail::V2::ListModelsRequest.new
638
+ #
639
+ # # Call the list_models method.
640
+ # result = client.list_models request
641
+ #
642
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
643
+ # # over elements, and API calls will be issued to fetch pages as needed.
644
+ # result.each do |item|
645
+ # # Each element is of type ::Google::Cloud::Retail::V2::Model.
646
+ # p item
647
+ # end
648
+ #
542
649
  def list_models request, options = nil
543
650
  raise ::ArgumentError, "request must be provided" if request.nil?
544
651
 
@@ -608,6 +715,22 @@ module Google
608
715
  # @return [::Google::Cloud::Retail::V2::Model]
609
716
  #
610
717
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
718
+ #
719
+ # @example Basic example
720
+ # require "google/cloud/retail/v2"
721
+ #
722
+ # # Create a client object. The client can be reused for multiple calls.
723
+ # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new
724
+ #
725
+ # # Create a request. To set request fields, pass in keyword arguments.
726
+ # request = Google::Cloud::Retail::V2::UpdateModelRequest.new
727
+ #
728
+ # # Call the update_model method.
729
+ # result = client.update_model request
730
+ #
731
+ # # The returned object is of type Google::Cloud::Retail::V2::Model.
732
+ # p result
733
+ #
611
734
  def update_model request, options = nil
612
735
  raise ::ArgumentError, "request must be provided" if request.nil?
613
736
 
@@ -672,6 +795,29 @@ module Google
672
795
  # @return [::Gapic::Operation]
673
796
  #
674
797
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
798
+ #
799
+ # @example Basic example
800
+ # require "google/cloud/retail/v2"
801
+ #
802
+ # # Create a client object. The client can be reused for multiple calls.
803
+ # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new
804
+ #
805
+ # # Create a request. To set request fields, pass in keyword arguments.
806
+ # request = Google::Cloud::Retail::V2::TuneModelRequest.new
807
+ #
808
+ # # Call the tune_model method.
809
+ # result = client.tune_model request
810
+ #
811
+ # # The returned object is of type Gapic::Operation. You can use it to
812
+ # # check the status of an operation, cancel it, or wait for results.
813
+ # # Here is how to wait for a response.
814
+ # result.wait_until_done! timeout: 60
815
+ # if result.response?
816
+ # p result.response
817
+ # else
818
+ # puts "No response received."
819
+ # end
820
+ #
675
821
  def tune_model request, options = nil
676
822
  raise ::ArgumentError, "request must be provided" if request.nil?
677
823
 
@@ -781,7 +927,9 @@ module Google
781
927
  class Configuration
782
928
  extend ::Gapic::Config
783
929
 
784
- config_attr :endpoint, "retail.googleapis.com", ::String
930
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
931
+
932
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
785
933
  config_attr :credentials, nil do |value|
786
934
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
787
935
  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_model_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_model_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_pause_model_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_resume_model_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_model_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_list_models_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_update_model_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_tune_model_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
@@ -129,7 +129,7 @@ module Google
129
129
  credentials = @config.credentials
130
130
  # Use self-signed JWT if the endpoint is unchanged from default,
131
131
  # but only if the default endpoint does not have a region prefix.
132
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
132
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
133
133
  !@config.endpoint.split(".").first.include?("-")
134
134
  credentials ||= Credentials.default scope: @config.scope,
135
135
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -150,7 +150,8 @@ module Google
150
150
  credentials: credentials,
151
151
  endpoint: @config.endpoint,
152
152
  channel_args: @config.channel_args,
153
- interceptors: @config.interceptors
153
+ interceptors: @config.interceptors,
154
+ channel_pool_config: @config.channel_pool
154
155
  )
155
156
  end
156
157
 
@@ -456,7 +457,9 @@ module Google
456
457
  class Configuration
457
458
  extend ::Gapic::Config
458
459
 
459
- config_attr :endpoint, "retail.googleapis.com", ::String
460
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
461
+
462
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
460
463
  config_attr :credentials, nil do |value|
461
464
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
462
465
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -491,6 +494,14 @@ module Google
491
494
  end
492
495
  end
493
496
 
497
+ ##
498
+ # Configuration for the channel pool
499
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
500
+ #
501
+ def channel_pool
502
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
503
+ end
504
+
494
505
  ##
495
506
  # Configuration RPC class for the PredictionService API.
496
507
  #
@@ -125,7 +125,7 @@ module Google
125
125
  credentials = @config.credentials
126
126
  # Use self-signed JWT if the endpoint is unchanged from default,
127
127
  # but only if the default endpoint does not have a region prefix.
128
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
128
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
129
129
  !@config.endpoint.split(".").first.include?("-")
130
130
  credentials ||= Credentials.default scope: @config.scope,
131
131
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -307,6 +307,22 @@ module Google
307
307
  # @return [::Google::Cloud::Retail::V2::PredictResponse]
308
308
  #
309
309
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
310
+ #
311
+ # @example Basic example
312
+ # require "google/cloud/retail/v2"
313
+ #
314
+ # # Create a client object. The client can be reused for multiple calls.
315
+ # client = Google::Cloud::Retail::V2::PredictionService::Rest::Client.new
316
+ #
317
+ # # Create a request. To set request fields, pass in keyword arguments.
318
+ # request = Google::Cloud::Retail::V2::PredictRequest.new
319
+ #
320
+ # # Call the predict method.
321
+ # result = client.predict request
322
+ #
323
+ # # The returned object is of type Google::Cloud::Retail::V2::PredictResponse.
324
+ # p result
325
+ #
310
326
  def predict request, options = nil
311
327
  raise ::ArgumentError, "request must be provided" if request.nil?
312
328
 
@@ -415,7 +431,9 @@ module Google
415
431
  class Configuration
416
432
  extend ::Gapic::Config
417
433
 
418
- config_attr :endpoint, "retail.googleapis.com", ::String
434
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
435
+
436
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
419
437
  config_attr :credentials, nil do |value|
420
438
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
421
439
  allowed.any? { |klass| klass === value }
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_predict_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
@@ -135,7 +135,7 @@ module Google
135
135
  credentials = @config.credentials
136
136
  # Use self-signed JWT if the endpoint is unchanged from default,
137
137
  # but only if the default endpoint does not have a region prefix.
138
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
138
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
139
139
  !@config.endpoint.split(".").first.include?("-")
140
140
  credentials ||= Credentials.default scope: @config.scope,
141
141
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -162,7 +162,8 @@ module Google
162
162
  credentials: credentials,
163
163
  endpoint: @config.endpoint,
164
164
  channel_args: @config.channel_args,
165
- interceptors: @config.interceptors
165
+ interceptors: @config.interceptors,
166
+ channel_pool_config: @config.channel_pool
166
167
  )
167
168
  end
168
169
 
@@ -1823,7 +1824,9 @@ module Google
1823
1824
  class Configuration
1824
1825
  extend ::Gapic::Config
1825
1826
 
1826
- config_attr :endpoint, "retail.googleapis.com", ::String
1827
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
1828
+
1829
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1827
1830
  config_attr :credentials, nil do |value|
1828
1831
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1829
1832
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1858,6 +1861,14 @@ module Google
1858
1861
  end
1859
1862
  end
1860
1863
 
1864
+ ##
1865
+ # Configuration for the channel pool
1866
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1867
+ #
1868
+ def channel_pool
1869
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1870
+ end
1871
+
1861
1872
  ##
1862
1873
  # Configuration RPC class for the ProductService API.
1863
1874
  #
@@ -93,7 +93,8 @@ module Google
93
93
  credentials: credentials,
94
94
  endpoint: @config.endpoint,
95
95
  channel_args: @config.channel_args,
96
- interceptors: @config.interceptors
96
+ interceptors: @config.interceptors,
97
+ channel_pool_config: @config.channel_pool
97
98
  )
98
99
 
99
100
  # Used by an LRO wrapper for some methods of this service
@@ -664,7 +665,9 @@ module Google
664
665
  class Configuration
665
666
  extend ::Gapic::Config
666
667
 
667
- config_attr :endpoint, "retail.googleapis.com", ::String
668
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
669
+
670
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
668
671
  config_attr :credentials, nil do |value|
669
672
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
670
673
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -699,6 +702,14 @@ module Google
699
702
  end
700
703
  end
701
704
 
705
+ ##
706
+ # Configuration for the channel pool
707
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
708
+ #
709
+ def channel_pool
710
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
711
+ end
712
+
702
713
  ##
703
714
  # Configuration RPC class for the Operations API.
704
715
  #