google-cloud-recommendation_engine-v1beta1 0.1.0 → 0.3.2
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/LICENSE.md +188 -190
- data/README.md +66 -2
- data/lib/google/cloud/recommendation_engine/v1beta1.rb +3 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb +40 -34
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +95 -10
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +26 -20
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +16 -10
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +36 -30
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +95 -10
- data/lib/google/cloud/recommendation_engine/v1beta1/version.rb +1 -1
- data/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb +1 -1
- data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb +1 -1
- data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb +1 -1
- data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +6 -0
- 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/longrunning/operations.rb +17 -3
- data/proto_docs/google/protobuf/any.rb +5 -2
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- metadata +21 -11
@@ -60,7 +60,7 @@ module Google
|
|
60
60
|
parent_config = while namespace.any?
|
61
61
|
parent_name = namespace.join "::"
|
62
62
|
parent_const = const_get parent_name
|
63
|
-
break parent_const.configure if parent_const
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
64
|
namespace.pop
|
65
65
|
end
|
66
66
|
default_config = Client::Configuration.new parent_config
|
@@ -68,49 +68,49 @@ module Google
|
|
68
68
|
default_config.rpcs.create_catalog_item.timeout = 600.0
|
69
69
|
default_config.rpcs.create_catalog_item.retry_policy = {
|
70
70
|
initial_delay: 0.1,
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
max_delay: 60.0,
|
72
|
+
multiplier: 1.3,
|
73
|
+
retry_codes: [14, 4]
|
74
74
|
}
|
75
75
|
|
76
76
|
default_config.rpcs.get_catalog_item.timeout = 600.0
|
77
77
|
default_config.rpcs.get_catalog_item.retry_policy = {
|
78
78
|
initial_delay: 0.1,
|
79
|
-
|
80
|
-
|
81
|
-
|
79
|
+
max_delay: 60.0,
|
80
|
+
multiplier: 1.3,
|
81
|
+
retry_codes: [14, 4]
|
82
82
|
}
|
83
83
|
|
84
84
|
default_config.rpcs.list_catalog_items.timeout = 600.0
|
85
85
|
default_config.rpcs.list_catalog_items.retry_policy = {
|
86
86
|
initial_delay: 0.1,
|
87
|
-
|
88
|
-
|
89
|
-
|
87
|
+
max_delay: 60.0,
|
88
|
+
multiplier: 1.3,
|
89
|
+
retry_codes: [14, 4]
|
90
90
|
}
|
91
91
|
|
92
92
|
default_config.rpcs.update_catalog_item.timeout = 600.0
|
93
93
|
default_config.rpcs.update_catalog_item.retry_policy = {
|
94
94
|
initial_delay: 0.1,
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
max_delay: 60.0,
|
96
|
+
multiplier: 1.3,
|
97
|
+
retry_codes: [14, 4]
|
98
98
|
}
|
99
99
|
|
100
100
|
default_config.rpcs.delete_catalog_item.timeout = 600.0
|
101
101
|
default_config.rpcs.delete_catalog_item.retry_policy = {
|
102
102
|
initial_delay: 0.1,
|
103
|
-
|
104
|
-
|
105
|
-
|
103
|
+
max_delay: 60.0,
|
104
|
+
multiplier: 1.3,
|
105
|
+
retry_codes: [14, 4]
|
106
106
|
}
|
107
107
|
|
108
108
|
default_config.rpcs.import_catalog_items.timeout = 600.0
|
109
109
|
default_config.rpcs.import_catalog_items.retry_policy = {
|
110
110
|
initial_delay: 0.1,
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
max_delay: 60.0,
|
112
|
+
multiplier: 1.3,
|
113
|
+
retry_codes: [14, 4]
|
114
114
|
}
|
115
115
|
|
116
116
|
default_config
|
@@ -174,7 +174,13 @@ module Google
|
|
174
174
|
|
175
175
|
# Create credentials
|
176
176
|
credentials = @config.credentials
|
177
|
-
|
177
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
178
|
+
# but only if the default endpoint does not have a region prefix.
|
179
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
180
|
+
@config.endpoint == Client.configure.endpoint &&
|
181
|
+
!@config.endpoint.split(".").first.include?("-")
|
182
|
+
credentials ||= Credentials.default scope: @config.scope,
|
183
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
178
184
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
179
185
|
credentials = Credentials.new credentials, scope: @config.scope
|
180
186
|
end
|
@@ -224,7 +230,7 @@ module Google
|
|
224
230
|
#
|
225
231
|
# @param parent [::String]
|
226
232
|
# Required. The parent catalog resource name, such as
|
227
|
-
#
|
233
|
+
# `projects/*/locations/global/catalogs/default_catalog`.
|
228
234
|
# @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash]
|
229
235
|
# Required. The catalog item to create.
|
230
236
|
#
|
@@ -293,7 +299,7 @@ module Google
|
|
293
299
|
#
|
294
300
|
# @param name [::String]
|
295
301
|
# Required. Full resource name of catalog item, such as
|
296
|
-
#
|
302
|
+
# `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`.
|
297
303
|
#
|
298
304
|
# @yield [response, operation] Access the result along with the RPC operation
|
299
305
|
# @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem]
|
@@ -360,7 +366,7 @@ module Google
|
|
360
366
|
#
|
361
367
|
# @param parent [::String]
|
362
368
|
# Required. The parent catalog resource name, such as
|
363
|
-
#
|
369
|
+
# `projects/*/locations/global/catalogs/default_catalog`.
|
364
370
|
# @param page_size [::Integer]
|
365
371
|
# Optional. Maximum number of results to return per page. If zero, the
|
366
372
|
# service will choose a reasonable default.
|
@@ -509,7 +515,7 @@ module Google
|
|
509
515
|
#
|
510
516
|
# @param name [::String]
|
511
517
|
# Required. Full resource name of catalog item, such as
|
512
|
-
#
|
518
|
+
# `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`.
|
513
519
|
#
|
514
520
|
# @yield [response, operation] Access the result along with the RPC operation
|
515
521
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -580,7 +586,7 @@ module Google
|
|
580
586
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
581
587
|
#
|
582
588
|
# @param parent [::String]
|
583
|
-
# Required.
|
589
|
+
# Required. `projects/1234/locations/global/catalogs/default_catalog`
|
584
590
|
# @param request_id [::String]
|
585
591
|
# Optional. Unique identifier provided by client, within the ancestor
|
586
592
|
# dataset scope. Ensures idempotency and used for request deduplication.
|
@@ -729,7 +735,7 @@ module Google
|
|
729
735
|
config_attr :scope, nil, ::String, ::Array, nil
|
730
736
|
config_attr :lib_name, nil, ::String, nil
|
731
737
|
config_attr :lib_version, nil, ::String, nil
|
732
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
738
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
733
739
|
config_attr :interceptors, nil, ::Array, nil
|
734
740
|
config_attr :timeout, nil, ::Numeric, nil
|
735
741
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -750,7 +756,7 @@ module Google
|
|
750
756
|
def rpcs
|
751
757
|
@rpcs ||= begin
|
752
758
|
parent_rpcs = nil
|
753
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
759
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
754
760
|
Rpcs.new parent_rpcs
|
755
761
|
end
|
756
762
|
end
|
@@ -762,7 +768,7 @@ module Google
|
|
762
768
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
763
769
|
# the following configuration fields:
|
764
770
|
#
|
765
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
771
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
766
772
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
767
773
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
768
774
|
# include the following keys:
|
@@ -806,17 +812,17 @@ module Google
|
|
806
812
|
|
807
813
|
# @private
|
808
814
|
def initialize parent_rpcs = nil
|
809
|
-
create_catalog_item_config = parent_rpcs
|
815
|
+
create_catalog_item_config = parent_rpcs.create_catalog_item if parent_rpcs.respond_to? :create_catalog_item
|
810
816
|
@create_catalog_item = ::Gapic::Config::Method.new create_catalog_item_config
|
811
|
-
get_catalog_item_config = parent_rpcs
|
817
|
+
get_catalog_item_config = parent_rpcs.get_catalog_item if parent_rpcs.respond_to? :get_catalog_item
|
812
818
|
@get_catalog_item = ::Gapic::Config::Method.new get_catalog_item_config
|
813
|
-
list_catalog_items_config = parent_rpcs
|
819
|
+
list_catalog_items_config = parent_rpcs.list_catalog_items if parent_rpcs.respond_to? :list_catalog_items
|
814
820
|
@list_catalog_items = ::Gapic::Config::Method.new list_catalog_items_config
|
815
|
-
update_catalog_item_config = parent_rpcs
|
821
|
+
update_catalog_item_config = parent_rpcs.update_catalog_item if parent_rpcs.respond_to? :update_catalog_item
|
816
822
|
@update_catalog_item = ::Gapic::Config::Method.new update_catalog_item_config
|
817
|
-
delete_catalog_item_config = parent_rpcs
|
823
|
+
delete_catalog_item_config = parent_rpcs.delete_catalog_item if parent_rpcs.respond_to? :delete_catalog_item
|
818
824
|
@delete_catalog_item = ::Gapic::Config::Method.new delete_catalog_item_config
|
819
|
-
import_catalog_items_config = parent_rpcs
|
825
|
+
import_catalog_items_config = parent_rpcs.import_catalog_items if parent_rpcs.respond_to? :import_catalog_items
|
820
826
|
@import_catalog_items = ::Gapic::Config::Method.new import_catalog_items_config
|
821
827
|
|
822
828
|
yield self if block_given?
|
@@ -103,8 +103,13 @@ module Google
|
|
103
103
|
# Lists operations that match the specified filter in the request. If the
|
104
104
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
105
105
|
#
|
106
|
-
# NOTE: the `name` binding
|
107
|
-
# to use different resource name schemes, such as `users/*/operations`.
|
106
|
+
# NOTE: the `name` binding allows API services to override the binding
|
107
|
+
# to use different resource name schemes, such as `users/*/operations`. To
|
108
|
+
# override the binding, API services can add a binding such as
|
109
|
+
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
110
|
+
# For backwards compatibility, the default name includes the operations
|
111
|
+
# collection id, however overriding users must ensure the name binding
|
112
|
+
# is the parent resource, without the operations collection id.
|
108
113
|
#
|
109
114
|
# @overload list_operations(request, options = nil)
|
110
115
|
# Pass arguments to `list_operations` via a request object, either of type
|
@@ -122,7 +127,7 @@ module Google
|
|
122
127
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
123
128
|
#
|
124
129
|
# @param name [::String]
|
125
|
-
# The name of the operation
|
130
|
+
# The name of the operation's parent resource.
|
126
131
|
# @param filter [::String]
|
127
132
|
# The standard list filter.
|
128
133
|
# @param page_size [::Integer]
|
@@ -390,6 +395,79 @@ module Google
|
|
390
395
|
raise ::Google::Cloud::Error.from_error(e)
|
391
396
|
end
|
392
397
|
|
398
|
+
##
|
399
|
+
# Waits for the specified long-running operation until it is done or reaches
|
400
|
+
# at most a specified timeout, returning the latest state. If the operation
|
401
|
+
# is already done, the latest state is immediately returned. If the timeout
|
402
|
+
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
|
+
# timeout is used. If the server does not support this method, it returns
|
404
|
+
# `google.rpc.Code.UNIMPLEMENTED`.
|
405
|
+
# Note that this method is on a best-effort basis. It may return the latest
|
406
|
+
# state before the specified timeout (including immediately), meaning even an
|
407
|
+
# immediate response is no guarantee that the operation is done.
|
408
|
+
#
|
409
|
+
# @overload wait_operation(request, options = nil)
|
410
|
+
# Pass arguments to `wait_operation` via a request object, either of type
|
411
|
+
# {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
|
412
|
+
#
|
413
|
+
# @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
|
414
|
+
# A request object representing the call parameters. Required. To specify no
|
415
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
416
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
417
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
418
|
+
#
|
419
|
+
# @overload wait_operation(name: nil, timeout: nil)
|
420
|
+
# Pass arguments to `wait_operation` via keyword arguments. Note that at
|
421
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
422
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
423
|
+
#
|
424
|
+
# @param name [::String]
|
425
|
+
# The name of the operation resource to wait on.
|
426
|
+
# @param timeout [::Google::Protobuf::Duration, ::Hash]
|
427
|
+
# The maximum duration to wait before timing out. If left blank, the wait
|
428
|
+
# will be at most the time permitted by the underlying HTTP/RPC protocol.
|
429
|
+
# If RPC context deadline is also specified, the shorter one will be used.
|
430
|
+
#
|
431
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
432
|
+
# @yieldparam response [::Gapic::Operation]
|
433
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
434
|
+
#
|
435
|
+
# @return [::Gapic::Operation]
|
436
|
+
#
|
437
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
438
|
+
#
|
439
|
+
def wait_operation request, options = nil
|
440
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
441
|
+
|
442
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
|
443
|
+
|
444
|
+
# Converts hash and nil to an options object
|
445
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
446
|
+
|
447
|
+
# Customize the options with defaults
|
448
|
+
metadata = @config.rpcs.wait_operation.metadata.to_h
|
449
|
+
|
450
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
451
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
452
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
453
|
+
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
454
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
455
|
+
|
456
|
+
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
|
+
metadata: metadata,
|
458
|
+
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
+
options.apply_defaults metadata: @config.metadata,
|
460
|
+
retry_policy: @config.retry_policy
|
461
|
+
|
462
|
+
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
463
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
464
|
+
yield response, operation if block_given?
|
465
|
+
return response
|
466
|
+
end
|
467
|
+
rescue ::GRPC::BadStatus => e
|
468
|
+
raise ::Google::Cloud::Error.from_error(e)
|
469
|
+
end
|
470
|
+
|
393
471
|
##
|
394
472
|
# Configuration class for the Operations API.
|
395
473
|
#
|
@@ -482,7 +560,7 @@ module Google
|
|
482
560
|
config_attr :scope, nil, ::String, ::Array, nil
|
483
561
|
config_attr :lib_name, nil, ::String, nil
|
484
562
|
config_attr :lib_version, nil, ::String, nil
|
485
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
563
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
486
564
|
config_attr :interceptors, nil, ::Array, nil
|
487
565
|
config_attr :timeout, nil, ::Numeric, nil
|
488
566
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -503,7 +581,7 @@ module Google
|
|
503
581
|
def rpcs
|
504
582
|
@rpcs ||= begin
|
505
583
|
parent_rpcs = nil
|
506
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
584
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
507
585
|
Rpcs.new parent_rpcs
|
508
586
|
end
|
509
587
|
end
|
@@ -515,7 +593,7 @@ module Google
|
|
515
593
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
516
594
|
# the following configuration fields:
|
517
595
|
#
|
518
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
596
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
519
597
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
520
598
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
521
599
|
# include the following keys:
|
@@ -546,17 +624,24 @@ module Google
|
|
546
624
|
# @return [::Gapic::Config::Method]
|
547
625
|
#
|
548
626
|
attr_reader :cancel_operation
|
627
|
+
##
|
628
|
+
# RPC-specific configuration for `wait_operation`
|
629
|
+
# @return [::Gapic::Config::Method]
|
630
|
+
#
|
631
|
+
attr_reader :wait_operation
|
549
632
|
|
550
633
|
# @private
|
551
634
|
def initialize parent_rpcs = nil
|
552
|
-
list_operations_config = parent_rpcs
|
635
|
+
list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
|
553
636
|
@list_operations = ::Gapic::Config::Method.new list_operations_config
|
554
|
-
get_operation_config = parent_rpcs
|
637
|
+
get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
|
555
638
|
@get_operation = ::Gapic::Config::Method.new get_operation_config
|
556
|
-
delete_operation_config = parent_rpcs
|
639
|
+
delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
|
557
640
|
@delete_operation = ::Gapic::Config::Method.new delete_operation_config
|
558
|
-
cancel_operation_config = parent_rpcs
|
641
|
+
cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
|
559
642
|
@cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
|
643
|
+
wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
|
644
|
+
@wait_operation = ::Gapic::Config::Method.new wait_operation_config
|
560
645
|
|
561
646
|
yield self if block_given?
|
562
647
|
end
|
@@ -64,7 +64,7 @@ module Google
|
|
64
64
|
parent_config = while namespace.any?
|
65
65
|
parent_name = namespace.join "::"
|
66
66
|
parent_const = const_get parent_name
|
67
|
-
break parent_const.configure if parent_const
|
67
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
68
68
|
namespace.pop
|
69
69
|
end
|
70
70
|
default_config = Client::Configuration.new parent_config
|
@@ -72,25 +72,25 @@ module Google
|
|
72
72
|
default_config.rpcs.create_prediction_api_key_registration.timeout = 600.0
|
73
73
|
default_config.rpcs.create_prediction_api_key_registration.retry_policy = {
|
74
74
|
initial_delay: 0.1,
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
max_delay: 60.0,
|
76
|
+
multiplier: 1.3,
|
77
|
+
retry_codes: [14, 4]
|
78
78
|
}
|
79
79
|
|
80
80
|
default_config.rpcs.list_prediction_api_key_registrations.timeout = 600.0
|
81
81
|
default_config.rpcs.list_prediction_api_key_registrations.retry_policy = {
|
82
82
|
initial_delay: 0.1,
|
83
|
-
|
84
|
-
|
85
|
-
|
83
|
+
max_delay: 60.0,
|
84
|
+
multiplier: 1.3,
|
85
|
+
retry_codes: [14, 4]
|
86
86
|
}
|
87
87
|
|
88
88
|
default_config.rpcs.delete_prediction_api_key_registration.timeout = 600.0
|
89
89
|
default_config.rpcs.delete_prediction_api_key_registration.retry_policy = {
|
90
90
|
initial_delay: 0.1,
|
91
|
-
|
92
|
-
|
93
|
-
|
91
|
+
max_delay: 60.0,
|
92
|
+
multiplier: 1.3,
|
93
|
+
retry_codes: [14, 4]
|
94
94
|
}
|
95
95
|
|
96
96
|
default_config
|
@@ -154,7 +154,13 @@ module Google
|
|
154
154
|
|
155
155
|
# Create credentials
|
156
156
|
credentials = @config.credentials
|
157
|
-
|
157
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
158
|
+
# but only if the default endpoint does not have a region prefix.
|
159
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
160
|
+
@config.endpoint == Client.configure.endpoint &&
|
161
|
+
!@config.endpoint.split(".").first.include?("-")
|
162
|
+
credentials ||= Credentials.default scope: @config.scope,
|
163
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
158
164
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
159
165
|
credentials = Credentials.new credentials, scope: @config.scope
|
160
166
|
end
|
@@ -192,7 +198,7 @@ module Google
|
|
192
198
|
#
|
193
199
|
# @param parent [::String]
|
194
200
|
# Required. The parent resource path.
|
195
|
-
#
|
201
|
+
# `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`.
|
196
202
|
# @param prediction_api_key_registration [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration, ::Hash]
|
197
203
|
# Required. The prediction API key registration.
|
198
204
|
#
|
@@ -261,7 +267,7 @@ module Google
|
|
261
267
|
#
|
262
268
|
# @param parent [::String]
|
263
269
|
# Required. The parent placement resource name such as
|
264
|
-
#
|
270
|
+
# `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`
|
265
271
|
# @param page_size [::Integer]
|
266
272
|
# Optional. Maximum number of results to return per page. If unset, the
|
267
273
|
# service will choose a reasonable default.
|
@@ -334,7 +340,7 @@ module Google
|
|
334
340
|
#
|
335
341
|
# @param name [::String]
|
336
342
|
# Required. The API key to unregister including full resource path.
|
337
|
-
#
|
343
|
+
# `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>`
|
338
344
|
#
|
339
345
|
# @yield [response, operation] Access the result along with the RPC operation
|
340
346
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -473,7 +479,7 @@ module Google
|
|
473
479
|
config_attr :scope, nil, ::String, ::Array, nil
|
474
480
|
config_attr :lib_name, nil, ::String, nil
|
475
481
|
config_attr :lib_version, nil, ::String, nil
|
476
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
482
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
477
483
|
config_attr :interceptors, nil, ::Array, nil
|
478
484
|
config_attr :timeout, nil, ::Numeric, nil
|
479
485
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -494,7 +500,7 @@ module Google
|
|
494
500
|
def rpcs
|
495
501
|
@rpcs ||= begin
|
496
502
|
parent_rpcs = nil
|
497
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
503
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
498
504
|
Rpcs.new parent_rpcs
|
499
505
|
end
|
500
506
|
end
|
@@ -506,7 +512,7 @@ module Google
|
|
506
512
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
507
513
|
# the following configuration fields:
|
508
514
|
#
|
509
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
515
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
510
516
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
511
517
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
512
518
|
# include the following keys:
|
@@ -535,11 +541,11 @@ module Google
|
|
535
541
|
|
536
542
|
# @private
|
537
543
|
def initialize parent_rpcs = nil
|
538
|
-
create_prediction_api_key_registration_config = parent_rpcs
|
544
|
+
create_prediction_api_key_registration_config = parent_rpcs.create_prediction_api_key_registration if parent_rpcs.respond_to? :create_prediction_api_key_registration
|
539
545
|
@create_prediction_api_key_registration = ::Gapic::Config::Method.new create_prediction_api_key_registration_config
|
540
|
-
list_prediction_api_key_registrations_config = parent_rpcs
|
546
|
+
list_prediction_api_key_registrations_config = parent_rpcs.list_prediction_api_key_registrations if parent_rpcs.respond_to? :list_prediction_api_key_registrations
|
541
547
|
@list_prediction_api_key_registrations = ::Gapic::Config::Method.new list_prediction_api_key_registrations_config
|
542
|
-
delete_prediction_api_key_registration_config = parent_rpcs
|
548
|
+
delete_prediction_api_key_registration_config = parent_rpcs.delete_prediction_api_key_registration if parent_rpcs.respond_to? :delete_prediction_api_key_registration
|
543
549
|
@delete_prediction_api_key_registration = ::Gapic::Config::Method.new delete_prediction_api_key_registration_config
|
544
550
|
|
545
551
|
yield self if block_given?
|