google-cloud-recommendation_engine-v1beta1 0.3.2 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb +187 -85
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +149 -37
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +108 -61
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +60 -45
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +170 -77
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +149 -37
- data/lib/google/cloud/recommendation_engine/v1beta1/version.rb +1 -1
- data/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb +2 -2
- data/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb +2 -2
- data/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb +1 -1
- data/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb +2 -2
- data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb +2 -2
- data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb +2 -2
- data/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb +1 -1
- data/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb +2 -2
- data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb +2 -2
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/api/httpbody.rb +9 -4
- data/proto_docs/google/type/date.rb +14 -11
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97d63c8f98c3c4ecdfbbf93301cef165679d6be77d62256015857bf1e12712cf
|
4
|
+
data.tar.gz: d3906b8b4f0761fa89331fae7707398b3ab376fdaefcb218bdcab5965e36acb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f386f017411cc4e74cd72485464a826b96c97c3009ba4c14094758f4332a1c951793c48ab790b41425771ac596d7102e3954fe851af9169f2da25714de89649
|
7
|
+
data.tar.gz: b7904644ab34032d1b938b1ce21a126500e33a282e2dcf589154d29bd9a300395bd381938522afbec35b33125145405e9a087db29e0760f348ef021483dab94f
|
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-recommendation_engine-v1beta1
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Credentials}):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
* `RECOMMENDATION_ENGINE_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
|
+
* `RECOMMENDATION_ENGINE_KEYFILE` - Path to JSON file, or JSON contents
|
71
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
72
|
+
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
73
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
require "google/cloud/recommendation_engine/v1beta1"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/recommendation_engine/v1beta1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/recommendation_engine/v1beta1"
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
|
|
33
33
|
require "google/cloud/recommendation_engine/v1beta1"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.create_catalog_item request
|
38
38
|
```
|
39
39
|
|
@@ -41,13 +41,12 @@ module Google
|
|
41
41
|
# See {::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all CatalogService clients
|
47
|
+
# ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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,50 +66,32 @@ module Google
|
|
67
66
|
|
68
67
|
default_config.rpcs.create_catalog_item.timeout = 600.0
|
69
68
|
default_config.rpcs.create_catalog_item.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.get_catalog_item.timeout = 600.0
|
77
73
|
default_config.rpcs.get_catalog_item.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_catalog_items.timeout = 600.0
|
85
78
|
default_config.rpcs.list_catalog_items.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.update_catalog_item.timeout = 600.0
|
93
83
|
default_config.rpcs.update_catalog_item.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.delete_catalog_item.timeout = 600.0
|
101
88
|
default_config.rpcs.delete_catalog_item.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.rpcs.import_catalog_items.timeout = 600.0
|
109
93
|
default_config.rpcs.import_catalog_items.retry_policy = {
|
110
|
-
initial_delay: 0.1,
|
111
|
-
max_delay: 60.0,
|
112
|
-
multiplier: 1.3,
|
113
|
-
retry_codes: [14, 4]
|
94
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
114
95
|
}
|
115
96
|
|
116
97
|
default_config
|
@@ -142,19 +123,15 @@ module Google
|
|
142
123
|
##
|
143
124
|
# Create a new CatalogService client object.
|
144
125
|
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
# To create a new CatalogService client with the default
|
148
|
-
# configuration:
|
126
|
+
# @example
|
149
127
|
#
|
150
|
-
#
|
128
|
+
# # Create a client using the default configuration
|
129
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
151
130
|
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
# config.timeout = 10.0
|
157
|
-
# end
|
131
|
+
# # Create a client using a custom configuration
|
132
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config|
|
133
|
+
# config.timeout = 10.0
|
134
|
+
# end
|
158
135
|
#
|
159
136
|
# @yield [config] Configure the CatalogService client.
|
160
137
|
# @yieldparam config [Client::Configuration]
|
@@ -174,14 +151,13 @@ module Google
|
|
174
151
|
|
175
152
|
# Create credentials
|
176
153
|
credentials = @config.credentials
|
177
|
-
# Use self-signed JWT if the
|
154
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
178
155
|
# but only if the default endpoint does not have a region prefix.
|
179
|
-
enable_self_signed_jwt = @config.
|
180
|
-
@config.endpoint == Client.configure.endpoint &&
|
156
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
181
157
|
!@config.endpoint.split(".").first.include?("-")
|
182
158
|
credentials ||= Credentials.default scope: @config.scope,
|
183
159
|
enable_self_signed_jwt: enable_self_signed_jwt
|
184
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
160
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
185
161
|
credentials = Credentials.new credentials, scope: @config.scope
|
186
162
|
end
|
187
163
|
@quota_project_id = @config.quota_project
|
@@ -242,6 +218,21 @@ module Google
|
|
242
218
|
#
|
243
219
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
244
220
|
#
|
221
|
+
# @example Basic example
|
222
|
+
# require "google/cloud/recommendation_engine/v1beta1"
|
223
|
+
#
|
224
|
+
# # Create a client object. The client can be reused for multiple calls.
|
225
|
+
# client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
226
|
+
#
|
227
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
228
|
+
# request = Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new
|
229
|
+
#
|
230
|
+
# # Call the create_catalog_item method.
|
231
|
+
# result = client.create_catalog_item request
|
232
|
+
#
|
233
|
+
# # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.
|
234
|
+
# p result
|
235
|
+
#
|
245
236
|
def create_catalog_item request, options = nil
|
246
237
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
247
238
|
|
@@ -259,16 +250,20 @@ module Google
|
|
259
250
|
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
260
251
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
261
252
|
|
262
|
-
header_params = {
|
263
|
-
|
264
|
-
|
253
|
+
header_params = {}
|
254
|
+
if request.parent
|
255
|
+
header_params["parent"] = request.parent
|
256
|
+
end
|
257
|
+
|
265
258
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
266
259
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
267
260
|
|
268
261
|
options.apply_defaults timeout: @config.rpcs.create_catalog_item.timeout,
|
269
262
|
metadata: metadata,
|
270
263
|
retry_policy: @config.rpcs.create_catalog_item.retry_policy
|
271
|
-
|
264
|
+
|
265
|
+
options.apply_defaults timeout: @config.timeout,
|
266
|
+
metadata: @config.metadata,
|
272
267
|
retry_policy: @config.retry_policy
|
273
268
|
|
274
269
|
@catalog_service_stub.call_rpc :create_catalog_item, request, options: options do |response, operation|
|
@@ -309,6 +304,21 @@ module Google
|
|
309
304
|
#
|
310
305
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
311
306
|
#
|
307
|
+
# @example Basic example
|
308
|
+
# require "google/cloud/recommendation_engine/v1beta1"
|
309
|
+
#
|
310
|
+
# # Create a client object. The client can be reused for multiple calls.
|
311
|
+
# client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
312
|
+
#
|
313
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
314
|
+
# request = Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new
|
315
|
+
#
|
316
|
+
# # Call the get_catalog_item method.
|
317
|
+
# result = client.get_catalog_item request
|
318
|
+
#
|
319
|
+
# # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.
|
320
|
+
# p result
|
321
|
+
#
|
312
322
|
def get_catalog_item request, options = nil
|
313
323
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
314
324
|
|
@@ -326,16 +336,20 @@ module Google
|
|
326
336
|
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
327
337
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
328
338
|
|
329
|
-
header_params = {
|
330
|
-
|
331
|
-
|
339
|
+
header_params = {}
|
340
|
+
if request.name
|
341
|
+
header_params["name"] = request.name
|
342
|
+
end
|
343
|
+
|
332
344
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
333
345
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
334
346
|
|
335
347
|
options.apply_defaults timeout: @config.rpcs.get_catalog_item.timeout,
|
336
348
|
metadata: metadata,
|
337
349
|
retry_policy: @config.rpcs.get_catalog_item.retry_policy
|
338
|
-
|
350
|
+
|
351
|
+
options.apply_defaults timeout: @config.timeout,
|
352
|
+
metadata: @config.metadata,
|
339
353
|
retry_policy: @config.retry_policy
|
340
354
|
|
341
355
|
@catalog_service_stub.call_rpc :get_catalog_item, request, options: options do |response, operation|
|
@@ -383,6 +397,27 @@ module Google
|
|
383
397
|
#
|
384
398
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
385
399
|
#
|
400
|
+
# @example Basic example
|
401
|
+
# require "google/cloud/recommendation_engine/v1beta1"
|
402
|
+
#
|
403
|
+
# # Create a client object. The client can be reused for multiple calls.
|
404
|
+
# client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
405
|
+
#
|
406
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
407
|
+
# request = Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.new
|
408
|
+
#
|
409
|
+
# # Call the list_catalog_items method.
|
410
|
+
# result = client.list_catalog_items request
|
411
|
+
#
|
412
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
413
|
+
# # iterate over all elements by calling #each, and the enumerable
|
414
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
415
|
+
# # methods are also available for managing paging directly.
|
416
|
+
# result.each do |response|
|
417
|
+
# # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.
|
418
|
+
# p response
|
419
|
+
# end
|
420
|
+
#
|
386
421
|
def list_catalog_items request, options = nil
|
387
422
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
388
423
|
|
@@ -400,16 +435,20 @@ module Google
|
|
400
435
|
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
401
436
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
402
437
|
|
403
|
-
header_params = {
|
404
|
-
|
405
|
-
|
438
|
+
header_params = {}
|
439
|
+
if request.parent
|
440
|
+
header_params["parent"] = request.parent
|
441
|
+
end
|
442
|
+
|
406
443
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
407
444
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
408
445
|
|
409
446
|
options.apply_defaults timeout: @config.rpcs.list_catalog_items.timeout,
|
410
447
|
metadata: metadata,
|
411
448
|
retry_policy: @config.rpcs.list_catalog_items.retry_policy
|
412
|
-
|
449
|
+
|
450
|
+
options.apply_defaults timeout: @config.timeout,
|
451
|
+
metadata: @config.metadata,
|
413
452
|
retry_policy: @config.retry_policy
|
414
453
|
|
415
454
|
@catalog_service_stub.call_rpc :list_catalog_items, request, options: options do |response, operation|
|
@@ -458,6 +497,21 @@ module Google
|
|
458
497
|
#
|
459
498
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
460
499
|
#
|
500
|
+
# @example Basic example
|
501
|
+
# require "google/cloud/recommendation_engine/v1beta1"
|
502
|
+
#
|
503
|
+
# # Create a client object. The client can be reused for multiple calls.
|
504
|
+
# client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
505
|
+
#
|
506
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
507
|
+
# request = Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new
|
508
|
+
#
|
509
|
+
# # Call the update_catalog_item method.
|
510
|
+
# result = client.update_catalog_item request
|
511
|
+
#
|
512
|
+
# # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.
|
513
|
+
# p result
|
514
|
+
#
|
461
515
|
def update_catalog_item request, options = nil
|
462
516
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
463
517
|
|
@@ -475,16 +529,20 @@ module Google
|
|
475
529
|
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
476
530
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
477
531
|
|
478
|
-
header_params = {
|
479
|
-
|
480
|
-
|
532
|
+
header_params = {}
|
533
|
+
if request.name
|
534
|
+
header_params["name"] = request.name
|
535
|
+
end
|
536
|
+
|
481
537
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
482
538
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
483
539
|
|
484
540
|
options.apply_defaults timeout: @config.rpcs.update_catalog_item.timeout,
|
485
541
|
metadata: metadata,
|
486
542
|
retry_policy: @config.rpcs.update_catalog_item.retry_policy
|
487
|
-
|
543
|
+
|
544
|
+
options.apply_defaults timeout: @config.timeout,
|
545
|
+
metadata: @config.metadata,
|
488
546
|
retry_policy: @config.retry_policy
|
489
547
|
|
490
548
|
@catalog_service_stub.call_rpc :update_catalog_item, request, options: options do |response, operation|
|
@@ -525,6 +583,21 @@ module Google
|
|
525
583
|
#
|
526
584
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
527
585
|
#
|
586
|
+
# @example Basic example
|
587
|
+
# require "google/cloud/recommendation_engine/v1beta1"
|
588
|
+
#
|
589
|
+
# # Create a client object. The client can be reused for multiple calls.
|
590
|
+
# client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
591
|
+
#
|
592
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
593
|
+
# request = Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new
|
594
|
+
#
|
595
|
+
# # Call the delete_catalog_item method.
|
596
|
+
# result = client.delete_catalog_item request
|
597
|
+
#
|
598
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
599
|
+
# p result
|
600
|
+
#
|
528
601
|
def delete_catalog_item request, options = nil
|
529
602
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
530
603
|
|
@@ -542,16 +615,20 @@ module Google
|
|
542
615
|
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
543
616
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
544
617
|
|
545
|
-
header_params = {
|
546
|
-
|
547
|
-
|
618
|
+
header_params = {}
|
619
|
+
if request.name
|
620
|
+
header_params["name"] = request.name
|
621
|
+
end
|
622
|
+
|
548
623
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
549
624
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
550
625
|
|
551
626
|
options.apply_defaults timeout: @config.rpcs.delete_catalog_item.timeout,
|
552
627
|
metadata: metadata,
|
553
628
|
retry_policy: @config.rpcs.delete_catalog_item.retry_policy
|
554
|
-
|
629
|
+
|
630
|
+
options.apply_defaults timeout: @config.timeout,
|
631
|
+
metadata: @config.metadata,
|
555
632
|
retry_policy: @config.retry_policy
|
556
633
|
|
557
634
|
@catalog_service_stub.call_rpc :delete_catalog_item, request, options: options do |response, operation|
|
@@ -605,6 +682,28 @@ module Google
|
|
605
682
|
#
|
606
683
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
607
684
|
#
|
685
|
+
# @example Basic example
|
686
|
+
# require "google/cloud/recommendation_engine/v1beta1"
|
687
|
+
#
|
688
|
+
# # Create a client object. The client can be reused for multiple calls.
|
689
|
+
# client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
690
|
+
#
|
691
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
692
|
+
# request = Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new
|
693
|
+
#
|
694
|
+
# # Call the import_catalog_items method.
|
695
|
+
# result = client.import_catalog_items request
|
696
|
+
#
|
697
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
698
|
+
# # object to check the status of an operation, cancel it, or wait
|
699
|
+
# # for results. Here is how to block until completion:
|
700
|
+
# result.wait_until_done! timeout: 60
|
701
|
+
# if result.response?
|
702
|
+
# p result.response
|
703
|
+
# else
|
704
|
+
# puts "Error!"
|
705
|
+
# end
|
706
|
+
#
|
608
707
|
def import_catalog_items request, options = nil
|
609
708
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
610
709
|
|
@@ -622,16 +721,20 @@ module Google
|
|
622
721
|
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
623
722
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
624
723
|
|
625
|
-
header_params = {
|
626
|
-
|
627
|
-
|
724
|
+
header_params = {}
|
725
|
+
if request.parent
|
726
|
+
header_params["parent"] = request.parent
|
727
|
+
end
|
728
|
+
|
628
729
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
629
730
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
630
731
|
|
631
732
|
options.apply_defaults timeout: @config.rpcs.import_catalog_items.timeout,
|
632
733
|
metadata: metadata,
|
633
734
|
retry_policy: @config.rpcs.import_catalog_items.retry_policy
|
634
|
-
|
735
|
+
|
736
|
+
options.apply_defaults timeout: @config.timeout,
|
737
|
+
metadata: @config.metadata,
|
635
738
|
retry_policy: @config.retry_policy
|
636
739
|
|
637
740
|
@catalog_service_stub.call_rpc :import_catalog_items, request, options: options do |response, operation|
|
@@ -656,22 +759,21 @@ module Google
|
|
656
759
|
# Configuration can be applied globally to all clients, or to a single client
|
657
760
|
# on construction.
|
658
761
|
#
|
659
|
-
#
|
660
|
-
#
|
661
|
-
#
|
662
|
-
# to 20 seconds,
|
663
|
-
#
|
664
|
-
#
|
665
|
-
#
|
666
|
-
#
|
667
|
-
#
|
668
|
-
#
|
669
|
-
#
|
670
|
-
#
|
671
|
-
#
|
672
|
-
#
|
673
|
-
#
|
674
|
-
# end
|
762
|
+
# @example
|
763
|
+
#
|
764
|
+
# # Modify the global config, setting the timeout for
|
765
|
+
# # create_catalog_item to 20 seconds,
|
766
|
+
# # and all remaining timeouts to 10 seconds.
|
767
|
+
# ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.configure do |config|
|
768
|
+
# config.timeout = 10.0
|
769
|
+
# config.rpcs.create_catalog_item.timeout = 20.0
|
770
|
+
# end
|
771
|
+
#
|
772
|
+
# # Apply the above configuration only to a new client.
|
773
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config|
|
774
|
+
# config.timeout = 10.0
|
775
|
+
# config.rpcs.create_catalog_item.timeout = 20.0
|
776
|
+
# end
|
675
777
|
#
|
676
778
|
# @!attribute [rw] endpoint
|
677
779
|
# The hostname or hostname:port of the service endpoint.
|