google-cloud-recommendation_engine-v1beta1 0.3.0 → 0.3.4
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.
- 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 +59 -72
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +34 -25
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +45 -55
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +35 -43
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +55 -67
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +34 -25
- data/lib/google/cloud/recommendation_engine/v1beta1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/api/httpbody.rb +4 -3
- data/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb +4 -4
- data/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb +4 -4
- data/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb +3 -3
- data/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb +1 -1
- data/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb +4 -4
- data/proto_docs/google/type/date.rb +14 -11
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba48a9cf081b59929553c52fd4bcdbfe4f6a0a50aa2dc87a600a287df055a548
|
4
|
+
data.tar.gz: 22719c17e5e354048227b81480437f9d215a100ced10462e78fd741d8ee97d83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e42040389428f7122891a98ca5e75251fd9a564542e4cccad20c894e348246252aef0533ba90778b9986e1b0f85b1446be1bdee951492c1c09732801f16b11c
|
7
|
+
data.tar.gz: cefb17db663bd03ca7dda91f58ddb190c5952255b71006d88cabb4cd31e98d5ac1ef8b570e8ded942b961b7b0c2d9adf3a0e9315599c4ffafa8d4bfda9bf52bd
|
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
|
@@ -230,7 +206,7 @@ module Google
|
|
230
206
|
#
|
231
207
|
# @param parent [::String]
|
232
208
|
# Required. The parent catalog resource name, such as
|
233
|
-
#
|
209
|
+
# `projects/*/locations/global/catalogs/default_catalog`.
|
234
210
|
# @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash]
|
235
211
|
# Required. The catalog item to create.
|
236
212
|
#
|
@@ -268,7 +244,9 @@ module Google
|
|
268
244
|
options.apply_defaults timeout: @config.rpcs.create_catalog_item.timeout,
|
269
245
|
metadata: metadata,
|
270
246
|
retry_policy: @config.rpcs.create_catalog_item.retry_policy
|
271
|
-
|
247
|
+
|
248
|
+
options.apply_defaults timeout: @config.timeout,
|
249
|
+
metadata: @config.metadata,
|
272
250
|
retry_policy: @config.retry_policy
|
273
251
|
|
274
252
|
@catalog_service_stub.call_rpc :create_catalog_item, request, options: options do |response, operation|
|
@@ -299,7 +277,7 @@ module Google
|
|
299
277
|
#
|
300
278
|
# @param name [::String]
|
301
279
|
# Required. Full resource name of catalog item, such as
|
302
|
-
#
|
280
|
+
# `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`.
|
303
281
|
#
|
304
282
|
# @yield [response, operation] Access the result along with the RPC operation
|
305
283
|
# @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem]
|
@@ -335,7 +313,9 @@ module Google
|
|
335
313
|
options.apply_defaults timeout: @config.rpcs.get_catalog_item.timeout,
|
336
314
|
metadata: metadata,
|
337
315
|
retry_policy: @config.rpcs.get_catalog_item.retry_policy
|
338
|
-
|
316
|
+
|
317
|
+
options.apply_defaults timeout: @config.timeout,
|
318
|
+
metadata: @config.metadata,
|
339
319
|
retry_policy: @config.retry_policy
|
340
320
|
|
341
321
|
@catalog_service_stub.call_rpc :get_catalog_item, request, options: options do |response, operation|
|
@@ -366,7 +346,7 @@ module Google
|
|
366
346
|
#
|
367
347
|
# @param parent [::String]
|
368
348
|
# Required. The parent catalog resource name, such as
|
369
|
-
#
|
349
|
+
# `projects/*/locations/global/catalogs/default_catalog`.
|
370
350
|
# @param page_size [::Integer]
|
371
351
|
# Optional. Maximum number of results to return per page. If zero, the
|
372
352
|
# service will choose a reasonable default.
|
@@ -409,7 +389,9 @@ module Google
|
|
409
389
|
options.apply_defaults timeout: @config.rpcs.list_catalog_items.timeout,
|
410
390
|
metadata: metadata,
|
411
391
|
retry_policy: @config.rpcs.list_catalog_items.retry_policy
|
412
|
-
|
392
|
+
|
393
|
+
options.apply_defaults timeout: @config.timeout,
|
394
|
+
metadata: @config.metadata,
|
413
395
|
retry_policy: @config.retry_policy
|
414
396
|
|
415
397
|
@catalog_service_stub.call_rpc :list_catalog_items, request, options: options do |response, operation|
|
@@ -484,7 +466,9 @@ module Google
|
|
484
466
|
options.apply_defaults timeout: @config.rpcs.update_catalog_item.timeout,
|
485
467
|
metadata: metadata,
|
486
468
|
retry_policy: @config.rpcs.update_catalog_item.retry_policy
|
487
|
-
|
469
|
+
|
470
|
+
options.apply_defaults timeout: @config.timeout,
|
471
|
+
metadata: @config.metadata,
|
488
472
|
retry_policy: @config.retry_policy
|
489
473
|
|
490
474
|
@catalog_service_stub.call_rpc :update_catalog_item, request, options: options do |response, operation|
|
@@ -515,7 +499,7 @@ module Google
|
|
515
499
|
#
|
516
500
|
# @param name [::String]
|
517
501
|
# Required. Full resource name of catalog item, such as
|
518
|
-
#
|
502
|
+
# `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`.
|
519
503
|
#
|
520
504
|
# @yield [response, operation] Access the result along with the RPC operation
|
521
505
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -551,7 +535,9 @@ module Google
|
|
551
535
|
options.apply_defaults timeout: @config.rpcs.delete_catalog_item.timeout,
|
552
536
|
metadata: metadata,
|
553
537
|
retry_policy: @config.rpcs.delete_catalog_item.retry_policy
|
554
|
-
|
538
|
+
|
539
|
+
options.apply_defaults timeout: @config.timeout,
|
540
|
+
metadata: @config.metadata,
|
555
541
|
retry_policy: @config.retry_policy
|
556
542
|
|
557
543
|
@catalog_service_stub.call_rpc :delete_catalog_item, request, options: options do |response, operation|
|
@@ -586,7 +572,7 @@ module Google
|
|
586
572
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
587
573
|
#
|
588
574
|
# @param parent [::String]
|
589
|
-
# Required.
|
575
|
+
# Required. `projects/1234/locations/global/catalogs/default_catalog`
|
590
576
|
# @param request_id [::String]
|
591
577
|
# Optional. Unique identifier provided by client, within the ancestor
|
592
578
|
# dataset scope. Ensures idempotency and used for request deduplication.
|
@@ -631,7 +617,9 @@ module Google
|
|
631
617
|
options.apply_defaults timeout: @config.rpcs.import_catalog_items.timeout,
|
632
618
|
metadata: metadata,
|
633
619
|
retry_policy: @config.rpcs.import_catalog_items.retry_policy
|
634
|
-
|
620
|
+
|
621
|
+
options.apply_defaults timeout: @config.timeout,
|
622
|
+
metadata: @config.metadata,
|
635
623
|
retry_policy: @config.retry_policy
|
636
624
|
|
637
625
|
@catalog_service_stub.call_rpc :import_catalog_items, request, options: options do |response, operation|
|
@@ -656,22 +644,21 @@ module Google
|
|
656
644
|
# Configuration can be applied globally to all clients, or to a single client
|
657
645
|
# on construction.
|
658
646
|
#
|
659
|
-
#
|
660
|
-
#
|
661
|
-
#
|
662
|
-
# to 20 seconds,
|
663
|
-
#
|
664
|
-
#
|
665
|
-
#
|
666
|
-
#
|
667
|
-
#
|
668
|
-
#
|
669
|
-
#
|
670
|
-
#
|
671
|
-
#
|
672
|
-
#
|
673
|
-
#
|
674
|
-
# end
|
647
|
+
# @example
|
648
|
+
#
|
649
|
+
# # Modify the global config, setting the timeout for
|
650
|
+
# # create_catalog_item to 20 seconds,
|
651
|
+
# # and all remaining timeouts to 10 seconds.
|
652
|
+
# ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.configure do |config|
|
653
|
+
# config.timeout = 10.0
|
654
|
+
# config.rpcs.create_catalog_item.timeout = 20.0
|
655
|
+
# end
|
656
|
+
#
|
657
|
+
# # Apply the above configuration only to a new client.
|
658
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config|
|
659
|
+
# config.timeout = 10.0
|
660
|
+
# config.rpcs.create_catalog_item.timeout = 20.0
|
661
|
+
# end
|
675
662
|
#
|
676
663
|
# @!attribute [rw] endpoint
|
677
664
|
# The hostname or hostname:port of the service endpoint.
|
@@ -82,7 +82,7 @@ module Google
|
|
82
82
|
# Create credentials
|
83
83
|
credentials = @config.credentials
|
84
84
|
credentials ||= Credentials.default scope: @config.scope
|
85
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
85
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
86
86
|
credentials = Credentials.new credentials, scope: @config.scope
|
87
87
|
end
|
88
88
|
@quota_project_id = @config.quota_project
|
@@ -169,7 +169,9 @@ module Google
|
|
169
169
|
options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
|
170
170
|
metadata: metadata,
|
171
171
|
retry_policy: @config.rpcs.list_operations.retry_policy
|
172
|
-
|
172
|
+
|
173
|
+
options.apply_defaults timeout: @config.timeout,
|
174
|
+
metadata: @config.metadata,
|
173
175
|
retry_policy: @config.retry_policy
|
174
176
|
|
175
177
|
@operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
|
@@ -239,7 +241,9 @@ module Google
|
|
239
241
|
options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
|
240
242
|
metadata: metadata,
|
241
243
|
retry_policy: @config.rpcs.get_operation.retry_policy
|
242
|
-
|
244
|
+
|
245
|
+
options.apply_defaults timeout: @config.timeout,
|
246
|
+
metadata: @config.metadata,
|
243
247
|
retry_policy: @config.retry_policy
|
244
248
|
|
245
249
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
@@ -309,7 +313,9 @@ module Google
|
|
309
313
|
options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
|
310
314
|
metadata: metadata,
|
311
315
|
retry_policy: @config.rpcs.delete_operation.retry_policy
|
312
|
-
|
316
|
+
|
317
|
+
options.apply_defaults timeout: @config.timeout,
|
318
|
+
metadata: @config.metadata,
|
313
319
|
retry_policy: @config.retry_policy
|
314
320
|
|
315
321
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
@@ -384,7 +390,9 @@ module Google
|
|
384
390
|
options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
|
385
391
|
metadata: metadata,
|
386
392
|
retry_policy: @config.rpcs.cancel_operation.retry_policy
|
387
|
-
|
393
|
+
|
394
|
+
options.apply_defaults timeout: @config.timeout,
|
395
|
+
metadata: @config.metadata,
|
388
396
|
retry_policy: @config.retry_policy
|
389
397
|
|
390
398
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
@@ -396,9 +404,9 @@ module Google
|
|
396
404
|
end
|
397
405
|
|
398
406
|
##
|
399
|
-
# Waits
|
400
|
-
#
|
401
|
-
#
|
407
|
+
# Waits until the specified long-running operation is done or reaches at most
|
408
|
+
# a specified timeout, returning the latest state. If the operation is
|
409
|
+
# already done, the latest state is immediately returned. If the timeout
|
402
410
|
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
411
|
# timeout is used. If the server does not support this method, it returns
|
404
412
|
# `google.rpc.Code.UNIMPLEMENTED`.
|
@@ -456,7 +464,9 @@ module Google
|
|
456
464
|
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
465
|
metadata: metadata,
|
458
466
|
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
-
|
467
|
+
|
468
|
+
options.apply_defaults timeout: @config.timeout,
|
469
|
+
metadata: @config.metadata,
|
460
470
|
retry_policy: @config.retry_policy
|
461
471
|
|
462
472
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
@@ -481,22 +491,21 @@ module Google
|
|
481
491
|
# Configuration can be applied globally to all clients, or to a single client
|
482
492
|
# on construction.
|
483
493
|
#
|
484
|
-
#
|
485
|
-
#
|
486
|
-
#
|
487
|
-
# to 20 seconds,
|
488
|
-
#
|
489
|
-
#
|
490
|
-
#
|
491
|
-
#
|
492
|
-
#
|
493
|
-
#
|
494
|
-
#
|
495
|
-
#
|
496
|
-
#
|
497
|
-
#
|
498
|
-
#
|
499
|
-
# end
|
494
|
+
# @example
|
495
|
+
#
|
496
|
+
# # Modify the global config, setting the timeout for
|
497
|
+
# # list_operations to 20 seconds,
|
498
|
+
# # and all remaining timeouts to 10 seconds.
|
499
|
+
# ::Google::Longrunning::Operations::Client.configure do |config|
|
500
|
+
# config.timeout = 10.0
|
501
|
+
# config.rpcs.list_operations.timeout = 20.0
|
502
|
+
# end
|
503
|
+
#
|
504
|
+
# # Apply the above configuration only to a new client.
|
505
|
+
# client = ::Google::Longrunning::Operations::Client.new do |config|
|
506
|
+
# config.timeout = 10.0
|
507
|
+
# config.rpcs.list_operations.timeout = 20.0
|
508
|
+
# end
|
500
509
|
#
|
501
510
|
# @!attribute [rw] endpoint
|
502
511
|
# The hostname or hostname:port of the service endpoint.
|
@@ -45,13 +45,12 @@ module Google
|
|
45
45
|
# See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client::Configuration}
|
46
46
|
# for a description of the configuration fields.
|
47
47
|
#
|
48
|
-
#
|
48
|
+
# @example
|
49
49
|
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
# end
|
50
|
+
# # Modify the configuration for all PredictionApiKeyRegistry clients
|
51
|
+
# ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.configure do |config|
|
52
|
+
# config.timeout = 10.0
|
53
|
+
# end
|
55
54
|
#
|
56
55
|
# @yield [config] Configure the Client client.
|
57
56
|
# @yieldparam config [Client::Configuration]
|
@@ -71,26 +70,17 @@ module Google
|
|
71
70
|
|
72
71
|
default_config.rpcs.create_prediction_api_key_registration.timeout = 600.0
|
73
72
|
default_config.rpcs.create_prediction_api_key_registration.retry_policy = {
|
74
|
-
initial_delay: 0.1,
|
75
|
-
max_delay: 60.0,
|
76
|
-
multiplier: 1.3,
|
77
|
-
retry_codes: [14, 4]
|
73
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
78
74
|
}
|
79
75
|
|
80
76
|
default_config.rpcs.list_prediction_api_key_registrations.timeout = 600.0
|
81
77
|
default_config.rpcs.list_prediction_api_key_registrations.retry_policy = {
|
82
|
-
initial_delay: 0.1,
|
83
|
-
max_delay: 60.0,
|
84
|
-
multiplier: 1.3,
|
85
|
-
retry_codes: [14, 4]
|
78
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
86
79
|
}
|
87
80
|
|
88
81
|
default_config.rpcs.delete_prediction_api_key_registration.timeout = 600.0
|
89
82
|
default_config.rpcs.delete_prediction_api_key_registration.retry_policy = {
|
90
|
-
initial_delay: 0.1,
|
91
|
-
max_delay: 60.0,
|
92
|
-
multiplier: 1.3,
|
93
|
-
retry_codes: [14, 4]
|
83
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
94
84
|
}
|
95
85
|
|
96
86
|
default_config
|
@@ -122,19 +112,15 @@ module Google
|
|
122
112
|
##
|
123
113
|
# Create a new PredictionApiKeyRegistry client object.
|
124
114
|
#
|
125
|
-
#
|
126
|
-
#
|
127
|
-
# To create a new PredictionApiKeyRegistry client with the default
|
128
|
-
# configuration:
|
129
|
-
#
|
130
|
-
# client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new
|
115
|
+
# @example
|
131
116
|
#
|
132
|
-
#
|
133
|
-
#
|
117
|
+
# # Create a client using the default configuration
|
118
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new
|
134
119
|
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
#
|
120
|
+
# # Create a client using a custom configuration
|
121
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config|
|
122
|
+
# config.timeout = 10.0
|
123
|
+
# end
|
138
124
|
#
|
139
125
|
# @yield [config] Configure the PredictionApiKeyRegistry client.
|
140
126
|
# @yieldparam config [Client::Configuration]
|
@@ -154,14 +140,13 @@ module Google
|
|
154
140
|
|
155
141
|
# Create credentials
|
156
142
|
credentials = @config.credentials
|
157
|
-
# Use self-signed JWT if the
|
143
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
158
144
|
# but only if the default endpoint does not have a region prefix.
|
159
|
-
enable_self_signed_jwt = @config.
|
160
|
-
@config.endpoint == Client.configure.endpoint &&
|
145
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
161
146
|
!@config.endpoint.split(".").first.include?("-")
|
162
147
|
credentials ||= Credentials.default scope: @config.scope,
|
163
148
|
enable_self_signed_jwt: enable_self_signed_jwt
|
164
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
149
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
165
150
|
credentials = Credentials.new credentials, scope: @config.scope
|
166
151
|
end
|
167
152
|
@quota_project_id = @config.quota_project
|
@@ -198,7 +183,7 @@ module Google
|
|
198
183
|
#
|
199
184
|
# @param parent [::String]
|
200
185
|
# Required. The parent resource path.
|
201
|
-
#
|
186
|
+
# `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`.
|
202
187
|
# @param prediction_api_key_registration [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration, ::Hash]
|
203
188
|
# Required. The prediction API key registration.
|
204
189
|
#
|
@@ -236,7 +221,9 @@ module Google
|
|
236
221
|
options.apply_defaults timeout: @config.rpcs.create_prediction_api_key_registration.timeout,
|
237
222
|
metadata: metadata,
|
238
223
|
retry_policy: @config.rpcs.create_prediction_api_key_registration.retry_policy
|
239
|
-
|
224
|
+
|
225
|
+
options.apply_defaults timeout: @config.timeout,
|
226
|
+
metadata: @config.metadata,
|
240
227
|
retry_policy: @config.retry_policy
|
241
228
|
|
242
229
|
@prediction_api_key_registry_stub.call_rpc :create_prediction_api_key_registration, request, options: options do |response, operation|
|
@@ -267,7 +254,7 @@ module Google
|
|
267
254
|
#
|
268
255
|
# @param parent [::String]
|
269
256
|
# Required. The parent placement resource name such as
|
270
|
-
#
|
257
|
+
# `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`
|
271
258
|
# @param page_size [::Integer]
|
272
259
|
# Optional. Maximum number of results to return per page. If unset, the
|
273
260
|
# service will choose a reasonable default.
|
@@ -308,7 +295,9 @@ module Google
|
|
308
295
|
options.apply_defaults timeout: @config.rpcs.list_prediction_api_key_registrations.timeout,
|
309
296
|
metadata: metadata,
|
310
297
|
retry_policy: @config.rpcs.list_prediction_api_key_registrations.retry_policy
|
311
|
-
|
298
|
+
|
299
|
+
options.apply_defaults timeout: @config.timeout,
|
300
|
+
metadata: @config.metadata,
|
312
301
|
retry_policy: @config.retry_policy
|
313
302
|
|
314
303
|
@prediction_api_key_registry_stub.call_rpc :list_prediction_api_key_registrations, request, options: options do |response, operation|
|
@@ -340,7 +329,7 @@ module Google
|
|
340
329
|
#
|
341
330
|
# @param name [::String]
|
342
331
|
# Required. The API key to unregister including full resource path.
|
343
|
-
#
|
332
|
+
# `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>`
|
344
333
|
#
|
345
334
|
# @yield [response, operation] Access the result along with the RPC operation
|
346
335
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -376,7 +365,9 @@ module Google
|
|
376
365
|
options.apply_defaults timeout: @config.rpcs.delete_prediction_api_key_registration.timeout,
|
377
366
|
metadata: metadata,
|
378
367
|
retry_policy: @config.rpcs.delete_prediction_api_key_registration.retry_policy
|
379
|
-
|
368
|
+
|
369
|
+
options.apply_defaults timeout: @config.timeout,
|
370
|
+
metadata: @config.metadata,
|
380
371
|
retry_policy: @config.retry_policy
|
381
372
|
|
382
373
|
@prediction_api_key_registry_stub.call_rpc :delete_prediction_api_key_registration, request, options: options do |response, operation|
|
@@ -400,22 +391,21 @@ module Google
|
|
400
391
|
# Configuration can be applied globally to all clients, or to a single client
|
401
392
|
# on construction.
|
402
393
|
#
|
403
|
-
#
|
404
|
-
#
|
405
|
-
#
|
406
|
-
# to 20 seconds,
|
407
|
-
#
|
408
|
-
#
|
409
|
-
#
|
410
|
-
#
|
411
|
-
#
|
412
|
-
#
|
413
|
-
#
|
414
|
-
#
|
415
|
-
#
|
416
|
-
#
|
417
|
-
#
|
418
|
-
# end
|
394
|
+
# @example
|
395
|
+
#
|
396
|
+
# # Modify the global config, setting the timeout for
|
397
|
+
# # create_prediction_api_key_registration to 20 seconds,
|
398
|
+
# # and all remaining timeouts to 10 seconds.
|
399
|
+
# ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.configure do |config|
|
400
|
+
# config.timeout = 10.0
|
401
|
+
# config.rpcs.create_prediction_api_key_registration.timeout = 20.0
|
402
|
+
# end
|
403
|
+
#
|
404
|
+
# # Apply the above configuration only to a new client.
|
405
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config|
|
406
|
+
# config.timeout = 10.0
|
407
|
+
# config.rpcs.create_prediction_api_key_registration.timeout = 20.0
|
408
|
+
# end
|
419
409
|
#
|
420
410
|
# @!attribute [rw] endpoint
|
421
411
|
# The hostname or hostname:port of the service endpoint.
|