google-cloud-recommender-v1 0.3.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 731ed6c78c054da3bbdf1cc6b41bb469fab9af92b5293940871863ab10240557
4
- data.tar.gz: 28f51bb11efe1aafd3f7f83282c47d891b7e14425b0375be7e86cdddc2f2e46a
3
+ metadata.gz: 0fa6709702cbfa76e63fc80af13987becad8f6a02a251a867ffb38be92678419
4
+ data.tar.gz: 4b94202ff71a5d024df9e63eaa60afd34166b955e4dad6c571c488839b46c48c
5
5
  SHA512:
6
- metadata.gz: 72dedccefbda969920ad42bdacba992825abfd3ab02b1e81fa15e29ae131226fe242cf2deb5624ce302b895f788209abeb89ec911a8c9a22099953652e884ed4
7
- data.tar.gz: 1d2bf1dcdff912fe365b5ec3aabe2d6a24cbffec9c56f6903c8c3cc9e25f7c847ac23e30d43c571485abc2a8c71d44e9ea56833c7bf6dde12084af9302b97766
6
+ metadata.gz: 4357f1e257fd83e1d6dd908ccd2566243f7131cc0c92e1022e14cfe0a6d00a163dd30f6e4f39f807ecf852c6c8cdb9be50492253be3d5618a3879d76f77a5022
7
+ data.tar.gz: e2f75c28174c6fa73715ef818ea5d98543012c080922a8010053ee6ce9a2fcad242ca13848cc063bb1b4cc4f9499f1cebb6d978904c4a882fc7337c641100cb7
@@ -27,7 +27,7 @@ export RECOMMENDER_CREDENTIALS=path/to/keyfile.json
27
27
  ```ruby
28
28
  require "google/cloud/recommender/v1"
29
29
 
30
- client = Google::Cloud::Recommender::V1::Recommender::Client.new
30
+ client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
31
31
  ```
32
32
 
33
33
  ## Credential Lookup
@@ -64,7 +64,7 @@ containers where writing files is difficult or not encouraged.
64
64
 
65
65
  The environment variables that google-cloud-recommender-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
- {Google::Cloud::Recommender::V1::Recommender::Credentials}):
67
+ {::Google::Cloud::Recommender::V1::Recommender::Credentials}):
68
68
 
69
69
  1. `RECOMMENDER_CREDENTIALS` - Path to JSON file, or JSON contents
70
70
  2. `RECOMMENDER_KEYFILE` - Path to JSON file, or JSON contents
@@ -77,7 +77,7 @@ require "google/cloud/recommender/v1"
77
77
 
78
78
  ENV["RECOMMENDER_CREDENTIALS"] = "path/to/keyfile.json"
79
79
 
80
- client = Google::Cloud::Recommender::V1::Recommender::Client.new
80
+ client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
81
81
  ```
82
82
 
83
83
  ### Configuration
@@ -88,7 +88,7 @@ environment variables. Either on an individual client initialization:
88
88
  ```ruby
89
89
  require "google/cloud/recommender/v1"
90
90
 
91
- client = Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
91
+ client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
92
92
  config.credentials = "path/to/keyfile.json"
93
93
  end
94
94
  ```
@@ -98,11 +98,11 @@ Or configured globally for all clients:
98
98
  ```ruby
99
99
  require "google/cloud/recommender/v1"
100
100
 
101
- Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
101
+ ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
102
102
  config.credentials = "path/to/keyfile.json"
103
103
  end
104
104
 
105
- client = Google::Cloud::Recommender::V1::Recommender::Client.new
105
+ client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
106
106
  ```
107
107
 
108
108
  ### Cloud SDK
data/README.md CHANGED
@@ -18,6 +18,7 @@ In order to use this library, you first need to go through the following steps:
18
18
 
19
19
  1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
20
20
  1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
21
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/recommender.googleapis.com)
21
22
  1. {file:AUTHENTICATION.md Set up authentication.}
22
23
 
23
24
  ## Quick Start
@@ -25,7 +26,7 @@ In order to use this library, you first need to go through the following steps:
25
26
  ```ruby
26
27
  require "google/cloud/recommender/v1"
27
28
 
28
- client = Google::Cloud::Recommender::V1::Recommender::Client.new
29
+ client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
29
30
  request = my_create_request
30
31
  response = client.list_recommendations request
31
32
  ```
@@ -33,6 +34,9 @@ response = client.list_recommendations request
33
34
  View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-recommender-v1/latest)
34
35
  for class and method documentation.
35
36
 
37
+ See also the [Product Documentation](https://cloud.google.com/recommender)
38
+ for general usage information.
39
+
36
40
  ## Enabling Logging
37
41
 
38
42
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
@@ -26,7 +26,7 @@ module Google
26
26
  # To load this package, including all its services, and instantiate a client:
27
27
  #
28
28
  # require "google/cloud/recommender/v1"
29
- # client = Google::Cloud::Recommender::V1::Recommender::Client.new
29
+ # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
30
30
  #
31
31
  module V1
32
32
  end
@@ -39,7 +39,7 @@ module Google
39
39
  # To load this service and instantiate a client:
40
40
  #
41
41
  # require "google/cloud/recommender/v1/recommender"
42
- # client = Google::Cloud::Recommender::V1::Recommender::Client.new
42
+ # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
43
43
  #
44
44
  module Recommender
45
45
  end
@@ -41,15 +41,15 @@ module Google
41
41
  ##
42
42
  # Configure the Recommender Client class.
43
43
  #
44
- # See {Google::Cloud::Recommender::V1::Recommender::Client::Configuration}
44
+ # See {::Google::Cloud::Recommender::V1::Recommender::Client::Configuration}
45
45
  # for a description of the configuration fields.
46
46
  #
47
47
  # ## Example
48
48
  #
49
49
  # To modify the configuration for all Recommender clients:
50
50
  #
51
- # Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
52
- # config.timeout = 10_000
51
+ # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
52
+ # config.timeout = 10.0
53
53
  # end
54
54
  #
55
55
  # @yield [config] Configure the Client client.
@@ -103,7 +103,7 @@ module Google
103
103
  # but structural changes (adding new fields, etc.) are not allowed. Structural changes
104
104
  # should be made on {Client.configure}.
105
105
  #
106
- # See {Google::Cloud::Recommender::V1::Recommender::Client::Configuration}
106
+ # See {::Google::Cloud::Recommender::V1::Recommender::Client::Configuration}
107
107
  # for a description of the configuration fields.
108
108
  #
109
109
  # @yield [config] Configure the Client client.
@@ -124,13 +124,13 @@ module Google
124
124
  # To create a new Recommender client with the default
125
125
  # configuration:
126
126
  #
127
- # client = Google::Cloud::Recommender::V1::Recommender::Client.new
127
+ # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
128
128
  #
129
129
  # To create a new Recommender client with a custom
130
130
  # configuration:
131
131
  #
132
- # client = Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
133
- # config.timeout = 10_000
132
+ # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
133
+ # config.timeout = 10.0
134
134
  # end
135
135
  #
136
136
  # @yield [config] Configure the Recommender client.
@@ -155,10 +155,11 @@ module Google
155
155
  if credentials.is_a?(String) || credentials.is_a?(Hash)
156
156
  credentials = Credentials.new credentials, scope: @config.scope
157
157
  end
158
- @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
158
+ @quota_project_id = @config.quota_project
159
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
159
160
 
160
- @recommender_stub = Gapic::ServiceStub.new(
161
- Google::Cloud::Recommender::V1::Recommender::Stub,
161
+ @recommender_stub = ::Gapic::ServiceStub.new(
162
+ ::Google::Cloud::Recommender::V1::Recommender::Stub,
162
163
  credentials: credentials,
163
164
  endpoint: @config.endpoint,
164
165
  channel_args: @config.channel_args,
@@ -174,12 +175,12 @@ module Google
174
175
  #
175
176
  # @overload list_recommendations(request, options = nil)
176
177
  # Pass arguments to `list_recommendations` via a request object, either of type
177
- # {Google::Cloud::Recommender::V1::ListRecommendationsRequest} or an equivalent Hash.
178
+ # {::Google::Cloud::Recommender::V1::ListRecommendationsRequest} or an equivalent Hash.
178
179
  #
179
- # @param request [Google::Cloud::Recommender::V1::ListRecommendationsRequest, Hash]
180
+ # @param request [::Google::Cloud::Recommender::V1::ListRecommendationsRequest, ::Hash]
180
181
  # A request object representing the call parameters. Required. To specify no
181
182
  # parameters, or to keep all the default parameter values, pass an empty Hash.
182
- # @param options [Gapic::CallOptions, Hash]
183
+ # @param options [::Gapic::CallOptions, ::Hash]
183
184
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
184
185
  #
185
186
  # @overload list_recommendations(parent: nil, page_size: nil, page_token: nil, filter: nil)
@@ -187,7 +188,7 @@ module Google
187
188
  # least one keyword argument is required. To specify no parameters, or to keep all
188
189
  # the default parameter values, pass an empty Hash as a request object (see above).
189
190
  #
190
- # @param parent [String]
191
+ # @param parent [::String]
191
192
  # Required. The container resource on which to execute the request.
192
193
  # Acceptable formats:
193
194
  #
@@ -196,41 +197,41 @@ module Google
196
197
  #
197
198
  # LOCATION here refers to GCP Locations:
198
199
  # https://cloud.google.com/about/locations/
199
- # @param page_size [Integer]
200
+ # @param page_size [::Integer]
200
201
  # Optional. The maximum number of results to return from this request. Non-positive
201
202
  # values are ignored. If not specified, the server will determine the number
202
203
  # of results to return.
203
- # @param page_token [String]
204
+ # @param page_token [::String]
204
205
  # Optional. If present, retrieves the next batch of results from the preceding call to
205
206
  # this method. `page_token` must be the value of `next_page_token` from the
206
207
  # previous response. The values of other method parameters must be identical
207
208
  # to those in the previous call.
208
- # @param filter [String]
209
+ # @param filter [::String]
209
210
  # Filter expression to restrict the recommendations returned. Supported
210
211
  # filter fields: state_info.state
211
212
  # Eg: `state_info.state:"DISMISSED" or state_info.state:"FAILED"
212
213
  #
213
214
  # @yield [response, operation] Access the result along with the RPC operation
214
- # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Recommender::V1::Recommendation>]
215
- # @yieldparam operation [GRPC::ActiveCall::Operation]
215
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>]
216
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
216
217
  #
217
- # @return [Gapic::PagedEnumerable<Google::Cloud::Recommender::V1::Recommendation>]
218
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>]
218
219
  #
219
- # @raise [Google::Cloud::Error] if the RPC is aborted.
220
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
220
221
  #
221
222
  def list_recommendations request, options = nil
222
- raise ArgumentError, "request must be provided" if request.nil?
223
+ raise ::ArgumentError, "request must be provided" if request.nil?
223
224
 
224
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Recommender::V1::ListRecommendationsRequest
225
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListRecommendationsRequest
225
226
 
226
227
  # Converts hash and nil to an options object
227
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
228
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
228
229
 
229
230
  # Customize the options with defaults
230
231
  metadata = @config.rpcs.list_recommendations.metadata.to_h
231
232
 
232
233
  # Set x-goog-api-client and x-goog-user-project headers
233
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
234
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
234
235
  lib_name: @config.lib_name, lib_version: @config.lib_version,
235
236
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
236
237
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -248,12 +249,12 @@ module Google
248
249
  retry_policy: @config.retry_policy
249
250
 
250
251
  @recommender_stub.call_rpc :list_recommendations, request, options: options do |response, operation|
251
- response = Gapic::PagedEnumerable.new @recommender_stub, :list_recommendations, request, response, operation, options
252
+ response = ::Gapic::PagedEnumerable.new @recommender_stub, :list_recommendations, request, response, operation, options
252
253
  yield response, operation if block_given?
253
254
  return response
254
255
  end
255
- rescue GRPC::BadStatus => e
256
- raise Google::Cloud::Error.from_error(e)
256
+ rescue ::GRPC::BadStatus => e
257
+ raise ::Google::Cloud::Error.from_error(e)
257
258
  end
258
259
 
259
260
  ##
@@ -262,12 +263,12 @@ module Google
262
263
  #
263
264
  # @overload get_recommendation(request, options = nil)
264
265
  # Pass arguments to `get_recommendation` via a request object, either of type
265
- # {Google::Cloud::Recommender::V1::GetRecommendationRequest} or an equivalent Hash.
266
+ # {::Google::Cloud::Recommender::V1::GetRecommendationRequest} or an equivalent Hash.
266
267
  #
267
- # @param request [Google::Cloud::Recommender::V1::GetRecommendationRequest, Hash]
268
+ # @param request [::Google::Cloud::Recommender::V1::GetRecommendationRequest, ::Hash]
268
269
  # A request object representing the call parameters. Required. To specify no
269
270
  # parameters, or to keep all the default parameter values, pass an empty Hash.
270
- # @param options [Gapic::CallOptions, Hash]
271
+ # @param options [::Gapic::CallOptions, ::Hash]
271
272
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
272
273
  #
273
274
  # @overload get_recommendation(name: nil)
@@ -275,30 +276,30 @@ module Google
275
276
  # least one keyword argument is required. To specify no parameters, or to keep all
276
277
  # the default parameter values, pass an empty Hash as a request object (see above).
277
278
  #
278
- # @param name [String]
279
+ # @param name [::String]
279
280
  # Required. Name of the recommendation.
280
281
  #
281
282
  # @yield [response, operation] Access the result along with the RPC operation
282
- # @yieldparam response [Google::Cloud::Recommender::V1::Recommendation]
283
- # @yieldparam operation [GRPC::ActiveCall::Operation]
283
+ # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation]
284
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
284
285
  #
285
- # @return [Google::Cloud::Recommender::V1::Recommendation]
286
+ # @return [::Google::Cloud::Recommender::V1::Recommendation]
286
287
  #
287
- # @raise [Google::Cloud::Error] if the RPC is aborted.
288
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
288
289
  #
289
290
  def get_recommendation request, options = nil
290
- raise ArgumentError, "request must be provided" if request.nil?
291
+ raise ::ArgumentError, "request must be provided" if request.nil?
291
292
 
292
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Recommender::V1::GetRecommendationRequest
293
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommendationRequest
293
294
 
294
295
  # Converts hash and nil to an options object
295
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
296
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
296
297
 
297
298
  # Customize the options with defaults
298
299
  metadata = @config.rpcs.get_recommendation.metadata.to_h
299
300
 
300
301
  # Set x-goog-api-client and x-goog-user-project headers
301
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
302
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
302
303
  lib_name: @config.lib_name, lib_version: @config.lib_version,
303
304
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
304
305
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -319,8 +320,8 @@ module Google
319
320
  yield response, operation if block_given?
320
321
  return response
321
322
  end
322
- rescue GRPC::BadStatus => e
323
- raise Google::Cloud::Error.from_error(e)
323
+ rescue ::GRPC::BadStatus => e
324
+ raise ::Google::Cloud::Error.from_error(e)
324
325
  end
325
326
 
326
327
  ##
@@ -337,12 +338,12 @@ module Google
337
338
  #
338
339
  # @overload mark_recommendation_claimed(request, options = nil)
339
340
  # Pass arguments to `mark_recommendation_claimed` via a request object, either of type
340
- # {Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest} or an equivalent Hash.
341
+ # {::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest} or an equivalent Hash.
341
342
  #
342
- # @param request [Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, Hash]
343
+ # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, ::Hash]
343
344
  # A request object representing the call parameters. Required. To specify no
344
345
  # parameters, or to keep all the default parameter values, pass an empty Hash.
345
- # @param options [Gapic::CallOptions, Hash]
346
+ # @param options [::Gapic::CallOptions, ::Hash]
346
347
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
347
348
  #
348
349
  # @overload mark_recommendation_claimed(name: nil, state_metadata: nil, etag: nil)
@@ -350,37 +351,37 @@ module Google
350
351
  # least one keyword argument is required. To specify no parameters, or to keep all
351
352
  # the default parameter values, pass an empty Hash as a request object (see above).
352
353
  #
353
- # @param name [String]
354
+ # @param name [::String]
354
355
  # Required. Name of the recommendation.
355
- # @param state_metadata [Hash{String => String}]
356
+ # @param state_metadata [::Hash{::String => ::String}]
356
357
  # State properties to include with this state. Overwrites any existing
357
358
  # `state_metadata`.
358
359
  # Keys must match the regex /^[a-z0-9][a-z0-9_.-]\\{0,62}$/.
359
360
  # Values must match the regex /^[a-zA-Z0-9_./-]\\{0,255}$/.
360
- # @param etag [String]
361
+ # @param etag [::String]
361
362
  # Required. Fingerprint of the Recommendation. Provides optimistic locking.
362
363
  #
363
364
  # @yield [response, operation] Access the result along with the RPC operation
364
- # @yieldparam response [Google::Cloud::Recommender::V1::Recommendation]
365
- # @yieldparam operation [GRPC::ActiveCall::Operation]
365
+ # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation]
366
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
366
367
  #
367
- # @return [Google::Cloud::Recommender::V1::Recommendation]
368
+ # @return [::Google::Cloud::Recommender::V1::Recommendation]
368
369
  #
369
- # @raise [Google::Cloud::Error] if the RPC is aborted.
370
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
370
371
  #
371
372
  def mark_recommendation_claimed request, options = nil
372
- raise ArgumentError, "request must be provided" if request.nil?
373
+ raise ::ArgumentError, "request must be provided" if request.nil?
373
374
 
374
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest
375
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest
375
376
 
376
377
  # Converts hash and nil to an options object
377
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
378
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
378
379
 
379
380
  # Customize the options with defaults
380
381
  metadata = @config.rpcs.mark_recommendation_claimed.metadata.to_h
381
382
 
382
383
  # Set x-goog-api-client and x-goog-user-project headers
383
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
384
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
384
385
  lib_name: @config.lib_name, lib_version: @config.lib_version,
385
386
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
386
387
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -401,8 +402,8 @@ module Google
401
402
  yield response, operation if block_given?
402
403
  return response
403
404
  end
404
- rescue GRPC::BadStatus => e
405
- raise Google::Cloud::Error.from_error(e)
405
+ rescue ::GRPC::BadStatus => e
406
+ raise ::Google::Cloud::Error.from_error(e)
406
407
  end
407
408
 
408
409
  ##
@@ -419,12 +420,12 @@ module Google
419
420
  #
420
421
  # @overload mark_recommendation_succeeded(request, options = nil)
421
422
  # Pass arguments to `mark_recommendation_succeeded` via a request object, either of type
422
- # {Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest} or an equivalent Hash.
423
+ # {::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest} or an equivalent Hash.
423
424
  #
424
- # @param request [Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, Hash]
425
+ # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, ::Hash]
425
426
  # A request object representing the call parameters. Required. To specify no
426
427
  # parameters, or to keep all the default parameter values, pass an empty Hash.
427
- # @param options [Gapic::CallOptions, Hash]
428
+ # @param options [::Gapic::CallOptions, ::Hash]
428
429
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
429
430
  #
430
431
  # @overload mark_recommendation_succeeded(name: nil, state_metadata: nil, etag: nil)
@@ -432,37 +433,37 @@ module Google
432
433
  # least one keyword argument is required. To specify no parameters, or to keep all
433
434
  # the default parameter values, pass an empty Hash as a request object (see above).
434
435
  #
435
- # @param name [String]
436
+ # @param name [::String]
436
437
  # Required. Name of the recommendation.
437
- # @param state_metadata [Hash{String => String}]
438
+ # @param state_metadata [::Hash{::String => ::String}]
438
439
  # State properties to include with this state. Overwrites any existing
439
440
  # `state_metadata`.
440
441
  # Keys must match the regex /^[a-z0-9][a-z0-9_.-]\\{0,62}$/.
441
442
  # Values must match the regex /^[a-zA-Z0-9_./-]\\{0,255}$/.
442
- # @param etag [String]
443
+ # @param etag [::String]
443
444
  # Required. Fingerprint of the Recommendation. Provides optimistic locking.
444
445
  #
445
446
  # @yield [response, operation] Access the result along with the RPC operation
446
- # @yieldparam response [Google::Cloud::Recommender::V1::Recommendation]
447
- # @yieldparam operation [GRPC::ActiveCall::Operation]
447
+ # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation]
448
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
448
449
  #
449
- # @return [Google::Cloud::Recommender::V1::Recommendation]
450
+ # @return [::Google::Cloud::Recommender::V1::Recommendation]
450
451
  #
451
- # @raise [Google::Cloud::Error] if the RPC is aborted.
452
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
452
453
  #
453
454
  def mark_recommendation_succeeded request, options = nil
454
- raise ArgumentError, "request must be provided" if request.nil?
455
+ raise ::ArgumentError, "request must be provided" if request.nil?
455
456
 
456
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest
457
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest
457
458
 
458
459
  # Converts hash and nil to an options object
459
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
460
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
460
461
 
461
462
  # Customize the options with defaults
462
463
  metadata = @config.rpcs.mark_recommendation_succeeded.metadata.to_h
463
464
 
464
465
  # Set x-goog-api-client and x-goog-user-project headers
465
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
466
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
466
467
  lib_name: @config.lib_name, lib_version: @config.lib_version,
467
468
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
468
469
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -483,8 +484,8 @@ module Google
483
484
  yield response, operation if block_given?
484
485
  return response
485
486
  end
486
- rescue GRPC::BadStatus => e
487
- raise Google::Cloud::Error.from_error(e)
487
+ rescue ::GRPC::BadStatus => e
488
+ raise ::Google::Cloud::Error.from_error(e)
488
489
  end
489
490
 
490
491
  ##
@@ -501,12 +502,12 @@ module Google
501
502
  #
502
503
  # @overload mark_recommendation_failed(request, options = nil)
503
504
  # Pass arguments to `mark_recommendation_failed` via a request object, either of type
504
- # {Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest} or an equivalent Hash.
505
+ # {::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest} or an equivalent Hash.
505
506
  #
506
- # @param request [Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, Hash]
507
+ # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, ::Hash]
507
508
  # A request object representing the call parameters. Required. To specify no
508
509
  # parameters, or to keep all the default parameter values, pass an empty Hash.
509
- # @param options [Gapic::CallOptions, Hash]
510
+ # @param options [::Gapic::CallOptions, ::Hash]
510
511
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
511
512
  #
512
513
  # @overload mark_recommendation_failed(name: nil, state_metadata: nil, etag: nil)
@@ -514,37 +515,37 @@ module Google
514
515
  # least one keyword argument is required. To specify no parameters, or to keep all
515
516
  # the default parameter values, pass an empty Hash as a request object (see above).
516
517
  #
517
- # @param name [String]
518
+ # @param name [::String]
518
519
  # Required. Name of the recommendation.
519
- # @param state_metadata [Hash{String => String}]
520
+ # @param state_metadata [::Hash{::String => ::String}]
520
521
  # State properties to include with this state. Overwrites any existing
521
522
  # `state_metadata`.
522
523
  # Keys must match the regex /^[a-z0-9][a-z0-9_.-]\\{0,62}$/.
523
524
  # Values must match the regex /^[a-zA-Z0-9_./-]\\{0,255}$/.
524
- # @param etag [String]
525
+ # @param etag [::String]
525
526
  # Required. Fingerprint of the Recommendation. Provides optimistic locking.
526
527
  #
527
528
  # @yield [response, operation] Access the result along with the RPC operation
528
- # @yieldparam response [Google::Cloud::Recommender::V1::Recommendation]
529
- # @yieldparam operation [GRPC::ActiveCall::Operation]
529
+ # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation]
530
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
530
531
  #
531
- # @return [Google::Cloud::Recommender::V1::Recommendation]
532
+ # @return [::Google::Cloud::Recommender::V1::Recommendation]
532
533
  #
533
- # @raise [Google::Cloud::Error] if the RPC is aborted.
534
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
534
535
  #
535
536
  def mark_recommendation_failed request, options = nil
536
- raise ArgumentError, "request must be provided" if request.nil?
537
+ raise ::ArgumentError, "request must be provided" if request.nil?
537
538
 
538
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest
539
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest
539
540
 
540
541
  # Converts hash and nil to an options object
541
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
542
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
542
543
 
543
544
  # Customize the options with defaults
544
545
  metadata = @config.rpcs.mark_recommendation_failed.metadata.to_h
545
546
 
546
547
  # Set x-goog-api-client and x-goog-user-project headers
547
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
548
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
548
549
  lib_name: @config.lib_name, lib_version: @config.lib_version,
549
550
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
550
551
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -565,8 +566,8 @@ module Google
565
566
  yield response, operation if block_given?
566
567
  return response
567
568
  end
568
- rescue GRPC::BadStatus => e
569
- raise Google::Cloud::Error.from_error(e)
569
+ rescue ::GRPC::BadStatus => e
570
+ raise ::Google::Cloud::Error.from_error(e)
570
571
  end
571
572
 
572
573
  ##
@@ -576,7 +577,7 @@ module Google
576
577
  # providing control over timeouts, retry behavior, logging, transport
577
578
  # parameters, and other low-level controls. Certain parameters can also be
578
579
  # applied individually to specific RPCs. See
579
- # {Google::Cloud::Recommender::V1::Recommender::Client::Configuration::Rpcs}
580
+ # {::Google::Cloud::Recommender::V1::Recommender::Client::Configuration::Rpcs}
580
581
  # for a list of RPCs that can be configured independently.
581
582
  #
582
583
  # Configuration can be applied globally to all clients, or to a single client
@@ -587,22 +588,22 @@ module Google
587
588
  # To modify the global config, setting the timeout for list_recommendations
588
589
  # to 20 seconds, and all remaining timeouts to 10 seconds:
589
590
  #
590
- # Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
591
- # config.timeout = 10_000
592
- # config.rpcs.list_recommendations.timeout = 20_000
591
+ # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
592
+ # config.timeout = 10.0
593
+ # config.rpcs.list_recommendations.timeout = 20.0
593
594
  # end
594
595
  #
595
596
  # To apply the above configuration only to a new client:
596
597
  #
597
- # client = Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
598
- # config.timeout = 10_000
599
- # config.rpcs.list_recommendations.timeout = 20_000
598
+ # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
599
+ # config.timeout = 10.0
600
+ # config.rpcs.list_recommendations.timeout = 20.0
600
601
  # end
601
602
  #
602
603
  # @!attribute [rw] endpoint
603
604
  # The hostname or hostname:port of the service endpoint.
604
605
  # Defaults to `"recommender.googleapis.com"`.
605
- # @return [String]
606
+ # @return [::String]
606
607
  # @!attribute [rw] credentials
607
608
  # Credentials to send with calls. You may provide any of the following types:
608
609
  # * (`String`) The path to a service account key file in JSON format
@@ -614,29 +615,29 @@ module Google
614
615
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
615
616
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
616
617
  # * (`nil`) indicating no credentials
617
- # @return [Object]
618
+ # @return [::Object]
618
619
  # @!attribute [rw] scope
619
620
  # The OAuth scopes
620
- # @return [Array<String>]
621
+ # @return [::Array<::String>]
621
622
  # @!attribute [rw] lib_name
622
623
  # The library name as recorded in instrumentation and logging
623
- # @return [String]
624
+ # @return [::String]
624
625
  # @!attribute [rw] lib_version
625
626
  # The library version as recorded in instrumentation and logging
626
- # @return [String]
627
+ # @return [::String]
627
628
  # @!attribute [rw] channel_args
628
629
  # Extra parameters passed to the gRPC channel. Note: this is ignored if a
629
630
  # `GRPC::Core::Channel` object is provided as the credential.
630
- # @return [Hash]
631
+ # @return [::Hash]
631
632
  # @!attribute [rw] interceptors
632
633
  # An array of interceptors that are run before calls are executed.
633
- # @return [Array<GRPC::ClientInterceptor>]
634
+ # @return [::Array<::GRPC::ClientInterceptor>]
634
635
  # @!attribute [rw] timeout
635
- # The call timeout in milliseconds.
636
- # @return [Numeric]
636
+ # The call timeout in seconds.
637
+ # @return [::Numeric]
637
638
  # @!attribute [rw] metadata
638
639
  # Additional gRPC headers to be sent with the call.
639
- # @return [Hash{Symbol=>String}]
640
+ # @return [::Hash{::Symbol=>::String}]
640
641
  # @!attribute [rw] retry_policy
641
642
  # The retry policy. The value is a hash with the following keys:
642
643
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
@@ -644,25 +645,29 @@ module Google
644
645
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
645
646
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
646
647
  # trigger a retry.
647
- # @return [Hash]
648
+ # @return [::Hash]
649
+ # @!attribute [rw] quota_project
650
+ # A separate project against which to charge quota.
651
+ # @return [::String]
648
652
  #
649
653
  class Configuration
650
- extend Gapic::Config
654
+ extend ::Gapic::Config
651
655
 
652
- config_attr :endpoint, "recommender.googleapis.com", String
653
- config_attr :credentials, nil do |value|
656
+ config_attr :endpoint, "recommender.googleapis.com", ::String
657
+ config_attr :credentials, nil do |value|
654
658
  allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
655
659
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
656
660
  allowed.any? { |klass| klass === value }
657
661
  end
658
- config_attr :scope, nil, String, Array, nil
659
- config_attr :lib_name, nil, String, nil
660
- config_attr :lib_version, nil, String, nil
661
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
662
- config_attr :interceptors, nil, Array, nil
663
- config_attr :timeout, nil, Numeric, nil
664
- config_attr :metadata, nil, Hash, nil
665
- config_attr :retry_policy, nil, Hash, Proc, nil
662
+ config_attr :scope, nil, ::String, ::Array, nil
663
+ config_attr :lib_name, nil, ::String, nil
664
+ config_attr :lib_version, nil, ::String, nil
665
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
666
+ config_attr :interceptors, nil, ::Array, nil
667
+ config_attr :timeout, nil, ::Numeric, nil
668
+ config_attr :metadata, nil, ::Hash, nil
669
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
670
+ config_attr :quota_project, nil, ::String, nil
666
671
 
667
672
  # @private
668
673
  def initialize parent_config = nil
@@ -678,7 +683,7 @@ module Google
678
683
  def rpcs
679
684
  @rpcs ||= begin
680
685
  parent_rpcs = nil
681
- parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
686
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
682
687
  Rpcs.new parent_rpcs
683
688
  end
684
689
  end
@@ -703,42 +708,42 @@ module Google
703
708
  class Rpcs
704
709
  ##
705
710
  # RPC-specific configuration for `list_recommendations`
706
- # @return [Gapic::Config::Method]
711
+ # @return [::Gapic::Config::Method]
707
712
  #
708
713
  attr_reader :list_recommendations
709
714
  ##
710
715
  # RPC-specific configuration for `get_recommendation`
711
- # @return [Gapic::Config::Method]
716
+ # @return [::Gapic::Config::Method]
712
717
  #
713
718
  attr_reader :get_recommendation
714
719
  ##
715
720
  # RPC-specific configuration for `mark_recommendation_claimed`
716
- # @return [Gapic::Config::Method]
721
+ # @return [::Gapic::Config::Method]
717
722
  #
718
723
  attr_reader :mark_recommendation_claimed
719
724
  ##
720
725
  # RPC-specific configuration for `mark_recommendation_succeeded`
721
- # @return [Gapic::Config::Method]
726
+ # @return [::Gapic::Config::Method]
722
727
  #
723
728
  attr_reader :mark_recommendation_succeeded
724
729
  ##
725
730
  # RPC-specific configuration for `mark_recommendation_failed`
726
- # @return [Gapic::Config::Method]
731
+ # @return [::Gapic::Config::Method]
727
732
  #
728
733
  attr_reader :mark_recommendation_failed
729
734
 
730
735
  # @private
731
736
  def initialize parent_rpcs = nil
732
737
  list_recommendations_config = parent_rpcs&.list_recommendations if parent_rpcs&.respond_to? :list_recommendations
733
- @list_recommendations = Gapic::Config::Method.new list_recommendations_config
738
+ @list_recommendations = ::Gapic::Config::Method.new list_recommendations_config
734
739
  get_recommendation_config = parent_rpcs&.get_recommendation if parent_rpcs&.respond_to? :get_recommendation
735
- @get_recommendation = Gapic::Config::Method.new get_recommendation_config
740
+ @get_recommendation = ::Gapic::Config::Method.new get_recommendation_config
736
741
  mark_recommendation_claimed_config = parent_rpcs&.mark_recommendation_claimed if parent_rpcs&.respond_to? :mark_recommendation_claimed
737
- @mark_recommendation_claimed = Gapic::Config::Method.new mark_recommendation_claimed_config
742
+ @mark_recommendation_claimed = ::Gapic::Config::Method.new mark_recommendation_claimed_config
738
743
  mark_recommendation_succeeded_config = parent_rpcs&.mark_recommendation_succeeded if parent_rpcs&.respond_to? :mark_recommendation_succeeded
739
- @mark_recommendation_succeeded = Gapic::Config::Method.new mark_recommendation_succeeded_config
744
+ @mark_recommendation_succeeded = ::Gapic::Config::Method.new mark_recommendation_succeeded_config
740
745
  mark_recommendation_failed_config = parent_rpcs&.mark_recommendation_failed if parent_rpcs&.respond_to? :mark_recommendation_failed
741
- @mark_recommendation_failed = Gapic::Config::Method.new mark_recommendation_failed_config
746
+ @mark_recommendation_failed = ::Gapic::Config::Method.new mark_recommendation_failed_config
742
747
 
743
748
  yield self if block_given?
744
749
  end