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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcfc2a88842d0590d1690446b89ac2a9b6709bee47102a002ab8f22bd5812373
4
- data.tar.gz: 50bd3aa3f0332ca6bae9aeab6522240c03a85b9399b9c214113b5beb1582ef4f
3
+ metadata.gz: c211723334dc32507a15c553160e52732b9dee5f92878a89541eb4316bfd714d
4
+ data.tar.gz: f6d10e7a1efc8d2c72e40adcf5b2290825e37f2d8f7ad39a996d318014e748dd
5
5
  SHA512:
6
- metadata.gz: 447d23a1680acea89a9dc46a1657f10fb92875f5cff6803aac6de16c5c6714d0610c8d80cf967cd310396ddd85682940a95772573939e204d09fe9fbdedcfb3e
7
- data.tar.gz: fab59b409b0062e08e33f00ce151571d482f83be5073e15b702595803d1c07f23d7c419bd4ee21791657ab53f6b56b0b4820ca03fd421751e4ad8b00fbe97c13
6
+ metadata.gz: 6bce0c6e330533283a462f1ea4cc07d6ec1a359654a9a03db2f59607adb2cb72a308508384f367e9d08b1b2cbd30c623841c06e572bc4939c543c5d3e41fa2b6
7
+ data.tar.gz: a98c098417c105c885a7942bcb8d1cc26224a3ebfa1bb02234e18cafbfdf7e650f7a24e49c35cba89b009644cbb7d14d814c80dc1d1d0c1526d4f417e2ac1718
@@ -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
 
@@ -1351,7 +1352,9 @@ module Google
1351
1352
  class Configuration
1352
1353
  extend ::Gapic::Config
1353
1354
 
1354
- config_attr :endpoint, "retail.googleapis.com", ::String
1355
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
1356
+
1357
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1355
1358
  config_attr :credentials, nil do |value|
1356
1359
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1357
1360
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1386,6 +1389,14 @@ module Google
1386
1389
  end
1387
1390
  end
1388
1391
 
1392
+ ##
1393
+ # Configuration for the channel pool
1394
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1395
+ #
1396
+ def channel_pool
1397
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1398
+ end
1399
+
1389
1400
  ##
1390
1401
  # Configuration RPC class for the CatalogService API.
1391
1402
  #
@@ -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
@@ -204,6 +204,26 @@ module Google
204
204
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>]
205
205
  #
206
206
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
207
+ #
208
+ # @example Basic example
209
+ # require "google/cloud/retail/v2"
210
+ #
211
+ # # Create a client object. The client can be reused for multiple calls.
212
+ # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
213
+ #
214
+ # # Create a request. To set request fields, pass in keyword arguments.
215
+ # request = Google::Cloud::Retail::V2::ListCatalogsRequest.new
216
+ #
217
+ # # Call the list_catalogs method.
218
+ # result = client.list_catalogs request
219
+ #
220
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
221
+ # # over elements, and API calls will be issued to fetch pages as needed.
222
+ # result.each do |item|
223
+ # # Each element is of type ::Google::Cloud::Retail::V2::Catalog.
224
+ # p item
225
+ # end
226
+ #
207
227
  def list_catalogs request, options = nil
208
228
  raise ::ArgumentError, "request must be provided" if request.nil?
209
229
 
@@ -280,6 +300,22 @@ module Google
280
300
  # @return [::Google::Cloud::Retail::V2::Catalog]
281
301
  #
282
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::CatalogService::Rest::Client.new
309
+ #
310
+ # # Create a request. To set request fields, pass in keyword arguments.
311
+ # request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new
312
+ #
313
+ # # Call the update_catalog method.
314
+ # result = client.update_catalog request
315
+ #
316
+ # # The returned object is of type Google::Cloud::Retail::V2::Catalog.
317
+ # p result
318
+ #
283
319
  def update_catalog request, options = nil
284
320
  raise ::ArgumentError, "request must be provided" if request.nil?
285
321
 
@@ -395,6 +431,22 @@ module Google
395
431
  # @return [::Google::Protobuf::Empty]
396
432
  #
397
433
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
434
+ #
435
+ # @example Basic example
436
+ # require "google/cloud/retail/v2"
437
+ #
438
+ # # Create a client object. The client can be reused for multiple calls.
439
+ # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
440
+ #
441
+ # # Create a request. To set request fields, pass in keyword arguments.
442
+ # request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new
443
+ #
444
+ # # Call the set_default_branch method.
445
+ # result = client.set_default_branch request
446
+ #
447
+ # # The returned object is of type Google::Protobuf::Empty.
448
+ # p result
449
+ #
398
450
  def set_default_branch request, options = nil
399
451
  raise ::ArgumentError, "request must be provided" if request.nil?
400
452
 
@@ -460,6 +512,22 @@ module Google
460
512
  # @return [::Google::Cloud::Retail::V2::GetDefaultBranchResponse]
461
513
  #
462
514
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
515
+ #
516
+ # @example Basic example
517
+ # require "google/cloud/retail/v2"
518
+ #
519
+ # # Create a client object. The client can be reused for multiple calls.
520
+ # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
521
+ #
522
+ # # Create a request. To set request fields, pass in keyword arguments.
523
+ # request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new
524
+ #
525
+ # # Call the get_default_branch method.
526
+ # result = client.get_default_branch request
527
+ #
528
+ # # The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse.
529
+ # p result
530
+ #
463
531
  def get_default_branch request, options = nil
464
532
  raise ::ArgumentError, "request must be provided" if request.nil?
465
533
 
@@ -523,6 +591,22 @@ module Google
523
591
  # @return [::Google::Cloud::Retail::V2::CompletionConfig]
524
592
  #
525
593
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
594
+ #
595
+ # @example Basic example
596
+ # require "google/cloud/retail/v2"
597
+ #
598
+ # # Create a client object. The client can be reused for multiple calls.
599
+ # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
600
+ #
601
+ # # Create a request. To set request fields, pass in keyword arguments.
602
+ # request = Google::Cloud::Retail::V2::GetCompletionConfigRequest.new
603
+ #
604
+ # # Call the get_completion_config method.
605
+ # result = client.get_completion_config request
606
+ #
607
+ # # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig.
608
+ # p result
609
+ #
526
610
  def get_completion_config request, options = nil
527
611
  raise ::ArgumentError, "request must be provided" if request.nil?
528
612
 
@@ -604,6 +688,22 @@ module Google
604
688
  # @return [::Google::Cloud::Retail::V2::CompletionConfig]
605
689
  #
606
690
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
691
+ #
692
+ # @example Basic example
693
+ # require "google/cloud/retail/v2"
694
+ #
695
+ # # Create a client object. The client can be reused for multiple calls.
696
+ # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
697
+ #
698
+ # # Create a request. To set request fields, pass in keyword arguments.
699
+ # request = Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new
700
+ #
701
+ # # Call the update_completion_config method.
702
+ # result = client.update_completion_config request
703
+ #
704
+ # # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig.
705
+ # p result
706
+ #
607
707
  def update_completion_config request, options = nil
608
708
  raise ::ArgumentError, "request must be provided" if request.nil?
609
709
 
@@ -667,6 +767,22 @@ module Google
667
767
  # @return [::Google::Cloud::Retail::V2::AttributesConfig]
668
768
  #
669
769
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
770
+ #
771
+ # @example Basic example
772
+ # require "google/cloud/retail/v2"
773
+ #
774
+ # # Create a client object. The client can be reused for multiple calls.
775
+ # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
776
+ #
777
+ # # Create a request. To set request fields, pass in keyword arguments.
778
+ # request = Google::Cloud::Retail::V2::GetAttributesConfigRequest.new
779
+ #
780
+ # # Call the get_attributes_config method.
781
+ # result = client.get_attributes_config request
782
+ #
783
+ # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig.
784
+ # p result
785
+ #
670
786
  def get_attributes_config request, options = nil
671
787
  raise ::ArgumentError, "request must be provided" if request.nil?
672
788
 
@@ -745,6 +861,22 @@ module Google
745
861
  # @return [::Google::Cloud::Retail::V2::AttributesConfig]
746
862
  #
747
863
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
864
+ #
865
+ # @example Basic example
866
+ # require "google/cloud/retail/v2"
867
+ #
868
+ # # Create a client object. The client can be reused for multiple calls.
869
+ # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
870
+ #
871
+ # # Create a request. To set request fields, pass in keyword arguments.
872
+ # request = Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new
873
+ #
874
+ # # Call the update_attributes_config method.
875
+ # result = client.update_attributes_config request
876
+ #
877
+ # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig.
878
+ # p result
879
+ #
748
880
  def update_attributes_config request, options = nil
749
881
  raise ::ArgumentError, "request must be provided" if request.nil?
750
882
 
@@ -816,6 +948,22 @@ module Google
816
948
  # @return [::Google::Cloud::Retail::V2::AttributesConfig]
817
949
  #
818
950
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
951
+ #
952
+ # @example Basic example
953
+ # require "google/cloud/retail/v2"
954
+ #
955
+ # # Create a client object. The client can be reused for multiple calls.
956
+ # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
957
+ #
958
+ # # Create a request. To set request fields, pass in keyword arguments.
959
+ # request = Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new
960
+ #
961
+ # # Call the add_catalog_attribute method.
962
+ # result = client.add_catalog_attribute request
963
+ #
964
+ # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig.
965
+ # p result
966
+ #
819
967
  def add_catalog_attribute request, options = nil
820
968
  raise ::ArgumentError, "request must be provided" if request.nil?
821
969
 
@@ -887,6 +1035,22 @@ module Google
887
1035
  # @return [::Google::Cloud::Retail::V2::AttributesConfig]
888
1036
  #
889
1037
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1038
+ #
1039
+ # @example Basic example
1040
+ # require "google/cloud/retail/v2"
1041
+ #
1042
+ # # Create a client object. The client can be reused for multiple calls.
1043
+ # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
1044
+ #
1045
+ # # Create a request. To set request fields, pass in keyword arguments.
1046
+ # request = Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new
1047
+ #
1048
+ # # Call the remove_catalog_attribute method.
1049
+ # result = client.remove_catalog_attribute request
1050
+ #
1051
+ # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig.
1052
+ # p result
1053
+ #
890
1054
  def remove_catalog_attribute request, options = nil
891
1055
  raise ::ArgumentError, "request must be provided" if request.nil?
892
1056
 
@@ -968,6 +1132,22 @@ module Google
968
1132
  # @return [::Google::Cloud::Retail::V2::AttributesConfig]
969
1133
  #
970
1134
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1135
+ #
1136
+ # @example Basic example
1137
+ # require "google/cloud/retail/v2"
1138
+ #
1139
+ # # Create a client object. The client can be reused for multiple calls.
1140
+ # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
1141
+ #
1142
+ # # Create a request. To set request fields, pass in keyword arguments.
1143
+ # request = Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new
1144
+ #
1145
+ # # Call the replace_catalog_attribute method.
1146
+ # result = client.replace_catalog_attribute request
1147
+ #
1148
+ # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig.
1149
+ # p result
1150
+ #
971
1151
  def replace_catalog_attribute request, options = nil
972
1152
  raise ::ArgumentError, "request must be provided" if request.nil?
973
1153
 
@@ -1076,7 +1256,9 @@ module Google
1076
1256
  class Configuration
1077
1257
  extend ::Gapic::Config
1078
1258
 
1079
- config_attr :endpoint, "retail.googleapis.com", ::String
1259
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
1260
+
1261
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1080
1262
  config_attr :credentials, nil do |value|
1081
1263
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1082
1264
  allowed.any? { |klass| klass === value }
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_list_catalogs_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_update_catalog_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_set_default_branch_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_get_default_branch_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_get_completion_config_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_update_completion_config_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_get_attributes_config_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_update_attributes_config_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_add_catalog_attribute_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_remove_catalog_attribute_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_replace_catalog_attribute_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
@@ -159,7 +159,8 @@ module Google
159
159
  credentials: credentials,
160
160
  endpoint: @config.endpoint,
161
161
  channel_args: @config.channel_args,
162
- interceptors: @config.interceptors
162
+ interceptors: @config.interceptors,
163
+ channel_pool_config: @config.channel_pool
163
164
  )
164
165
  end
165
166
 
@@ -530,7 +531,9 @@ module Google
530
531
  class Configuration
531
532
  extend ::Gapic::Config
532
533
 
533
- config_attr :endpoint, "retail.googleapis.com", ::String
534
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
535
+
536
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
534
537
  config_attr :credentials, nil do |value|
535
538
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
536
539
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -565,6 +568,14 @@ module Google
565
568
  end
566
569
  end
567
570
 
571
+ ##
572
+ # Configuration for the channel pool
573
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
574
+ #
575
+ def channel_pool
576
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
577
+ end
578
+
568
579
  ##
569
580
  # Configuration RPC class for the CompletionService API.
570
581
  #
@@ -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
  #
@@ -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
@@ -270,6 +270,22 @@ module Google
270
270
  # @return [::Google::Cloud::Retail::V2::CompleteQueryResponse]
271
271
  #
272
272
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
273
+ #
274
+ # @example Basic example
275
+ # require "google/cloud/retail/v2"
276
+ #
277
+ # # Create a client object. The client can be reused for multiple calls.
278
+ # client = Google::Cloud::Retail::V2::CompletionService::Rest::Client.new
279
+ #
280
+ # # Create a request. To set request fields, pass in keyword arguments.
281
+ # request = Google::Cloud::Retail::V2::CompleteQueryRequest.new
282
+ #
283
+ # # Call the complete_query method.
284
+ # result = client.complete_query request
285
+ #
286
+ # # The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse.
287
+ # p result
288
+ #
273
289
  def complete_query request, options = nil
274
290
  raise ::ArgumentError, "request must be provided" if request.nil?
275
291
 
@@ -350,6 +366,29 @@ module Google
350
366
  # @return [::Gapic::Operation]
351
367
  #
352
368
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
369
+ #
370
+ # @example Basic example
371
+ # require "google/cloud/retail/v2"
372
+ #
373
+ # # Create a client object. The client can be reused for multiple calls.
374
+ # client = Google::Cloud::Retail::V2::CompletionService::Rest::Client.new
375
+ #
376
+ # # Create a request. To set request fields, pass in keyword arguments.
377
+ # request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new
378
+ #
379
+ # # Call the import_completion_data method.
380
+ # result = client.import_completion_data request
381
+ #
382
+ # # The returned object is of type Gapic::Operation. You can use it to
383
+ # # check the status of an operation, cancel it, or wait for results.
384
+ # # Here is how to wait for a response.
385
+ # result.wait_until_done! timeout: 60
386
+ # if result.response?
387
+ # p result.response
388
+ # else
389
+ # puts "No response received."
390
+ # end
391
+ #
353
392
  def import_completion_data request, options = nil
354
393
  raise ::ArgumentError, "request must be provided" if request.nil?
355
394
 
@@ -459,7 +498,9 @@ module Google
459
498
  class Configuration
460
499
  extend ::Gapic::Config
461
500
 
462
- config_attr :endpoint, "retail.googleapis.com", ::String
501
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
502
+
503
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
463
504
  config_attr :credentials, nil do |value|
464
505
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
465
506
  allowed.any? { |klass| klass === value }