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
@@ -124,7 +124,7 @@ module Google
124
124
  credentials = @config.credentials
125
125
  # Use self-signed JWT if the endpoint is unchanged from default,
126
126
  # but only if the default endpoint does not have a region prefix.
127
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
127
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
128
128
  !@config.endpoint.split(".").first.include?("-")
129
129
  credentials ||= Credentials.default scope: @config.scope,
130
130
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -145,7 +145,8 @@ module Google
145
145
  credentials: credentials,
146
146
  endpoint: @config.endpoint,
147
147
  channel_args: @config.channel_args,
148
- interceptors: @config.interceptors
148
+ interceptors: @config.interceptors,
149
+ channel_pool_config: @config.channel_pool
149
150
  )
150
151
  end
151
152
 
@@ -892,7 +893,9 @@ module Google
892
893
  class Configuration
893
894
  extend ::Gapic::Config
894
895
 
895
- config_attr :endpoint, "retail.googleapis.com", ::String
896
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
897
+
898
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
896
899
  config_attr :credentials, nil do |value|
897
900
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
898
901
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -927,6 +930,14 @@ module Google
927
930
  end
928
931
  end
929
932
 
933
+ ##
934
+ # Configuration for the channel pool
935
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
936
+ #
937
+ def channel_pool
938
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
939
+ end
940
+
930
941
  ##
931
942
  # Configuration RPC class for the ServingConfigService API.
932
943
  #
@@ -120,7 +120,7 @@ module Google
120
120
  credentials = @config.credentials
121
121
  # Use self-signed JWT if the endpoint is unchanged from default,
122
122
  # but only if the default endpoint does not have a region prefix.
123
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
123
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
124
124
  !@config.endpoint.split(".").first.include?("-")
125
125
  credentials ||= Credentials.default scope: @config.scope,
126
126
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -189,6 +189,22 @@ module Google
189
189
  # @return [::Google::Cloud::Retail::V2::ServingConfig]
190
190
  #
191
191
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
192
+ #
193
+ # @example Basic example
194
+ # require "google/cloud/retail/v2"
195
+ #
196
+ # # Create a client object. The client can be reused for multiple calls.
197
+ # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new
198
+ #
199
+ # # Create a request. To set request fields, pass in keyword arguments.
200
+ # request = Google::Cloud::Retail::V2::CreateServingConfigRequest.new
201
+ #
202
+ # # Call the create_serving_config method.
203
+ # result = client.create_serving_config request
204
+ #
205
+ # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig.
206
+ # p result
207
+ #
192
208
  def create_serving_config request, options = nil
193
209
  raise ::ArgumentError, "request must be provided" if request.nil?
194
210
 
@@ -254,6 +270,22 @@ module Google
254
270
  # @return [::Google::Protobuf::Empty]
255
271
  #
256
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::ServingConfigService::Rest::Client.new
279
+ #
280
+ # # Create a request. To set request fields, pass in keyword arguments.
281
+ # request = Google::Cloud::Retail::V2::DeleteServingConfigRequest.new
282
+ #
283
+ # # Call the delete_serving_config method.
284
+ # result = client.delete_serving_config request
285
+ #
286
+ # # The returned object is of type Google::Protobuf::Empty.
287
+ # p result
288
+ #
257
289
  def delete_serving_config request, options = nil
258
290
  raise ::ArgumentError, "request must be provided" if request.nil?
259
291
 
@@ -324,6 +356,22 @@ module Google
324
356
  # @return [::Google::Cloud::Retail::V2::ServingConfig]
325
357
  #
326
358
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
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::ServingConfigService::Rest::Client.new
365
+ #
366
+ # # Create a request. To set request fields, pass in keyword arguments.
367
+ # request = Google::Cloud::Retail::V2::UpdateServingConfigRequest.new
368
+ #
369
+ # # Call the update_serving_config method.
370
+ # result = client.update_serving_config request
371
+ #
372
+ # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig.
373
+ # p result
374
+ #
327
375
  def update_serving_config request, options = nil
328
376
  raise ::ArgumentError, "request must be provided" if request.nil?
329
377
 
@@ -389,6 +437,22 @@ module Google
389
437
  # @return [::Google::Cloud::Retail::V2::ServingConfig]
390
438
  #
391
439
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
440
+ #
441
+ # @example Basic example
442
+ # require "google/cloud/retail/v2"
443
+ #
444
+ # # Create a client object. The client can be reused for multiple calls.
445
+ # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new
446
+ #
447
+ # # Create a request. To set request fields, pass in keyword arguments.
448
+ # request = Google::Cloud::Retail::V2::GetServingConfigRequest.new
449
+ #
450
+ # # Call the get_serving_config method.
451
+ # result = client.get_serving_config request
452
+ #
453
+ # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig.
454
+ # p result
455
+ #
392
456
  def get_serving_config request, options = nil
393
457
  raise ::ArgumentError, "request must be provided" if request.nil?
394
458
 
@@ -459,6 +523,26 @@ module Google
459
523
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::ServingConfig>]
460
524
  #
461
525
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
526
+ #
527
+ # @example Basic example
528
+ # require "google/cloud/retail/v2"
529
+ #
530
+ # # Create a client object. The client can be reused for multiple calls.
531
+ # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new
532
+ #
533
+ # # Create a request. To set request fields, pass in keyword arguments.
534
+ # request = Google::Cloud::Retail::V2::ListServingConfigsRequest.new
535
+ #
536
+ # # Call the list_serving_configs method.
537
+ # result = client.list_serving_configs request
538
+ #
539
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
540
+ # # over elements, and API calls will be issued to fetch pages as needed.
541
+ # result.each do |item|
542
+ # # Each element is of type ::Google::Cloud::Retail::V2::ServingConfig.
543
+ # p item
544
+ # end
545
+ #
462
546
  def list_serving_configs request, options = nil
463
547
  raise ::ArgumentError, "request must be provided" if request.nil?
464
548
 
@@ -532,6 +616,22 @@ module Google
532
616
  # @return [::Google::Cloud::Retail::V2::ServingConfig]
533
617
  #
534
618
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
619
+ #
620
+ # @example Basic example
621
+ # require "google/cloud/retail/v2"
622
+ #
623
+ # # Create a client object. The client can be reused for multiple calls.
624
+ # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new
625
+ #
626
+ # # Create a request. To set request fields, pass in keyword arguments.
627
+ # request = Google::Cloud::Retail::V2::AddControlRequest.new
628
+ #
629
+ # # Call the add_control method.
630
+ # result = client.add_control request
631
+ #
632
+ # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig.
633
+ # p result
634
+ #
535
635
  def add_control request, options = nil
536
636
  raise ::ArgumentError, "request must be provided" if request.nil?
537
637
 
@@ -601,6 +701,22 @@ module Google
601
701
  # @return [::Google::Cloud::Retail::V2::ServingConfig]
602
702
  #
603
703
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
704
+ #
705
+ # @example Basic example
706
+ # require "google/cloud/retail/v2"
707
+ #
708
+ # # Create a client object. The client can be reused for multiple calls.
709
+ # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new
710
+ #
711
+ # # Create a request. To set request fields, pass in keyword arguments.
712
+ # request = Google::Cloud::Retail::V2::RemoveControlRequest.new
713
+ #
714
+ # # Call the remove_control method.
715
+ # result = client.remove_control request
716
+ #
717
+ # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig.
718
+ # p result
719
+ #
604
720
  def remove_control request, options = nil
605
721
  raise ::ArgumentError, "request must be provided" if request.nil?
606
722
 
@@ -709,7 +825,9 @@ module Google
709
825
  class Configuration
710
826
  extend ::Gapic::Config
711
827
 
712
- config_attr :endpoint, "retail.googleapis.com", ::String
828
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
829
+
830
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
713
831
  config_attr :credentials, nil do |value|
714
832
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
715
833
  allowed.any? { |klass| klass === value }
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_create_serving_config_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_delete_serving_config_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_update_serving_config_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_serving_config_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_list_serving_configs_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_add_control_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_remove_control_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
@@ -139,7 +139,7 @@ module Google
139
139
  credentials = @config.credentials
140
140
  # Use self-signed JWT if the endpoint is unchanged from default,
141
141
  # but only if the default endpoint does not have a region prefix.
142
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
142
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
143
143
  !@config.endpoint.split(".").first.include?("-")
144
144
  credentials ||= Credentials.default scope: @config.scope,
145
145
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -166,7 +166,8 @@ module Google
166
166
  credentials: credentials,
167
167
  endpoint: @config.endpoint,
168
168
  channel_args: @config.channel_args,
169
- interceptors: @config.interceptors
169
+ interceptors: @config.interceptors,
170
+ channel_pool_config: @config.channel_pool
170
171
  )
171
172
  end
172
173
 
@@ -807,7 +808,9 @@ module Google
807
808
  class Configuration
808
809
  extend ::Gapic::Config
809
810
 
810
- config_attr :endpoint, "retail.googleapis.com", ::String
811
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
812
+
813
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
811
814
  config_attr :credentials, nil do |value|
812
815
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
813
816
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -842,6 +845,14 @@ module Google
842
845
  end
843
846
  end
844
847
 
848
+ ##
849
+ # Configuration for the channel pool
850
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
851
+ #
852
+ def channel_pool
853
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
854
+ end
855
+
845
856
  ##
846
857
  # Configuration RPC class for the UserEventService API.
847
858
  #
@@ -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
  #
@@ -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
@@ -212,6 +212,22 @@ module Google
212
212
  # @return [::Google::Cloud::Retail::V2::UserEvent]
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::UserEventService::Rest::Client.new
221
+ #
222
+ # # Create a request. To set request fields, pass in keyword arguments.
223
+ # request = Google::Cloud::Retail::V2::WriteUserEventRequest.new
224
+ #
225
+ # # Call the write_user_event method.
226
+ # result = client.write_user_event request
227
+ #
228
+ # # The returned object is of type Google::Cloud::Retail::V2::UserEvent.
229
+ # p result
230
+ #
215
231
  def write_user_event request, options = nil
216
232
  raise ::ArgumentError, "request must be provided" if request.nil?
217
233
 
@@ -299,6 +315,22 @@ module Google
299
315
  # @return [::Google::Api::HttpBody]
300
316
  #
301
317
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
318
+ #
319
+ # @example Basic example
320
+ # require "google/cloud/retail/v2"
321
+ #
322
+ # # Create a client object. The client can be reused for multiple calls.
323
+ # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new
324
+ #
325
+ # # Create a request. To set request fields, pass in keyword arguments.
326
+ # request = Google::Cloud::Retail::V2::CollectUserEventRequest.new
327
+ #
328
+ # # Call the collect_user_event method.
329
+ # result = client.collect_user_event request
330
+ #
331
+ # # The returned object is of type Google::Api::HttpBody.
332
+ # p result
333
+ #
302
334
  def collect_user_event request, options = nil
303
335
  raise ::ArgumentError, "request must be provided" if request.nil?
304
336
 
@@ -394,6 +426,29 @@ module Google
394
426
  # @return [::Gapic::Operation]
395
427
  #
396
428
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
429
+ #
430
+ # @example Basic example
431
+ # require "google/cloud/retail/v2"
432
+ #
433
+ # # Create a client object. The client can be reused for multiple calls.
434
+ # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new
435
+ #
436
+ # # Create a request. To set request fields, pass in keyword arguments.
437
+ # request = Google::Cloud::Retail::V2::PurgeUserEventsRequest.new
438
+ #
439
+ # # Call the purge_user_events method.
440
+ # result = client.purge_user_events request
441
+ #
442
+ # # The returned object is of type Gapic::Operation. You can use it to
443
+ # # check the status of an operation, cancel it, or wait for results.
444
+ # # Here is how to wait for a response.
445
+ # result.wait_until_done! timeout: 60
446
+ # if result.response?
447
+ # p result.response
448
+ # else
449
+ # puts "No response received."
450
+ # end
451
+ #
397
452
  def purge_user_events request, options = nil
398
453
  raise ::ArgumentError, "request must be provided" if request.nil?
399
454
 
@@ -468,6 +523,29 @@ module Google
468
523
  # @return [::Gapic::Operation]
469
524
  #
470
525
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
526
+ #
527
+ # @example Basic example
528
+ # require "google/cloud/retail/v2"
529
+ #
530
+ # # Create a client object. The client can be reused for multiple calls.
531
+ # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new
532
+ #
533
+ # # Create a request. To set request fields, pass in keyword arguments.
534
+ # request = Google::Cloud::Retail::V2::ImportUserEventsRequest.new
535
+ #
536
+ # # Call the import_user_events method.
537
+ # result = client.import_user_events request
538
+ #
539
+ # # The returned object is of type Gapic::Operation. You can use it to
540
+ # # check the status of an operation, cancel it, or wait for results.
541
+ # # Here is how to wait for a response.
542
+ # result.wait_until_done! timeout: 60
543
+ # if result.response?
544
+ # p result.response
545
+ # else
546
+ # puts "No response received."
547
+ # end
548
+ #
471
549
  def import_user_events request, options = nil
472
550
  raise ::ArgumentError, "request must be provided" if request.nil?
473
551
 
@@ -544,6 +622,29 @@ module Google
544
622
  # @return [::Gapic::Operation]
545
623
  #
546
624
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
625
+ #
626
+ # @example Basic example
627
+ # require "google/cloud/retail/v2"
628
+ #
629
+ # # Create a client object. The client can be reused for multiple calls.
630
+ # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new
631
+ #
632
+ # # Create a request. To set request fields, pass in keyword arguments.
633
+ # request = Google::Cloud::Retail::V2::RejoinUserEventsRequest.new
634
+ #
635
+ # # Call the rejoin_user_events method.
636
+ # result = client.rejoin_user_events request
637
+ #
638
+ # # The returned object is of type Gapic::Operation. You can use it to
639
+ # # check the status of an operation, cancel it, or wait for results.
640
+ # # Here is how to wait for a response.
641
+ # result.wait_until_done! timeout: 60
642
+ # if result.response?
643
+ # p result.response
644
+ # else
645
+ # puts "No response received."
646
+ # end
647
+ #
547
648
  def rejoin_user_events request, options = nil
548
649
  raise ::ArgumentError, "request must be provided" if request.nil?
549
650
 
@@ -653,7 +754,9 @@ module Google
653
754
  class Configuration
654
755
  extend ::Gapic::Config
655
756
 
656
- config_attr :endpoint, "retail.googleapis.com", ::String
757
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
758
+
759
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
657
760
  config_attr :credentials, nil do |value|
658
761
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
659
762
  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