google-cloud-recommendation_engine-v1beta1 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb +8 -10
  4. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +12 -14
  5. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb +769 -0
  6. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb +807 -0
  7. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb +405 -0
  8. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest.rb +53 -0
  9. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service.rb +7 -1
  10. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +4 -6
  11. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.rb +512 -0
  12. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb +226 -0
  13. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest.rb +56 -0
  14. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.rb +7 -1
  15. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +4 -6
  16. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb +440 -0
  17. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb +108 -0
  18. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest.rb +52 -0
  19. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service.rb +7 -1
  20. data/lib/google/cloud/recommendation_engine/v1beta1/rest.rb +40 -0
  21. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +12 -14
  22. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +12 -14
  23. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb +765 -0
  24. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb +807 -0
  25. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb +346 -0
  26. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest.rb +53 -0
  27. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service.rb +7 -1
  28. data/lib/google/cloud/recommendation_engine/v1beta1/version.rb +1 -1
  29. data/lib/google/cloud/recommendation_engine/v1beta1.rb +7 -2
  30. data/proto_docs/google/rpc/status.rb +4 -2
  31. metadata +25 -8
@@ -0,0 +1,512 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb"
21
+ require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module RecommendationEngine
26
+ module V1beta1
27
+ module PredictionApiKeyRegistry
28
+ module Rest
29
+ ##
30
+ # REST client for the PredictionApiKeyRegistry service.
31
+ #
32
+ # Service for registering API keys for use with the `predict` method. If you
33
+ # use an API key to request predictions, you must first register the API key.
34
+ # Otherwise, your prediction request is rejected. If you use OAuth to
35
+ # authenticate your `predict` method call, you do not need to register an API
36
+ # key. You can register up to 20 API keys per project.
37
+ #
38
+ class Client
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :prediction_api_key_registry_stub
43
+
44
+ ##
45
+ # Configure the PredictionApiKeyRegistry Client class.
46
+ #
47
+ # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all PredictionApiKeyRegistry clients
53
+ # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Cloud", "RecommendationEngine", "V1beta1"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.rpcs.create_prediction_api_key_registration.timeout = 600.0
74
+ default_config.rpcs.create_prediction_api_key_registration.retry_policy = {
75
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
76
+ }
77
+
78
+ default_config.rpcs.list_prediction_api_key_registrations.timeout = 600.0
79
+ default_config.rpcs.list_prediction_api_key_registrations.retry_policy = {
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
81
+ }
82
+
83
+ default_config.rpcs.delete_prediction_api_key_registration.timeout = 600.0
84
+ default_config.rpcs.delete_prediction_api_key_registration.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
86
+ }
87
+
88
+ default_config
89
+ end
90
+ yield @configure if block_given?
91
+ @configure
92
+ end
93
+
94
+ ##
95
+ # Configure the PredictionApiKeyRegistry Client instance.
96
+ #
97
+ # The configuration is set to the derived mode, meaning that values can be changed,
98
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
99
+ # should be made on {Client.configure}.
100
+ #
101
+ # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client::Configuration}
102
+ # for a description of the configuration fields.
103
+ #
104
+ # @yield [config] Configure the Client client.
105
+ # @yieldparam config [Client::Configuration]
106
+ #
107
+ # @return [Client::Configuration]
108
+ #
109
+ def configure
110
+ yield @config if block_given?
111
+ @config
112
+ end
113
+
114
+ ##
115
+ # Create a new PredictionApiKeyRegistry REST client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the PredictionApiKeyRegistry client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # Create the configuration object
132
+ @config = Configuration.new Client.configure
133
+
134
+ # Yield the configuration if needed
135
+ yield @config if block_given?
136
+
137
+ # Create credentials
138
+ credentials = @config.credentials
139
+ # Use self-signed JWT if the endpoint is unchanged from default,
140
+ # but only if the default endpoint does not have a region prefix.
141
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
142
+ !@config.endpoint.split(".").first.include?("-")
143
+ credentials ||= Credentials.default scope: @config.scope,
144
+ enable_self_signed_jwt: enable_self_signed_jwt
145
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
146
+ credentials = Credentials.new credentials, scope: @config.scope
147
+ end
148
+
149
+ @quota_project_id = @config.quota_project
150
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
+
152
+ @prediction_api_key_registry_stub = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
153
+ end
154
+
155
+ # Service calls
156
+
157
+ ##
158
+ # Register an API key for use with predict method.
159
+ #
160
+ # @overload create_prediction_api_key_registration(request, options = nil)
161
+ # Pass arguments to `create_prediction_api_key_registration` via a request object, either of type
162
+ # {::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest} or an equivalent Hash.
163
+ #
164
+ # @param request [::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest, ::Hash]
165
+ # A request object representing the call parameters. Required. To specify no
166
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
167
+ # @param options [::Gapic::CallOptions, ::Hash]
168
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
169
+ #
170
+ # @overload create_prediction_api_key_registration(parent: nil, prediction_api_key_registration: nil)
171
+ # Pass arguments to `create_prediction_api_key_registration` via keyword arguments. Note that at
172
+ # least one keyword argument is required. To specify no parameters, or to keep all
173
+ # the default parameter values, pass an empty Hash as a request object (see above).
174
+ #
175
+ # @param parent [::String]
176
+ # Required. The parent resource path.
177
+ # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`.
178
+ # @param prediction_api_key_registration [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration, ::Hash]
179
+ # Required. The prediction API key registration.
180
+ # @yield [result, operation] Access the result along with the TransportOperation object
181
+ # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration]
182
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
183
+ #
184
+ # @return [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration]
185
+ #
186
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
187
+ def create_prediction_api_key_registration request, options = nil
188
+ raise ::ArgumentError, "request must be provided" if request.nil?
189
+
190
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest
191
+
192
+ # Converts hash and nil to an options object
193
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
194
+
195
+ # Customize the options with defaults
196
+ call_metadata = @config.rpcs.create_prediction_api_key_registration.metadata.to_h
197
+
198
+ # Set x-goog-api-client and x-goog-user-project headers
199
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
200
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
201
+ gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION,
202
+ transports_version_send: [:rest]
203
+
204
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
205
+
206
+ options.apply_defaults timeout: @config.rpcs.create_prediction_api_key_registration.timeout,
207
+ metadata: call_metadata,
208
+ retry_policy: @config.rpcs.create_prediction_api_key_registration.retry_policy
209
+
210
+ options.apply_defaults timeout: @config.timeout,
211
+ metadata: @config.metadata,
212
+ retry_policy: @config.retry_policy
213
+
214
+ @prediction_api_key_registry_stub.create_prediction_api_key_registration request, options do |result, operation|
215
+ yield result, operation if block_given?
216
+ return result
217
+ end
218
+ rescue ::Gapic::Rest::Error => e
219
+ raise ::Google::Cloud::Error.from_error(e)
220
+ end
221
+
222
+ ##
223
+ # List the registered apiKeys for use with predict method.
224
+ #
225
+ # @overload list_prediction_api_key_registrations(request, options = nil)
226
+ # Pass arguments to `list_prediction_api_key_registrations` via a request object, either of type
227
+ # {::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest} or an equivalent Hash.
228
+ #
229
+ # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest, ::Hash]
230
+ # A request object representing the call parameters. Required. To specify no
231
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
232
+ # @param options [::Gapic::CallOptions, ::Hash]
233
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
234
+ #
235
+ # @overload list_prediction_api_key_registrations(parent: nil, page_size: nil, page_token: nil)
236
+ # Pass arguments to `list_prediction_api_key_registrations` via keyword arguments. Note that at
237
+ # least one keyword argument is required. To specify no parameters, or to keep all
238
+ # the default parameter values, pass an empty Hash as a request object (see above).
239
+ #
240
+ # @param parent [::String]
241
+ # Required. The parent placement resource name such as
242
+ # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`
243
+ # @param page_size [::Integer]
244
+ # Optional. Maximum number of results to return per page. If unset, the
245
+ # service will choose a reasonable default.
246
+ # @param page_token [::String]
247
+ # Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`.
248
+ # @yield [result, operation] Access the result along with the TransportOperation object
249
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>]
250
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
251
+ #
252
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>]
253
+ #
254
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
255
+ def list_prediction_api_key_registrations request, options = nil
256
+ raise ::ArgumentError, "request must be provided" if request.nil?
257
+
258
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest
259
+
260
+ # Converts hash and nil to an options object
261
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
262
+
263
+ # Customize the options with defaults
264
+ call_metadata = @config.rpcs.list_prediction_api_key_registrations.metadata.to_h
265
+
266
+ # Set x-goog-api-client and x-goog-user-project headers
267
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
268
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
269
+ gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION,
270
+ transports_version_send: [:rest]
271
+
272
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
273
+
274
+ options.apply_defaults timeout: @config.rpcs.list_prediction_api_key_registrations.timeout,
275
+ metadata: call_metadata,
276
+ retry_policy: @config.rpcs.list_prediction_api_key_registrations.retry_policy
277
+
278
+ options.apply_defaults timeout: @config.timeout,
279
+ metadata: @config.metadata,
280
+ retry_policy: @config.retry_policy
281
+
282
+ @prediction_api_key_registry_stub.list_prediction_api_key_registrations request, options do |result, operation|
283
+ result = ::Gapic::Rest::PagedEnumerable.new @prediction_api_key_registry_stub, :list_prediction_api_key_registrations, "prediction_api_key_registrations", request, result, options
284
+ yield result, operation if block_given?
285
+ return result
286
+ end
287
+ rescue ::Gapic::Rest::Error => e
288
+ raise ::Google::Cloud::Error.from_error(e)
289
+ end
290
+
291
+ ##
292
+ # Unregister an apiKey from using for predict method.
293
+ #
294
+ # @overload delete_prediction_api_key_registration(request, options = nil)
295
+ # Pass arguments to `delete_prediction_api_key_registration` via a request object, either of type
296
+ # {::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest} or an equivalent Hash.
297
+ #
298
+ # @param request [::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest, ::Hash]
299
+ # A request object representing the call parameters. Required. To specify no
300
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
301
+ # @param options [::Gapic::CallOptions, ::Hash]
302
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
303
+ #
304
+ # @overload delete_prediction_api_key_registration(name: nil)
305
+ # Pass arguments to `delete_prediction_api_key_registration` via keyword arguments. Note that at
306
+ # least one keyword argument is required. To specify no parameters, or to keep all
307
+ # the default parameter values, pass an empty Hash as a request object (see above).
308
+ #
309
+ # @param name [::String]
310
+ # Required. The API key to unregister including full resource path.
311
+ # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>`
312
+ # @yield [result, operation] Access the result along with the TransportOperation object
313
+ # @yieldparam result [::Google::Protobuf::Empty]
314
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
315
+ #
316
+ # @return [::Google::Protobuf::Empty]
317
+ #
318
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
319
+ def delete_prediction_api_key_registration request, options = nil
320
+ raise ::ArgumentError, "request must be provided" if request.nil?
321
+
322
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest
323
+
324
+ # Converts hash and nil to an options object
325
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
326
+
327
+ # Customize the options with defaults
328
+ call_metadata = @config.rpcs.delete_prediction_api_key_registration.metadata.to_h
329
+
330
+ # Set x-goog-api-client and x-goog-user-project headers
331
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
332
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
333
+ gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION,
334
+ transports_version_send: [:rest]
335
+
336
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
337
+
338
+ options.apply_defaults timeout: @config.rpcs.delete_prediction_api_key_registration.timeout,
339
+ metadata: call_metadata,
340
+ retry_policy: @config.rpcs.delete_prediction_api_key_registration.retry_policy
341
+
342
+ options.apply_defaults timeout: @config.timeout,
343
+ metadata: @config.metadata,
344
+ retry_policy: @config.retry_policy
345
+
346
+ @prediction_api_key_registry_stub.delete_prediction_api_key_registration request, options do |result, operation|
347
+ yield result, operation if block_given?
348
+ return result
349
+ end
350
+ rescue ::Gapic::Rest::Error => e
351
+ raise ::Google::Cloud::Error.from_error(e)
352
+ end
353
+
354
+ ##
355
+ # Configuration class for the PredictionApiKeyRegistry REST API.
356
+ #
357
+ # This class represents the configuration for PredictionApiKeyRegistry REST,
358
+ # providing control over timeouts, retry behavior, logging, transport
359
+ # parameters, and other low-level controls. Certain parameters can also be
360
+ # applied individually to specific RPCs. See
361
+ # {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client::Configuration::Rpcs}
362
+ # for a list of RPCs that can be configured independently.
363
+ #
364
+ # Configuration can be applied globally to all clients, or to a single client
365
+ # on construction.
366
+ #
367
+ # @example
368
+ #
369
+ # # Modify the global config, setting the timeout for
370
+ # # create_prediction_api_key_registration to 20 seconds,
371
+ # # and all remaining timeouts to 10 seconds.
372
+ # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.configure do |config|
373
+ # config.timeout = 10.0
374
+ # config.rpcs.create_prediction_api_key_registration.timeout = 20.0
375
+ # end
376
+ #
377
+ # # Apply the above configuration only to a new client.
378
+ # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config|
379
+ # config.timeout = 10.0
380
+ # config.rpcs.create_prediction_api_key_registration.timeout = 20.0
381
+ # end
382
+ #
383
+ # @!attribute [rw] endpoint
384
+ # The hostname or hostname:port of the service endpoint.
385
+ # Defaults to `"recommendationengine.googleapis.com"`.
386
+ # @return [::String]
387
+ # @!attribute [rw] credentials
388
+ # Credentials to send with calls. You may provide any of the following types:
389
+ # * (`String`) The path to a service account key file in JSON format
390
+ # * (`Hash`) A service account key as a Hash
391
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
392
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
393
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
394
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
395
+ # * (`nil`) indicating no credentials
396
+ # @return [::Object]
397
+ # @!attribute [rw] scope
398
+ # The OAuth scopes
399
+ # @return [::Array<::String>]
400
+ # @!attribute [rw] lib_name
401
+ # The library name as recorded in instrumentation and logging
402
+ # @return [::String]
403
+ # @!attribute [rw] lib_version
404
+ # The library version as recorded in instrumentation and logging
405
+ # @return [::String]
406
+ # @!attribute [rw] timeout
407
+ # The call timeout in seconds.
408
+ # @return [::Numeric]
409
+ # @!attribute [rw] metadata
410
+ # Additional headers to be sent with the call.
411
+ # @return [::Hash{::Symbol=>::String}]
412
+ # @!attribute [rw] retry_policy
413
+ # The retry policy. The value is a hash with the following keys:
414
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
415
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
416
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
417
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
418
+ # trigger a retry.
419
+ # @return [::Hash]
420
+ # @!attribute [rw] quota_project
421
+ # A separate project against which to charge quota.
422
+ # @return [::String]
423
+ #
424
+ class Configuration
425
+ extend ::Gapic::Config
426
+
427
+ config_attr :endpoint, "recommendationengine.googleapis.com", ::String
428
+ config_attr :credentials, nil do |value|
429
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
430
+ allowed.any? { |klass| klass === value }
431
+ end
432
+ config_attr :scope, nil, ::String, ::Array, nil
433
+ config_attr :lib_name, nil, ::String, nil
434
+ config_attr :lib_version, nil, ::String, nil
435
+ config_attr :timeout, nil, ::Numeric, nil
436
+ config_attr :metadata, nil, ::Hash, nil
437
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
438
+ config_attr :quota_project, nil, ::String, nil
439
+
440
+ # @private
441
+ def initialize parent_config = nil
442
+ @parent_config = parent_config unless parent_config.nil?
443
+
444
+ yield self if block_given?
445
+ end
446
+
447
+ ##
448
+ # Configurations for individual RPCs
449
+ # @return [Rpcs]
450
+ #
451
+ def rpcs
452
+ @rpcs ||= begin
453
+ parent_rpcs = nil
454
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
455
+ Rpcs.new parent_rpcs
456
+ end
457
+ end
458
+
459
+ ##
460
+ # Configuration RPC class for the PredictionApiKeyRegistry API.
461
+ #
462
+ # Includes fields providing the configuration for each RPC in this service.
463
+ # Each configuration object is of type `Gapic::Config::Method` and includes
464
+ # the following configuration fields:
465
+ #
466
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
467
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
468
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
469
+ # include the following keys:
470
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
471
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
472
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
473
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
474
+ # trigger a retry.
475
+ #
476
+ class Rpcs
477
+ ##
478
+ # RPC-specific configuration for `create_prediction_api_key_registration`
479
+ # @return [::Gapic::Config::Method]
480
+ #
481
+ attr_reader :create_prediction_api_key_registration
482
+ ##
483
+ # RPC-specific configuration for `list_prediction_api_key_registrations`
484
+ # @return [::Gapic::Config::Method]
485
+ #
486
+ attr_reader :list_prediction_api_key_registrations
487
+ ##
488
+ # RPC-specific configuration for `delete_prediction_api_key_registration`
489
+ # @return [::Gapic::Config::Method]
490
+ #
491
+ attr_reader :delete_prediction_api_key_registration
492
+
493
+ # @private
494
+ def initialize parent_rpcs = nil
495
+ create_prediction_api_key_registration_config = parent_rpcs.create_prediction_api_key_registration if parent_rpcs.respond_to? :create_prediction_api_key_registration
496
+ @create_prediction_api_key_registration = ::Gapic::Config::Method.new create_prediction_api_key_registration_config
497
+ list_prediction_api_key_registrations_config = parent_rpcs.list_prediction_api_key_registrations if parent_rpcs.respond_to? :list_prediction_api_key_registrations
498
+ @list_prediction_api_key_registrations = ::Gapic::Config::Method.new list_prediction_api_key_registrations_config
499
+ delete_prediction_api_key_registration_config = parent_rpcs.delete_prediction_api_key_registration if parent_rpcs.respond_to? :delete_prediction_api_key_registration
500
+ @delete_prediction_api_key_registration = ::Gapic::Config::Method.new delete_prediction_api_key_registration_config
501
+
502
+ yield self if block_given?
503
+ end
504
+ end
505
+ end
506
+ end
507
+ end
508
+ end
509
+ end
510
+ end
511
+ end
512
+ end