google-cloud-recommendation_engine-v1beta1 0.3.2 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/README.md +1 -1
  4. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb +187 -85
  5. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +149 -37
  6. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +108 -61
  7. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +60 -45
  8. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +170 -77
  9. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +149 -37
  10. data/lib/google/cloud/recommendation_engine/v1beta1/version.rb +1 -1
  11. data/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb +2 -2
  12. data/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb +2 -2
  13. data/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb +1 -1
  14. data/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb +2 -2
  15. data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb +2 -2
  16. data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb +2 -2
  17. data/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb +1 -1
  18. data/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb +2 -2
  19. data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb +2 -2
  20. data/proto_docs/google/api/field_behavior.rb +7 -1
  21. data/proto_docs/google/api/httpbody.rb +9 -4
  22. data/proto_docs/google/type/date.rb +14 -11
  23. metadata +4 -4
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all PredictionService clients:
47
- #
48
- # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all PredictionService clients
47
+ # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -67,10 +66,7 @@ module Google
67
66
 
68
67
  default_config.rpcs.predict.timeout = 600.0
69
68
  default_config.rpcs.predict.retry_policy = {
70
- initial_delay: 0.1,
71
- max_delay: 60.0,
72
- multiplier: 1.3,
73
- retry_codes: [14, 4]
69
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
74
70
  }
75
71
 
76
72
  default_config
@@ -102,19 +98,15 @@ module Google
102
98
  ##
103
99
  # Create a new PredictionService client object.
104
100
  #
105
- # ## Examples
106
- #
107
- # To create a new PredictionService client with the default
108
- # configuration:
101
+ # @example
109
102
  #
110
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new
111
105
  #
112
- # To create a new PredictionService client with a custom
113
- # configuration:
114
- #
115
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new do |config|
116
- # config.timeout = 10.0
117
- # end
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
118
110
  #
119
111
  # @yield [config] Configure the PredictionService client.
120
112
  # @yieldparam config [Client::Configuration]
@@ -134,14 +126,13 @@ module Google
134
126
 
135
127
  # Create credentials
136
128
  credentials = @config.credentials
137
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
129
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
130
  # but only if the default endpoint does not have a region prefix.
139
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
140
- @config.endpoint == Client.configure.endpoint &&
131
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
141
132
  !@config.endpoint.split(".").first.include?("-")
142
133
  credentials ||= Credentials.default scope: @config.scope,
143
134
  enable_self_signed_jwt: enable_self_signed_jwt
144
- if credentials.is_a?(String) || credentials.is_a?(Hash)
135
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
136
  credentials = Credentials.new credentials, scope: @config.scope
146
137
  end
147
138
  @quota_project_id = @config.quota_project
@@ -277,6 +268,27 @@ module Google
277
268
  #
278
269
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
279
270
  #
271
+ # @example Basic example
272
+ # require "google/cloud/recommendation_engine/v1beta1"
273
+ #
274
+ # # Create a client object. The client can be reused for multiple calls.
275
+ # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new
276
+ #
277
+ # # Create a request. To set request fields, pass in keyword arguments.
278
+ # request = Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new
279
+ #
280
+ # # Call the predict method.
281
+ # result = client.predict request
282
+ #
283
+ # # The returned object is of type Gapic::PagedEnumerable. You can
284
+ # # iterate over all elements by calling #each, and the enumerable
285
+ # # will lazily make API calls to fetch subsequent pages. Other
286
+ # # methods are also available for managing paging directly.
287
+ # result.each do |response|
288
+ # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult.
289
+ # p response
290
+ # end
291
+ #
280
292
  def predict request, options = nil
281
293
  raise ::ArgumentError, "request must be provided" if request.nil?
282
294
 
@@ -294,16 +306,20 @@ module Google
294
306
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
295
307
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
296
308
 
297
- header_params = {
298
- "name" => request.name
299
- }
309
+ header_params = {}
310
+ if request.name
311
+ header_params["name"] = request.name
312
+ end
313
+
300
314
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
301
315
  metadata[:"x-goog-request-params"] ||= request_params_header
302
316
 
303
317
  options.apply_defaults timeout: @config.rpcs.predict.timeout,
304
318
  metadata: metadata,
305
319
  retry_policy: @config.rpcs.predict.retry_policy
306
- options.apply_defaults metadata: @config.metadata,
320
+
321
+ options.apply_defaults timeout: @config.timeout,
322
+ metadata: @config.metadata,
307
323
  retry_policy: @config.retry_policy
308
324
 
309
325
  @prediction_service_stub.call_rpc :predict, request, options: options do |response, operation|
@@ -328,22 +344,21 @@ module Google
328
344
  # Configuration can be applied globally to all clients, or to a single client
329
345
  # on construction.
330
346
  #
331
- # # Examples
332
- #
333
- # To modify the global config, setting the timeout for predict
334
- # to 20 seconds, and all remaining timeouts to 10 seconds:
335
- #
336
- # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.configure do |config|
337
- # config.timeout = 10.0
338
- # config.rpcs.predict.timeout = 20.0
339
- # end
340
- #
341
- # To apply the above configuration only to a new client:
342
- #
343
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new do |config|
344
- # config.timeout = 10.0
345
- # config.rpcs.predict.timeout = 20.0
346
- # end
347
+ # @example
348
+ #
349
+ # # Modify the global config, setting the timeout for
350
+ # # predict to 20 seconds,
351
+ # # and all remaining timeouts to 10 seconds.
352
+ # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.configure do |config|
353
+ # config.timeout = 10.0
354
+ # config.rpcs.predict.timeout = 20.0
355
+ # end
356
+ #
357
+ # # Apply the above configuration only to a new client.
358
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new do |config|
359
+ # config.timeout = 10.0
360
+ # config.rpcs.predict.timeout = 20.0
361
+ # end
347
362
  #
348
363
  # @!attribute [rw] endpoint
349
364
  # The hostname or hostname:port of the service endpoint.
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all UserEventService clients:
47
- #
48
- # ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all UserEventService clients
47
+ # ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -67,42 +66,27 @@ module Google
67
66
 
68
67
  default_config.rpcs.write_user_event.timeout = 600.0
69
68
  default_config.rpcs.write_user_event.retry_policy = {
70
- initial_delay: 0.1,
71
- max_delay: 60.0,
72
- multiplier: 1.3,
73
- retry_codes: [14, 4]
69
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
74
70
  }
75
71
 
76
72
  default_config.rpcs.collect_user_event.timeout = 600.0
77
73
  default_config.rpcs.collect_user_event.retry_policy = {
78
- initial_delay: 0.1,
79
- max_delay: 60.0,
80
- multiplier: 1.3,
81
- retry_codes: [14, 4]
74
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
82
75
  }
83
76
 
84
77
  default_config.rpcs.list_user_events.timeout = 600.0
85
78
  default_config.rpcs.list_user_events.retry_policy = {
86
- initial_delay: 0.1,
87
- max_delay: 60.0,
88
- multiplier: 1.3,
89
- retry_codes: [14, 4]
79
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
90
80
  }
91
81
 
92
82
  default_config.rpcs.purge_user_events.timeout = 600.0
93
83
  default_config.rpcs.purge_user_events.retry_policy = {
94
- initial_delay: 0.1,
95
- max_delay: 60.0,
96
- multiplier: 1.3,
97
- retry_codes: [14, 4]
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
98
85
  }
99
86
 
100
87
  default_config.rpcs.import_user_events.timeout = 600.0
101
88
  default_config.rpcs.import_user_events.retry_policy = {
102
- initial_delay: 0.1,
103
- max_delay: 60.0,
104
- multiplier: 1.3,
105
- retry_codes: [14, 4]
89
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
106
90
  }
107
91
 
108
92
  default_config
@@ -134,19 +118,15 @@ module Google
134
118
  ##
135
119
  # Create a new UserEventService client object.
136
120
  #
137
- # ## Examples
138
- #
139
- # To create a new UserEventService client with the default
140
- # configuration:
141
- #
142
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new
121
+ # @example
143
122
  #
144
- # To create a new UserEventService client with a custom
145
- # configuration:
123
+ # # Create a client using the default configuration
124
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new
146
125
  #
147
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config|
148
- # config.timeout = 10.0
149
- # end
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config|
128
+ # config.timeout = 10.0
129
+ # end
150
130
  #
151
131
  # @yield [config] Configure the UserEventService client.
152
132
  # @yieldparam config [Client::Configuration]
@@ -166,14 +146,13 @@ module Google
166
146
 
167
147
  # Create credentials
168
148
  credentials = @config.credentials
169
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
149
+ # Use self-signed JWT if the endpoint is unchanged from default,
170
150
  # but only if the default endpoint does not have a region prefix.
171
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
172
- @config.endpoint == Client.configure.endpoint &&
151
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
173
152
  !@config.endpoint.split(".").first.include?("-")
174
153
  credentials ||= Credentials.default scope: @config.scope,
175
154
  enable_self_signed_jwt: enable_self_signed_jwt
176
- if credentials.is_a?(String) || credentials.is_a?(Hash)
155
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
177
156
  credentials = Credentials.new credentials, scope: @config.scope
178
157
  end
179
158
  @quota_project_id = @config.quota_project
@@ -234,6 +213,21 @@ module Google
234
213
  #
235
214
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
236
215
  #
216
+ # @example Basic example
217
+ # require "google/cloud/recommendation_engine/v1beta1"
218
+ #
219
+ # # Create a client object. The client can be reused for multiple calls.
220
+ # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new
221
+ #
222
+ # # Create a request. To set request fields, pass in keyword arguments.
223
+ # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEvent.
229
+ # p result
230
+ #
237
231
  def write_user_event request, options = nil
238
232
  raise ::ArgumentError, "request must be provided" if request.nil?
239
233
 
@@ -251,16 +245,20 @@ module Google
251
245
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
252
246
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
253
247
 
254
- header_params = {
255
- "parent" => request.parent
256
- }
248
+ header_params = {}
249
+ if request.parent
250
+ header_params["parent"] = request.parent
251
+ end
252
+
257
253
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
258
254
  metadata[:"x-goog-request-params"] ||= request_params_header
259
255
 
260
256
  options.apply_defaults timeout: @config.rpcs.write_user_event.timeout,
261
257
  metadata: metadata,
262
258
  retry_policy: @config.rpcs.write_user_event.retry_policy
263
- options.apply_defaults metadata: @config.metadata,
259
+
260
+ options.apply_defaults timeout: @config.timeout,
261
+ metadata: @config.metadata,
264
262
  retry_policy: @config.retry_policy
265
263
 
266
264
  @user_event_service_stub.call_rpc :write_user_event, request, options: options do |response, operation|
@@ -316,6 +314,21 @@ module Google
316
314
  #
317
315
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
318
316
  #
317
+ # @example Basic example
318
+ # require "google/cloud/recommendation_engine/v1beta1"
319
+ #
320
+ # # Create a client object. The client can be reused for multiple calls.
321
+ # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new
322
+ #
323
+ # # Create a request. To set request fields, pass in keyword arguments.
324
+ # request = Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest.new
325
+ #
326
+ # # Call the collect_user_event method.
327
+ # result = client.collect_user_event request
328
+ #
329
+ # # The returned object is of type Google::Api::HttpBody.
330
+ # p result
331
+ #
319
332
  def collect_user_event request, options = nil
320
333
  raise ::ArgumentError, "request must be provided" if request.nil?
321
334
 
@@ -333,16 +346,20 @@ module Google
333
346
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
334
347
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
335
348
 
336
- header_params = {
337
- "parent" => request.parent
338
- }
349
+ header_params = {}
350
+ if request.parent
351
+ header_params["parent"] = request.parent
352
+ end
353
+
339
354
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
340
355
  metadata[:"x-goog-request-params"] ||= request_params_header
341
356
 
342
357
  options.apply_defaults timeout: @config.rpcs.collect_user_event.timeout,
343
358
  metadata: metadata,
344
359
  retry_policy: @config.rpcs.collect_user_event.retry_policy
345
- options.apply_defaults metadata: @config.metadata,
360
+
361
+ options.apply_defaults timeout: @config.timeout,
362
+ metadata: @config.metadata,
346
363
  retry_policy: @config.retry_policy
347
364
 
348
365
  @user_event_service_stub.call_rpc :collect_user_event, request, options: options do |response, operation|
@@ -421,6 +438,27 @@ module Google
421
438
  #
422
439
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
423
440
  #
441
+ # @example Basic example
442
+ # require "google/cloud/recommendation_engine/v1beta1"
443
+ #
444
+ # # Create a client object. The client can be reused for multiple calls.
445
+ # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new
446
+ #
447
+ # # Create a request. To set request fields, pass in keyword arguments.
448
+ # request = Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.new
449
+ #
450
+ # # Call the list_user_events method.
451
+ # result = client.list_user_events request
452
+ #
453
+ # # The returned object is of type Gapic::PagedEnumerable. You can
454
+ # # iterate over all elements by calling #each, and the enumerable
455
+ # # will lazily make API calls to fetch subsequent pages. Other
456
+ # # methods are also available for managing paging directly.
457
+ # result.each do |response|
458
+ # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent.
459
+ # p response
460
+ # end
461
+ #
424
462
  def list_user_events request, options = nil
425
463
  raise ::ArgumentError, "request must be provided" if request.nil?
426
464
 
@@ -438,16 +476,20 @@ module Google
438
476
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
439
477
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
440
478
 
441
- header_params = {
442
- "parent" => request.parent
443
- }
479
+ header_params = {}
480
+ if request.parent
481
+ header_params["parent"] = request.parent
482
+ end
483
+
444
484
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
445
485
  metadata[:"x-goog-request-params"] ||= request_params_header
446
486
 
447
487
  options.apply_defaults timeout: @config.rpcs.list_user_events.timeout,
448
488
  metadata: metadata,
449
489
  retry_policy: @config.rpcs.list_user_events.retry_policy
450
- options.apply_defaults metadata: @config.metadata,
490
+
491
+ options.apply_defaults timeout: @config.timeout,
492
+ metadata: @config.metadata,
451
493
  retry_policy: @config.retry_policy
452
494
 
453
495
  @user_event_service_stub.call_rpc :list_user_events, request, options: options do |response, operation|
@@ -516,6 +558,28 @@ module Google
516
558
  #
517
559
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
518
560
  #
561
+ # @example Basic example
562
+ # require "google/cloud/recommendation_engine/v1beta1"
563
+ #
564
+ # # Create a client object. The client can be reused for multiple calls.
565
+ # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new
566
+ #
567
+ # # Create a request. To set request fields, pass in keyword arguments.
568
+ # request = Google::Cloud::RecommendationEngine::V1beta1::PurgeUserEventsRequest.new
569
+ #
570
+ # # Call the purge_user_events method.
571
+ # result = client.purge_user_events request
572
+ #
573
+ # # The returned object is of type Gapic::Operation. You can use this
574
+ # # object to check the status of an operation, cancel it, or wait
575
+ # # for results. Here is how to block until completion:
576
+ # result.wait_until_done! timeout: 60
577
+ # if result.response?
578
+ # p result.response
579
+ # else
580
+ # puts "Error!"
581
+ # end
582
+ #
519
583
  def purge_user_events request, options = nil
520
584
  raise ::ArgumentError, "request must be provided" if request.nil?
521
585
 
@@ -533,16 +597,20 @@ module Google
533
597
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
534
598
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
535
599
 
536
- header_params = {
537
- "parent" => request.parent
538
- }
600
+ header_params = {}
601
+ if request.parent
602
+ header_params["parent"] = request.parent
603
+ end
604
+
539
605
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
540
606
  metadata[:"x-goog-request-params"] ||= request_params_header
541
607
 
542
608
  options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout,
543
609
  metadata: metadata,
544
610
  retry_policy: @config.rpcs.purge_user_events.retry_policy
545
- options.apply_defaults metadata: @config.metadata,
611
+
612
+ options.apply_defaults timeout: @config.timeout,
613
+ metadata: @config.metadata,
546
614
  retry_policy: @config.retry_policy
547
615
 
548
616
  @user_event_service_stub.call_rpc :purge_user_events, request, options: options do |response, operation|
@@ -601,6 +669,28 @@ module Google
601
669
  #
602
670
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
603
671
  #
672
+ # @example Basic example
673
+ # require "google/cloud/recommendation_engine/v1beta1"
674
+ #
675
+ # # Create a client object. The client can be reused for multiple calls.
676
+ # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new
677
+ #
678
+ # # Create a request. To set request fields, pass in keyword arguments.
679
+ # request = Google::Cloud::RecommendationEngine::V1beta1::ImportUserEventsRequest.new
680
+ #
681
+ # # Call the import_user_events method.
682
+ # result = client.import_user_events request
683
+ #
684
+ # # The returned object is of type Gapic::Operation. You can use this
685
+ # # object to check the status of an operation, cancel it, or wait
686
+ # # for results. Here is how to block until completion:
687
+ # result.wait_until_done! timeout: 60
688
+ # if result.response?
689
+ # p result.response
690
+ # else
691
+ # puts "Error!"
692
+ # end
693
+ #
604
694
  def import_user_events request, options = nil
605
695
  raise ::ArgumentError, "request must be provided" if request.nil?
606
696
 
@@ -618,16 +708,20 @@ module Google
618
708
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
619
709
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
620
710
 
621
- header_params = {
622
- "parent" => request.parent
623
- }
711
+ header_params = {}
712
+ if request.parent
713
+ header_params["parent"] = request.parent
714
+ end
715
+
624
716
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
625
717
  metadata[:"x-goog-request-params"] ||= request_params_header
626
718
 
627
719
  options.apply_defaults timeout: @config.rpcs.import_user_events.timeout,
628
720
  metadata: metadata,
629
721
  retry_policy: @config.rpcs.import_user_events.retry_policy
630
- options.apply_defaults metadata: @config.metadata,
722
+
723
+ options.apply_defaults timeout: @config.timeout,
724
+ metadata: @config.metadata,
631
725
  retry_policy: @config.retry_policy
632
726
 
633
727
  @user_event_service_stub.call_rpc :import_user_events, request, options: options do |response, operation|
@@ -652,22 +746,21 @@ module Google
652
746
  # Configuration can be applied globally to all clients, or to a single client
653
747
  # on construction.
654
748
  #
655
- # # Examples
656
- #
657
- # To modify the global config, setting the timeout for write_user_event
658
- # to 20 seconds, and all remaining timeouts to 10 seconds:
659
- #
660
- # ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.configure do |config|
661
- # config.timeout = 10.0
662
- # config.rpcs.write_user_event.timeout = 20.0
663
- # end
664
- #
665
- # To apply the above configuration only to a new client:
666
- #
667
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config|
668
- # config.timeout = 10.0
669
- # config.rpcs.write_user_event.timeout = 20.0
670
- # end
749
+ # @example
750
+ #
751
+ # # Modify the global config, setting the timeout for
752
+ # # write_user_event to 20 seconds,
753
+ # # and all remaining timeouts to 10 seconds.
754
+ # ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.configure do |config|
755
+ # config.timeout = 10.0
756
+ # config.rpcs.write_user_event.timeout = 20.0
757
+ # end
758
+ #
759
+ # # Apply the above configuration only to a new client.
760
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config|
761
+ # config.timeout = 10.0
762
+ # config.rpcs.write_user_event.timeout = 20.0
763
+ # end
671
764
  #
672
765
  # @!attribute [rw] endpoint
673
766
  # The hostname or hostname:port of the service endpoint.