google-cloud-vision-v1 0.1.4 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +6 -6
  3. data/README.md +5 -1
  4. data/lib/google/cloud/vision/v1.rb +1 -1
  5. data/lib/google/cloud/vision/v1/image_annotator.rb +1 -1
  6. data/lib/google/cloud/vision/v1/image_annotator/client.rb +117 -112
  7. data/lib/google/cloud/vision/v1/image_annotator/credentials.rb +1 -1
  8. data/lib/google/cloud/vision/v1/image_annotator/operations.rb +109 -103
  9. data/lib/google/cloud/vision/v1/image_annotator/paths.rb +3 -3
  10. data/lib/google/cloud/vision/v1/product_search.rb +4 -4
  11. data/lib/google/cloud/vision/v1/product_search/client.rb +386 -381
  12. data/lib/google/cloud/vision/v1/product_search/credentials.rb +1 -1
  13. data/lib/google/cloud/vision/v1/product_search/operations.rb +109 -103
  14. data/lib/google/cloud/vision/v1/product_search/paths.rb +12 -12
  15. data/lib/google/cloud/vision/v1/version.rb +1 -1
  16. data/proto_docs/google/api/resource.rb +12 -12
  17. data/proto_docs/google/cloud/vision/v1/geometry.rb +17 -17
  18. data/proto_docs/google/cloud/vision/v1/image_annotator.rb +204 -204
  19. data/proto_docs/google/cloud/vision/v1/product_search.rb +28 -28
  20. data/proto_docs/google/cloud/vision/v1/product_search_service.rb +144 -144
  21. data/proto_docs/google/cloud/vision/v1/text_annotation.rb +49 -49
  22. data/proto_docs/google/cloud/vision/v1/web_detection.rb +28 -28
  23. data/proto_docs/google/longrunning/operations.rb +30 -30
  24. data/proto_docs/google/protobuf/any.rb +4 -4
  25. data/proto_docs/google/protobuf/empty.rb +2 -2
  26. data/proto_docs/google/protobuf/field_mask.rb +3 -3
  27. data/proto_docs/google/protobuf/timestamp.rb +4 -4
  28. data/proto_docs/google/protobuf/wrappers.rb +27 -27
  29. data/proto_docs/google/rpc/status.rb +6 -6
  30. data/proto_docs/google/type/color.rb +6 -6
  31. data/proto_docs/google/type/latlng.rb +4 -4
  32. metadata +33 -6
  33. data/lib/google/cloud/common_resources_pb.rb +0 -15
@@ -24,7 +24,7 @@ module Google
24
24
  module V1
25
25
  module ProductSearch
26
26
  # Credentials for the ProductSearch API.
27
- class Credentials < Google::Auth::Credentials
27
+ class Credentials < ::Google::Auth::Credentials
28
28
  self.scope = [
29
29
  "https://www.googleapis.com/auth/cloud-platform",
30
30
  "https://www.googleapis.com/auth/cloud-vision"
@@ -85,9 +85,11 @@ module Google
85
85
  if credentials.is_a?(String) || credentials.is_a?(Hash)
86
86
  credentials = Credentials.new credentials, scope: @config.scope
87
87
  end
88
+ @quota_project_id = @config.quota_project
89
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
88
90
 
89
- @operations_stub = Gapic::ServiceStub.new(
90
- Google::Longrunning::Operations::Stub,
91
+ @operations_stub = ::Gapic::ServiceStub.new(
92
+ ::Google::Longrunning::Operations::Stub,
91
93
  credentials: credentials,
92
94
  endpoint: @config.endpoint,
93
95
  channel_args: @config.channel_args,
@@ -106,12 +108,12 @@ module Google
106
108
  #
107
109
  # @overload list_operations(request, options = nil)
108
110
  # Pass arguments to `list_operations` via a request object, either of type
109
- # {Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
111
+ # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
110
112
  #
111
- # @param request [Google::Longrunning::ListOperationsRequest, Hash]
113
+ # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash]
112
114
  # A request object representing the call parameters. Required. To specify no
113
115
  # parameters, or to keep all the default parameter values, pass an empty Hash.
114
- # @param options [Gapic::CallOptions, Hash]
116
+ # @param options [::Gapic::CallOptions, ::Hash]
115
117
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
116
118
  #
117
119
  # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
@@ -119,36 +121,36 @@ module Google
119
121
  # least one keyword argument is required. To specify no parameters, or to keep all
120
122
  # the default parameter values, pass an empty Hash as a request object (see above).
121
123
  #
122
- # @param name [String]
124
+ # @param name [::String]
123
125
  # The name of the operation collection.
124
- # @param filter [String]
126
+ # @param filter [::String]
125
127
  # The standard list filter.
126
- # @param page_size [Integer]
128
+ # @param page_size [::Integer]
127
129
  # The standard list page size.
128
- # @param page_token [String]
130
+ # @param page_token [::String]
129
131
  # The standard list page token.
130
132
  #
131
133
  # @yield [response, operation] Access the result along with the RPC operation
132
- # @yieldparam response [Gapic::PagedEnumerable<Gapic::Operation>]
133
- # @yieldparam operation [GRPC::ActiveCall::Operation]
134
+ # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]
135
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
134
136
  #
135
- # @return [Gapic::PagedEnumerable<Gapic::Operation>]
137
+ # @return [::Gapic::PagedEnumerable<::Gapic::Operation>]
136
138
  #
137
- # @raise [Google::Cloud::Error] if the RPC is aborted.
139
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
138
140
  #
139
141
  def list_operations request, options = nil
140
- raise ArgumentError, "request must be provided" if request.nil?
142
+ raise ::ArgumentError, "request must be provided" if request.nil?
141
143
 
142
- request = Gapic::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest
144
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest
143
145
 
144
146
  # Converts hash and nil to an options object
145
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
147
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
146
148
 
147
149
  # Customize the options with defaults
148
150
  metadata = @config.rpcs.list_operations.metadata.to_h
149
151
 
150
152
  # Set x-goog-api-client and x-goog-user-project headers
151
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
153
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
152
154
  lib_name: @config.lib_name, lib_version: @config.lib_version,
153
155
  gapic_version: ::Google::Cloud::Vision::V1::VERSION
154
156
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -166,13 +168,13 @@ module Google
166
168
  retry_policy: @config.retry_policy
167
169
 
168
170
  @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
169
- wrap_lro_operation = ->(op_response) { Gapic::Operation.new op_response, @operations_client }
170
- response = Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
171
+ wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
172
+ response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
171
173
  yield response, operation if block_given?
172
174
  return response
173
175
  end
174
- rescue GRPC::BadStatus => e
175
- raise Google::Cloud::Error.from_error(e)
176
+ rescue ::GRPC::BadStatus => e
177
+ raise ::Google::Cloud::Error.from_error(e)
176
178
  end
177
179
 
178
180
  ##
@@ -182,12 +184,12 @@ module Google
182
184
  #
183
185
  # @overload get_operation(request, options = nil)
184
186
  # Pass arguments to `get_operation` via a request object, either of type
185
- # {Google::Longrunning::GetOperationRequest} or an equivalent Hash.
187
+ # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash.
186
188
  #
187
- # @param request [Google::Longrunning::GetOperationRequest, Hash]
189
+ # @param request [::Google::Longrunning::GetOperationRequest, ::Hash]
188
190
  # A request object representing the call parameters. Required. To specify no
189
191
  # parameters, or to keep all the default parameter values, pass an empty Hash.
190
- # @param options [Gapic::CallOptions, Hash]
192
+ # @param options [::Gapic::CallOptions, ::Hash]
191
193
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
192
194
  #
193
195
  # @overload get_operation(name: nil)
@@ -195,30 +197,30 @@ module Google
195
197
  # least one keyword argument is required. To specify no parameters, or to keep all
196
198
  # the default parameter values, pass an empty Hash as a request object (see above).
197
199
  #
198
- # @param name [String]
200
+ # @param name [::String]
199
201
  # The name of the operation resource.
200
202
  #
201
203
  # @yield [response, operation] Access the result along with the RPC operation
202
- # @yieldparam response [Gapic::Operation]
203
- # @yieldparam operation [GRPC::ActiveCall::Operation]
204
+ # @yieldparam response [::Gapic::Operation]
205
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
204
206
  #
205
- # @return [Gapic::Operation]
207
+ # @return [::Gapic::Operation]
206
208
  #
207
- # @raise [Google::Cloud::Error] if the RPC is aborted.
209
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
208
210
  #
209
211
  def get_operation request, options = nil
210
- raise ArgumentError, "request must be provided" if request.nil?
212
+ raise ::ArgumentError, "request must be provided" if request.nil?
211
213
 
212
- request = Gapic::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest
214
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest
213
215
 
214
216
  # Converts hash and nil to an options object
215
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
217
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
216
218
 
217
219
  # Customize the options with defaults
218
220
  metadata = @config.rpcs.get_operation.metadata.to_h
219
221
 
220
222
  # Set x-goog-api-client and x-goog-user-project headers
221
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
223
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
222
224
  lib_name: @config.lib_name, lib_version: @config.lib_version,
223
225
  gapic_version: ::Google::Cloud::Vision::V1::VERSION
224
226
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -236,12 +238,12 @@ module Google
236
238
  retry_policy: @config.retry_policy
237
239
 
238
240
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
239
- response = Gapic::Operation.new response, @operations_client, options: options
241
+ response = ::Gapic::Operation.new response, @operations_client, options: options
240
242
  yield response, operation if block_given?
241
243
  return response
242
244
  end
243
- rescue GRPC::BadStatus => e
244
- raise Google::Cloud::Error.from_error(e)
245
+ rescue ::GRPC::BadStatus => e
246
+ raise ::Google::Cloud::Error.from_error(e)
245
247
  end
246
248
 
247
249
  ##
@@ -252,12 +254,12 @@ module Google
252
254
  #
253
255
  # @overload delete_operation(request, options = nil)
254
256
  # Pass arguments to `delete_operation` via a request object, either of type
255
- # {Google::Longrunning::DeleteOperationRequest} or an equivalent Hash.
257
+ # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash.
256
258
  #
257
- # @param request [Google::Longrunning::DeleteOperationRequest, Hash]
259
+ # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash]
258
260
  # A request object representing the call parameters. Required. To specify no
259
261
  # parameters, or to keep all the default parameter values, pass an empty Hash.
260
- # @param options [Gapic::CallOptions, Hash]
262
+ # @param options [::Gapic::CallOptions, ::Hash]
261
263
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
262
264
  #
263
265
  # @overload delete_operation(name: nil)
@@ -265,30 +267,30 @@ module Google
265
267
  # least one keyword argument is required. To specify no parameters, or to keep all
266
268
  # the default parameter values, pass an empty Hash as a request object (see above).
267
269
  #
268
- # @param name [String]
270
+ # @param name [::String]
269
271
  # The name of the operation resource to be deleted.
270
272
  #
271
273
  # @yield [response, operation] Access the result along with the RPC operation
272
- # @yieldparam response [Google::Protobuf::Empty]
273
- # @yieldparam operation [GRPC::ActiveCall::Operation]
274
+ # @yieldparam response [::Google::Protobuf::Empty]
275
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
274
276
  #
275
- # @return [Google::Protobuf::Empty]
277
+ # @return [::Google::Protobuf::Empty]
276
278
  #
277
- # @raise [Google::Cloud::Error] if the RPC is aborted.
279
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
278
280
  #
279
281
  def delete_operation request, options = nil
280
- raise ArgumentError, "request must be provided" if request.nil?
282
+ raise ::ArgumentError, "request must be provided" if request.nil?
281
283
 
282
- request = Gapic::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest
284
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest
283
285
 
284
286
  # Converts hash and nil to an options object
285
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
287
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
286
288
 
287
289
  # Customize the options with defaults
288
290
  metadata = @config.rpcs.delete_operation.metadata.to_h
289
291
 
290
292
  # Set x-goog-api-client and x-goog-user-project headers
291
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
293
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
292
294
  lib_name: @config.lib_name, lib_version: @config.lib_version,
293
295
  gapic_version: ::Google::Cloud::Vision::V1::VERSION
294
296
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -309,8 +311,8 @@ module Google
309
311
  yield response, operation if block_given?
310
312
  return response
311
313
  end
312
- rescue GRPC::BadStatus => e
313
- raise Google::Cloud::Error.from_error(e)
314
+ rescue ::GRPC::BadStatus => e
315
+ raise ::Google::Cloud::Error.from_error(e)
314
316
  end
315
317
 
316
318
  ##
@@ -322,17 +324,17 @@ module Google
322
324
  # other methods to check whether the cancellation succeeded or whether the
323
325
  # operation completed despite cancellation. On successful cancellation,
324
326
  # the operation is not deleted; instead, it becomes an operation with
325
- # an {Google::Longrunning::Operation#error Operation.error} value with a {Google::Rpc::Status#code google.rpc.Status.code} of 1,
327
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
326
328
  # corresponding to `Code.CANCELLED`.
327
329
  #
328
330
  # @overload cancel_operation(request, options = nil)
329
331
  # Pass arguments to `cancel_operation` via a request object, either of type
330
- # {Google::Longrunning::CancelOperationRequest} or an equivalent Hash.
332
+ # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash.
331
333
  #
332
- # @param request [Google::Longrunning::CancelOperationRequest, Hash]
334
+ # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash]
333
335
  # A request object representing the call parameters. Required. To specify no
334
336
  # parameters, or to keep all the default parameter values, pass an empty Hash.
335
- # @param options [Gapic::CallOptions, Hash]
337
+ # @param options [::Gapic::CallOptions, ::Hash]
336
338
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
337
339
  #
338
340
  # @overload cancel_operation(name: nil)
@@ -340,30 +342,30 @@ module Google
340
342
  # least one keyword argument is required. To specify no parameters, or to keep all
341
343
  # the default parameter values, pass an empty Hash as a request object (see above).
342
344
  #
343
- # @param name [String]
345
+ # @param name [::String]
344
346
  # The name of the operation resource to be cancelled.
345
347
  #
346
348
  # @yield [response, operation] Access the result along with the RPC operation
347
- # @yieldparam response [Google::Protobuf::Empty]
348
- # @yieldparam operation [GRPC::ActiveCall::Operation]
349
+ # @yieldparam response [::Google::Protobuf::Empty]
350
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
349
351
  #
350
- # @return [Google::Protobuf::Empty]
352
+ # @return [::Google::Protobuf::Empty]
351
353
  #
352
- # @raise [Google::Cloud::Error] if the RPC is aborted.
354
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
353
355
  #
354
356
  def cancel_operation request, options = nil
355
- raise ArgumentError, "request must be provided" if request.nil?
357
+ raise ::ArgumentError, "request must be provided" if request.nil?
356
358
 
357
- request = Gapic::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest
359
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest
358
360
 
359
361
  # Converts hash and nil to an options object
360
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
362
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
361
363
 
362
364
  # Customize the options with defaults
363
365
  metadata = @config.rpcs.cancel_operation.metadata.to_h
364
366
 
365
367
  # Set x-goog-api-client and x-goog-user-project headers
366
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
368
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
367
369
  lib_name: @config.lib_name, lib_version: @config.lib_version,
368
370
  gapic_version: ::Google::Cloud::Vision::V1::VERSION
369
371
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -384,8 +386,8 @@ module Google
384
386
  yield response, operation if block_given?
385
387
  return response
386
388
  end
387
- rescue GRPC::BadStatus => e
388
- raise Google::Cloud::Error.from_error(e)
389
+ rescue ::GRPC::BadStatus => e
390
+ raise ::Google::Cloud::Error.from_error(e)
389
391
  end
390
392
 
391
393
  ##
@@ -395,7 +397,7 @@ module Google
395
397
  # providing control over timeouts, retry behavior, logging, transport
396
398
  # parameters, and other low-level controls. Certain parameters can also be
397
399
  # applied individually to specific RPCs. See
398
- # {Google::Longrunning::Operations::Client::Configuration::Rpcs}
400
+ # {::Google::Longrunning::Operations::Client::Configuration::Rpcs}
399
401
  # for a list of RPCs that can be configured independently.
400
402
  #
401
403
  # Configuration can be applied globally to all clients, or to a single client
@@ -406,22 +408,22 @@ module Google
406
408
  # To modify the global config, setting the timeout for list_operations
407
409
  # to 20 seconds, and all remaining timeouts to 10 seconds:
408
410
  #
409
- # Google::Longrunning::Operations::Client.configure do |config|
410
- # config.timeout = 10_000
411
- # config.rpcs.list_operations.timeout = 20_000
411
+ # ::Google::Longrunning::Operations::Client.configure do |config|
412
+ # config.timeout = 10.0
413
+ # config.rpcs.list_operations.timeout = 20.0
412
414
  # end
413
415
  #
414
416
  # To apply the above configuration only to a new client:
415
417
  #
416
- # client = Google::Longrunning::Operations::Client.new do |config|
417
- # config.timeout = 10_000
418
- # config.rpcs.list_operations.timeout = 20_000
418
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
419
+ # config.timeout = 10.0
420
+ # config.rpcs.list_operations.timeout = 20.0
419
421
  # end
420
422
  #
421
423
  # @!attribute [rw] endpoint
422
424
  # The hostname or hostname:port of the service endpoint.
423
425
  # Defaults to `"vision.googleapis.com"`.
424
- # @return [String]
426
+ # @return [::String]
425
427
  # @!attribute [rw] credentials
426
428
  # Credentials to send with calls. You may provide any of the following types:
427
429
  # * (`String`) The path to a service account key file in JSON format
@@ -433,29 +435,29 @@ module Google
433
435
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
434
436
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
435
437
  # * (`nil`) indicating no credentials
436
- # @return [Object]
438
+ # @return [::Object]
437
439
  # @!attribute [rw] scope
438
440
  # The OAuth scopes
439
- # @return [Array<String>]
441
+ # @return [::Array<::String>]
440
442
  # @!attribute [rw] lib_name
441
443
  # The library name as recorded in instrumentation and logging
442
- # @return [String]
444
+ # @return [::String]
443
445
  # @!attribute [rw] lib_version
444
446
  # The library version as recorded in instrumentation and logging
445
- # @return [String]
447
+ # @return [::String]
446
448
  # @!attribute [rw] channel_args
447
449
  # Extra parameters passed to the gRPC channel. Note: this is ignored if a
448
450
  # `GRPC::Core::Channel` object is provided as the credential.
449
- # @return [Hash]
451
+ # @return [::Hash]
450
452
  # @!attribute [rw] interceptors
451
453
  # An array of interceptors that are run before calls are executed.
452
- # @return [Array<GRPC::ClientInterceptor>]
454
+ # @return [::Array<::GRPC::ClientInterceptor>]
453
455
  # @!attribute [rw] timeout
454
- # The call timeout in milliseconds.
455
- # @return [Numeric]
456
+ # The call timeout in seconds.
457
+ # @return [::Numeric]
456
458
  # @!attribute [rw] metadata
457
459
  # Additional gRPC headers to be sent with the call.
458
- # @return [Hash{Symbol=>String}]
460
+ # @return [::Hash{::Symbol=>::String}]
459
461
  # @!attribute [rw] retry_policy
460
462
  # The retry policy. The value is a hash with the following keys:
461
463
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
@@ -463,25 +465,29 @@ module Google
463
465
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
464
466
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
465
467
  # trigger a retry.
466
- # @return [Hash]
468
+ # @return [::Hash]
469
+ # @!attribute [rw] quota_project
470
+ # A separate project against which to charge quota.
471
+ # @return [::String]
467
472
  #
468
473
  class Configuration
469
- extend Gapic::Config
474
+ extend ::Gapic::Config
470
475
 
471
- config_attr :endpoint, "vision.googleapis.com", String
472
- config_attr :credentials, nil do |value|
476
+ config_attr :endpoint, "vision.googleapis.com", ::String
477
+ config_attr :credentials, nil do |value|
473
478
  allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
474
479
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
475
480
  allowed.any? { |klass| klass === value }
476
481
  end
477
- config_attr :scope, nil, String, Array, nil
478
- config_attr :lib_name, nil, String, nil
479
- config_attr :lib_version, nil, String, nil
480
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
481
- config_attr :interceptors, nil, Array, nil
482
- config_attr :timeout, nil, Numeric, nil
483
- config_attr :metadata, nil, Hash, nil
484
- config_attr :retry_policy, nil, Hash, Proc, nil
482
+ config_attr :scope, nil, ::String, ::Array, nil
483
+ config_attr :lib_name, nil, ::String, nil
484
+ config_attr :lib_version, nil, ::String, nil
485
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
486
+ config_attr :interceptors, nil, ::Array, nil
487
+ config_attr :timeout, nil, ::Numeric, nil
488
+ config_attr :metadata, nil, ::Hash, nil
489
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
490
+ config_attr :quota_project, nil, ::String, nil
485
491
 
486
492
  # @private
487
493
  def initialize parent_config = nil
@@ -497,7 +503,7 @@ module Google
497
503
  def rpcs
498
504
  @rpcs ||= begin
499
505
  parent_rpcs = nil
500
- parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
506
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
501
507
  Rpcs.new parent_rpcs
502
508
  end
503
509
  end
@@ -522,35 +528,35 @@ module Google
522
528
  class Rpcs
523
529
  ##
524
530
  # RPC-specific configuration for `list_operations`
525
- # @return [Gapic::Config::Method]
531
+ # @return [::Gapic::Config::Method]
526
532
  #
527
533
  attr_reader :list_operations
528
534
  ##
529
535
  # RPC-specific configuration for `get_operation`
530
- # @return [Gapic::Config::Method]
536
+ # @return [::Gapic::Config::Method]
531
537
  #
532
538
  attr_reader :get_operation
533
539
  ##
534
540
  # RPC-specific configuration for `delete_operation`
535
- # @return [Gapic::Config::Method]
541
+ # @return [::Gapic::Config::Method]
536
542
  #
537
543
  attr_reader :delete_operation
538
544
  ##
539
545
  # RPC-specific configuration for `cancel_operation`
540
- # @return [Gapic::Config::Method]
546
+ # @return [::Gapic::Config::Method]
541
547
  #
542
548
  attr_reader :cancel_operation
543
549
 
544
550
  # @private
545
551
  def initialize parent_rpcs = nil
546
552
  list_operations_config = parent_rpcs&.list_operations if parent_rpcs&.respond_to? :list_operations
547
- @list_operations = Gapic::Config::Method.new list_operations_config
553
+ @list_operations = ::Gapic::Config::Method.new list_operations_config
548
554
  get_operation_config = parent_rpcs&.get_operation if parent_rpcs&.respond_to? :get_operation
549
- @get_operation = Gapic::Config::Method.new get_operation_config
555
+ @get_operation = ::Gapic::Config::Method.new get_operation_config
550
556
  delete_operation_config = parent_rpcs&.delete_operation if parent_rpcs&.respond_to? :delete_operation
551
- @delete_operation = Gapic::Config::Method.new delete_operation_config
557
+ @delete_operation = ::Gapic::Config::Method.new delete_operation_config
552
558
  cancel_operation_config = parent_rpcs&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
553
- @cancel_operation = Gapic::Config::Method.new cancel_operation_config
559
+ @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
554
560
 
555
561
  yield self if block_given?
556
562
  end