google-cloud-recommendation_engine-v1beta1 0.3.1 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) 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 +54 -67
  5. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +34 -25
  6. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +42 -52
  7. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +34 -42
  8. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +50 -62
  9. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +34 -25
  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/catalog_service_services_pb.rb +1 -1
  14. data/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb +1 -1
  15. data/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb +2 -2
  16. data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb +2 -2
  17. data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb +1 -1
  18. data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb +2 -2
  19. data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb +1 -1
  20. data/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb +1 -1
  21. data/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb +2 -2
  22. data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb +2 -2
  23. data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb +1 -1
  24. data/proto_docs/google/api/field_behavior.rb +7 -1
  25. data/proto_docs/google/api/httpbody.rb +9 -4
  26. data/proto_docs/google/type/date.rb +14 -11
  27. metadata +13 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e914f8048c55dced74138f02c00292772b57dd897051efede9c22cc0d2384cc
4
- data.tar.gz: c3748e8cfefef9d9c2251182d7d3a06259c391764e5520ff4a67702bbafd1814
3
+ metadata.gz: bb30bc07b0cc3de0d504ecc16d49fdd0146f9d244afc230fe583a8d813160135
4
+ data.tar.gz: b683c46f645c6a376de3585f8e5760bbcb2865c28976923bf393257918e77307
5
5
  SHA512:
6
- metadata.gz: 7d071a1059390f24530c2484671cdf15d09789b2bb10458ec219a2f219712a31375ba73aa03a30b36d4c8b9dd960600e4d34063d43aac69367e654814d6cfe2d
7
- data.tar.gz: a071d0c553d13d44ca1bb9d9daac9a13cdd1b46f1e64dd452f3d21867f5dc7965ac06ec51f71d4fa84aadf0a59b7d163c4418847b392380b73d9a61a848735dc
6
+ metadata.gz: 4e35da936a621d0acbaf78124bee2d7bca960212f9da3c3d49cf20ae40dc582a8047a70d3fe0281d6ff38e9c3e514a185177ce2bec0b19619a9259012086bff7
7
+ data.tar.gz: afa103a455c46fcc7778bda3d08c8db4108284e423339e4c04b3fb212aa75a1922144037adde8f53458da68ccad59988a57c94c5f7be0f308e891da8c504511e
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
- 1. `RECOMMENDATION_ENGINE_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `RECOMMENDATION_ENGINE_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
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 placing them in
86
- environment variables. Either on an individual client initialization:
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 configured globally for all clients:
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 = my_create_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
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all CatalogService clients:
47
- #
48
- # ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.configure do |config|
49
- # config.timeout = 10.0
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
- # ## Examples
146
- #
147
- # To create a new CatalogService client with the default
148
- # configuration:
126
+ # @example
149
127
  #
150
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
128
+ # # Create a client using the default configuration
129
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
151
130
  #
152
- # To create a new CatalogService client with a custom
153
- # configuration:
154
- #
155
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config|
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 scope and endpoint are unchanged from default,
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.scope == Client.configure.scope &&
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
@@ -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
- options.apply_defaults metadata: @config.metadata,
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|
@@ -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
- options.apply_defaults metadata: @config.metadata,
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|
@@ -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
- options.apply_defaults metadata: @config.metadata,
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
- options.apply_defaults metadata: @config.metadata,
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|
@@ -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
- options.apply_defaults metadata: @config.metadata,
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|
@@ -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
- options.apply_defaults metadata: @config.metadata,
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
- # # Examples
660
- #
661
- # To modify the global config, setting the timeout for create_catalog_item
662
- # to 20 seconds, and all remaining timeouts to 10 seconds:
663
- #
664
- # ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.configure do |config|
665
- # config.timeout = 10.0
666
- # config.rpcs.create_catalog_item.timeout = 20.0
667
- # end
668
- #
669
- # To apply the above configuration only to a new client:
670
- #
671
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config|
672
- # config.timeout = 10.0
673
- # config.rpcs.create_catalog_item.timeout = 20.0
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
- options.apply_defaults metadata: @config.metadata,
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
- options.apply_defaults metadata: @config.metadata,
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
- options.apply_defaults metadata: @config.metadata,
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
- options.apply_defaults metadata: @config.metadata,
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 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
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
- options.apply_defaults metadata: @config.metadata,
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
- # # Examples
485
- #
486
- # To modify the global config, setting the timeout for list_operations
487
- # to 20 seconds, and all remaining timeouts to 10 seconds:
488
- #
489
- # ::Google::Longrunning::Operations::Client.configure do |config|
490
- # config.timeout = 10.0
491
- # config.rpcs.list_operations.timeout = 20.0
492
- # end
493
- #
494
- # To apply the above configuration only to a new client:
495
- #
496
- # client = ::Google::Longrunning::Operations::Client.new do |config|
497
- # config.timeout = 10.0
498
- # config.rpcs.list_operations.timeout = 20.0
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
- # ## Example
48
+ # @example
49
49
  #
50
- # To modify the configuration for all PredictionApiKeyRegistry clients:
51
- #
52
- # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.configure do |config|
53
- # config.timeout = 10.0
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
- # ## Examples
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
- # To create a new PredictionApiKeyRegistry client with a custom
133
- # configuration:
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new
134
119
  #
135
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config|
136
- # config.timeout = 10.0
137
- # end
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 scope and endpoint are unchanged from default,
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.scope == Client.configure.scope &&
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
@@ -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
- options.apply_defaults metadata: @config.metadata,
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|
@@ -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
- options.apply_defaults metadata: @config.metadata,
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|
@@ -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
- options.apply_defaults metadata: @config.metadata,
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
- # # Examples
404
- #
405
- # To modify the global config, setting the timeout for create_prediction_api_key_registration
406
- # to 20 seconds, and all remaining timeouts to 10 seconds:
407
- #
408
- # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.configure do |config|
409
- # config.timeout = 10.0
410
- # config.rpcs.create_prediction_api_key_registration.timeout = 20.0
411
- # end
412
- #
413
- # To apply the above configuration only to a new client:
414
- #
415
- # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config|
416
- # config.timeout = 10.0
417
- # config.rpcs.create_prediction_api_key_registration.timeout = 20.0
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.