google-cloud-vision-v1p3beta1 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +6 -6
- data/README.md +1 -1
- data/lib/google/cloud/vision/v1p3beta1.rb +1 -1
- data/lib/google/cloud/vision/v1p3beta1/image_annotator.rb +1 -1
- data/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb +70 -70
- data/lib/google/cloud/vision/v1p3beta1/image_annotator/credentials.rb +1 -1
- data/lib/google/cloud/vision/v1p3beta1/image_annotator/operations.rb +100 -100
- data/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.rb +3 -3
- data/lib/google/cloud/vision/v1p3beta1/product_search.rb +4 -4
- data/lib/google/cloud/vision/v1p3beta1/product_search/client.rb +356 -356
- data/lib/google/cloud/vision/v1p3beta1/product_search/credentials.rb +1 -1
- data/lib/google/cloud/vision/v1p3beta1/product_search/operations.rb +100 -100
- data/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb +12 -12
- data/lib/google/cloud/vision/v1p3beta1/version.rb +1 -1
- data/proto_docs/google/api/resource.rb +12 -12
- data/proto_docs/google/cloud/vision/v1p3beta1/geometry.rb +20 -20
- data/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb +172 -172
- data/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb +29 -29
- data/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb +133 -133
- data/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb +49 -49
- data/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb +28 -28
- data/proto_docs/google/longrunning/operations.rb +30 -30
- data/proto_docs/google/protobuf/any.rb +4 -4
- data/proto_docs/google/protobuf/empty.rb +2 -2
- data/proto_docs/google/protobuf/field_mask.rb +3 -3
- data/proto_docs/google/protobuf/timestamp.rb +4 -4
- data/proto_docs/google/protobuf/wrappers.rb +27 -27
- data/proto_docs/google/rpc/status.rb +6 -6
- data/proto_docs/google/type/color.rb +6 -6
- data/proto_docs/google/type/latlng.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 563825b9d08929290391d73cd24ad8bab61f0546c3b723e4ff628004ca31052a
|
4
|
+
data.tar.gz: 02e91fde9b936d89e235e2603c2d855cba67638484b2ea05fd6543baf9387584
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baee099bb4be37e6f8956c9a422bc2704c4dbaf826c4394e70447f4d3f264e8ddd9ea0b687b3c2d661a76f61a70a491f7c96b7b5f4c7277dee72494a35ecc983
|
7
|
+
data.tar.gz: ea7548ea41c32603fbbcbdcb5fbf149c7cc9c5cc9e21101d5170c8bc97c4ee0648a6008ce1cf1081a6820ca4c6a1f3f51b11819b677b3bee174c6aa9923c17ca
|
data/AUTHENTICATION.md
CHANGED
@@ -27,7 +27,7 @@ export VISION_CREDENTIALS=path/to/keyfile.json
|
|
27
27
|
```ruby
|
28
28
|
require "google/cloud/vision/v1p3beta1"
|
29
29
|
|
30
|
-
client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
|
30
|
+
client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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-vision-v1p3beta1
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
{Google::Cloud::Vision::V1p3beta1::ProductSearch::Credentials}):
|
67
|
+
{::Google::Cloud::Vision::V1p3beta1::ProductSearch::Credentials}):
|
68
68
|
|
69
69
|
1. `VISION_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
70
|
2. `VISION_KEYFILE` - Path to JSON file, or JSON contents
|
@@ -77,7 +77,7 @@ require "google/cloud/vision/v1p3beta1"
|
|
77
77
|
|
78
78
|
ENV["VISION_CREDENTIALS"] = "path/to/keyfile.json"
|
79
79
|
|
80
|
-
client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
|
80
|
+
client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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/vision/v1p3beta1"
|
90
90
|
|
91
|
-
client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config|
|
91
|
+
client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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/vision/v1p3beta1"
|
100
100
|
|
101
|
-
Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.configure do |config|
|
101
|
+
::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.configure do |config|
|
102
102
|
config.credentials = "path/to/keyfile.json"
|
103
103
|
end
|
104
104
|
|
105
|
-
client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
|
105
|
+
client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
|
106
106
|
```
|
107
107
|
|
108
108
|
### Cloud SDK
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ In order to use this library, you first need to go through the following steps:
|
|
25
25
|
```ruby
|
26
26
|
require "google/cloud/vision/v1p3beta1"
|
27
27
|
|
28
|
-
client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
|
28
|
+
client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
|
29
29
|
request = my_create_request
|
30
30
|
response = client.create_product_set request
|
31
31
|
```
|
@@ -27,7 +27,7 @@ module Google
|
|
27
27
|
# To load this package, including all its services, and instantiate a client:
|
28
28
|
#
|
29
29
|
# require "google/cloud/vision/v1p3beta1"
|
30
|
-
# client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
|
30
|
+
# client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
|
31
31
|
#
|
32
32
|
module V1p3beta1
|
33
33
|
end
|
@@ -39,7 +39,7 @@ module Google
|
|
39
39
|
# To load this service and instantiate a client:
|
40
40
|
#
|
41
41
|
# require "google/cloud/vision/v1p3beta1/image_annotator"
|
42
|
-
# client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new
|
42
|
+
# client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new
|
43
43
|
#
|
44
44
|
module ImageAnnotator
|
45
45
|
end
|
@@ -40,15 +40,15 @@ module Google
|
|
40
40
|
##
|
41
41
|
# Configure the ImageAnnotator Client class.
|
42
42
|
#
|
43
|
-
# See {Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client::Configuration}
|
43
|
+
# See {::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client::Configuration}
|
44
44
|
# for a description of the configuration fields.
|
45
45
|
#
|
46
46
|
# ## Example
|
47
47
|
#
|
48
48
|
# To modify the configuration for all ImageAnnotator clients:
|
49
49
|
#
|
50
|
-
# Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.configure do |config|
|
51
|
-
# config.timeout =
|
50
|
+
# ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.configure do |config|
|
51
|
+
# config.timeout = 10.0
|
52
52
|
# end
|
53
53
|
#
|
54
54
|
# @yield [config] Configure the Client client.
|
@@ -96,7 +96,7 @@ module Google
|
|
96
96
|
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
97
97
|
# should be made on {Client.configure}.
|
98
98
|
#
|
99
|
-
# See {Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client::Configuration}
|
99
|
+
# See {::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client::Configuration}
|
100
100
|
# for a description of the configuration fields.
|
101
101
|
#
|
102
102
|
# @yield [config] Configure the Client client.
|
@@ -117,13 +117,13 @@ module Google
|
|
117
117
|
# To create a new ImageAnnotator client with the default
|
118
118
|
# configuration:
|
119
119
|
#
|
120
|
-
# client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new
|
120
|
+
# client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new
|
121
121
|
#
|
122
122
|
# To create a new ImageAnnotator client with a custom
|
123
123
|
# configuration:
|
124
124
|
#
|
125
|
-
# client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config|
|
126
|
-
# config.timeout =
|
125
|
+
# client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config|
|
126
|
+
# config.timeout = 10.0
|
127
127
|
# end
|
128
128
|
#
|
129
129
|
# @yield [config] Configure the ImageAnnotator client.
|
@@ -155,8 +155,8 @@ module Google
|
|
155
155
|
config.endpoint = @config.endpoint
|
156
156
|
end
|
157
157
|
|
158
|
-
@image_annotator_stub = Gapic::ServiceStub.new(
|
159
|
-
Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Stub,
|
158
|
+
@image_annotator_stub = ::Gapic::ServiceStub.new(
|
159
|
+
::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Stub,
|
160
160
|
credentials: credentials,
|
161
161
|
endpoint: @config.endpoint,
|
162
162
|
channel_args: @config.channel_args,
|
@@ -167,7 +167,7 @@ module Google
|
|
167
167
|
##
|
168
168
|
# Get the associated client for long-running operations.
|
169
169
|
#
|
170
|
-
# @return [Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Operations]
|
170
|
+
# @return [::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Operations]
|
171
171
|
#
|
172
172
|
attr_reader :operations_client
|
173
173
|
|
@@ -178,12 +178,12 @@ module Google
|
|
178
178
|
#
|
179
179
|
# @overload batch_annotate_images(request, options = nil)
|
180
180
|
# Pass arguments to `batch_annotate_images` via a request object, either of type
|
181
|
-
# {Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest} or an equivalent Hash.
|
181
|
+
# {::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest} or an equivalent Hash.
|
182
182
|
#
|
183
|
-
# @param request [Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, Hash]
|
183
|
+
# @param request [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, ::Hash]
|
184
184
|
# A request object representing the call parameters. Required. To specify no
|
185
185
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
186
|
-
# @param options [Gapic::CallOptions, Hash]
|
186
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
187
187
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
188
188
|
#
|
189
189
|
# @overload batch_annotate_images(requests: nil)
|
@@ -191,30 +191,30 @@ module Google
|
|
191
191
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
192
192
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
193
193
|
#
|
194
|
-
# @param requests [Array
|
194
|
+
# @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest, ::Hash>]
|
195
195
|
# Individual image annotation requests for this batch.
|
196
196
|
#
|
197
197
|
# @yield [response, operation] Access the result along with the RPC operation
|
198
|
-
# @yieldparam response [Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse]
|
199
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
198
|
+
# @yieldparam response [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse]
|
199
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
200
200
|
#
|
201
|
-
# @return [Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse]
|
201
|
+
# @return [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse]
|
202
202
|
#
|
203
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
203
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
204
204
|
#
|
205
205
|
def batch_annotate_images request, options = nil
|
206
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
206
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
207
207
|
|
208
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest
|
208
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest
|
209
209
|
|
210
210
|
# Converts hash and nil to an options object
|
211
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
211
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
212
212
|
|
213
213
|
# Customize the options with defaults
|
214
214
|
metadata = @config.rpcs.batch_annotate_images.metadata.to_h
|
215
215
|
|
216
216
|
# Set x-goog-api-client and x-goog-user-project headers
|
217
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
217
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
218
218
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
219
219
|
gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
|
220
220
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -229,8 +229,8 @@ module Google
|
|
229
229
|
yield response, operation if block_given?
|
230
230
|
return response
|
231
231
|
end
|
232
|
-
rescue GRPC::BadStatus => e
|
233
|
-
raise Google::Cloud::Error.from_error(e)
|
232
|
+
rescue ::GRPC::BadStatus => e
|
233
|
+
raise ::Google::Cloud::Error.from_error(e)
|
234
234
|
end
|
235
235
|
|
236
236
|
##
|
@@ -243,12 +243,12 @@ module Google
|
|
243
243
|
#
|
244
244
|
# @overload async_batch_annotate_files(request, options = nil)
|
245
245
|
# Pass arguments to `async_batch_annotate_files` via a request object, either of type
|
246
|
-
# {Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash.
|
246
|
+
# {::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash.
|
247
247
|
#
|
248
|
-
# @param request [Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, Hash]
|
248
|
+
# @param request [::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, ::Hash]
|
249
249
|
# A request object representing the call parameters. Required. To specify no
|
250
250
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
251
|
-
# @param options [Gapic::CallOptions, Hash]
|
251
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
252
252
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
253
253
|
#
|
254
254
|
# @overload async_batch_annotate_files(requests: nil)
|
@@ -256,30 +256,30 @@ module Google
|
|
256
256
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
257
257
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
258
258
|
#
|
259
|
-
# @param requests [Array
|
259
|
+
# @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest, ::Hash>]
|
260
260
|
# Required. Individual async file annotation requests for this batch.
|
261
261
|
#
|
262
262
|
# @yield [response, operation] Access the result along with the RPC operation
|
263
|
-
# @yieldparam response [Gapic::Operation]
|
264
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
263
|
+
# @yieldparam response [::Gapic::Operation]
|
264
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
265
265
|
#
|
266
|
-
# @return [Gapic::Operation]
|
266
|
+
# @return [::Gapic::Operation]
|
267
267
|
#
|
268
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
268
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
269
269
|
#
|
270
270
|
def async_batch_annotate_files request, options = nil
|
271
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
271
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
272
272
|
|
273
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest
|
273
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest
|
274
274
|
|
275
275
|
# Converts hash and nil to an options object
|
276
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
276
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
277
277
|
|
278
278
|
# Customize the options with defaults
|
279
279
|
metadata = @config.rpcs.async_batch_annotate_files.metadata.to_h
|
280
280
|
|
281
281
|
# Set x-goog-api-client and x-goog-user-project headers
|
282
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
282
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
283
283
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
284
284
|
gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
|
285
285
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -291,12 +291,12 @@ module Google
|
|
291
291
|
retry_policy: @config.retry_policy
|
292
292
|
|
293
293
|
@image_annotator_stub.call_rpc :async_batch_annotate_files, request, options: options do |response, operation|
|
294
|
-
response = Gapic::Operation.new response, @operations_client, options: options
|
294
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
295
295
|
yield response, operation if block_given?
|
296
296
|
return response
|
297
297
|
end
|
298
|
-
rescue GRPC::BadStatus => e
|
299
|
-
raise Google::Cloud::Error.from_error(e)
|
298
|
+
rescue ::GRPC::BadStatus => e
|
299
|
+
raise ::Google::Cloud::Error.from_error(e)
|
300
300
|
end
|
301
301
|
|
302
302
|
##
|
@@ -306,7 +306,7 @@ module Google
|
|
306
306
|
# providing control over timeouts, retry behavior, logging, transport
|
307
307
|
# parameters, and other low-level controls. Certain parameters can also be
|
308
308
|
# applied individually to specific RPCs. See
|
309
|
-
# {Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client::Configuration::Rpcs}
|
309
|
+
# {::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client::Configuration::Rpcs}
|
310
310
|
# for a list of RPCs that can be configured independently.
|
311
311
|
#
|
312
312
|
# Configuration can be applied globally to all clients, or to a single client
|
@@ -317,22 +317,22 @@ module Google
|
|
317
317
|
# To modify the global config, setting the timeout for batch_annotate_images
|
318
318
|
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
319
319
|
#
|
320
|
-
# Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.configure do |config|
|
321
|
-
# config.timeout =
|
322
|
-
# config.rpcs.batch_annotate_images.timeout =
|
320
|
+
# ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.configure do |config|
|
321
|
+
# config.timeout = 10.0
|
322
|
+
# config.rpcs.batch_annotate_images.timeout = 20.0
|
323
323
|
# end
|
324
324
|
#
|
325
325
|
# To apply the above configuration only to a new client:
|
326
326
|
#
|
327
|
-
# client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config|
|
328
|
-
# config.timeout =
|
329
|
-
# config.rpcs.batch_annotate_images.timeout =
|
327
|
+
# client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config|
|
328
|
+
# config.timeout = 10.0
|
329
|
+
# config.rpcs.batch_annotate_images.timeout = 20.0
|
330
330
|
# end
|
331
331
|
#
|
332
332
|
# @!attribute [rw] endpoint
|
333
333
|
# The hostname or hostname:port of the service endpoint.
|
334
334
|
# Defaults to `"vision.googleapis.com"`.
|
335
|
-
# @return [String]
|
335
|
+
# @return [::String]
|
336
336
|
# @!attribute [rw] credentials
|
337
337
|
# Credentials to send with calls. You may provide any of the following types:
|
338
338
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -344,29 +344,29 @@ module Google
|
|
344
344
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
345
345
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
346
346
|
# * (`nil`) indicating no credentials
|
347
|
-
# @return [Object]
|
347
|
+
# @return [::Object]
|
348
348
|
# @!attribute [rw] scope
|
349
349
|
# The OAuth scopes
|
350
|
-
# @return [Array
|
350
|
+
# @return [::Array<::String>]
|
351
351
|
# @!attribute [rw] lib_name
|
352
352
|
# The library name as recorded in instrumentation and logging
|
353
|
-
# @return [String]
|
353
|
+
# @return [::String]
|
354
354
|
# @!attribute [rw] lib_version
|
355
355
|
# The library version as recorded in instrumentation and logging
|
356
|
-
# @return [String]
|
356
|
+
# @return [::String]
|
357
357
|
# @!attribute [rw] channel_args
|
358
358
|
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
359
359
|
# `GRPC::Core::Channel` object is provided as the credential.
|
360
|
-
# @return [Hash]
|
360
|
+
# @return [::Hash]
|
361
361
|
# @!attribute [rw] interceptors
|
362
362
|
# An array of interceptors that are run before calls are executed.
|
363
|
-
# @return [Array
|
363
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
364
364
|
# @!attribute [rw] timeout
|
365
|
-
# The call timeout in
|
366
|
-
# @return [Numeric]
|
365
|
+
# The call timeout in seconds.
|
366
|
+
# @return [::Numeric]
|
367
367
|
# @!attribute [rw] metadata
|
368
368
|
# Additional gRPC headers to be sent with the call.
|
369
|
-
# @return [Hash{Symbol
|
369
|
+
# @return [::Hash{::Symbol=>::String}]
|
370
370
|
# @!attribute [rw] retry_policy
|
371
371
|
# The retry policy. The value is a hash with the following keys:
|
372
372
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
@@ -374,10 +374,10 @@ module Google
|
|
374
374
|
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
375
375
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
376
376
|
# trigger a retry.
|
377
|
-
# @return [Hash]
|
377
|
+
# @return [::Hash]
|
378
378
|
#
|
379
379
|
class Configuration
|
380
|
-
extend Gapic::Config
|
380
|
+
extend ::Gapic::Config
|
381
381
|
|
382
382
|
config_attr :endpoint, "vision.googleapis.com", String
|
383
383
|
config_attr :credentials, nil do |value|
|
@@ -385,14 +385,14 @@ module Google
|
|
385
385
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
386
386
|
allowed.any? { |klass| klass === value }
|
387
387
|
end
|
388
|
-
config_attr :scope, nil, String, Array, nil
|
389
|
-
config_attr :lib_name, nil, String, nil
|
390
|
-
config_attr :lib_version, nil, String, nil
|
391
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
|
392
|
-
config_attr :interceptors, nil, Array, nil
|
393
|
-
config_attr :timeout, nil, Numeric, nil
|
394
|
-
config_attr :metadata, nil, Hash, nil
|
395
|
-
config_attr :retry_policy, nil, Hash, Proc, nil
|
388
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
389
|
+
config_attr :lib_name, nil, ::String, nil
|
390
|
+
config_attr :lib_version, nil, ::String, nil
|
391
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
392
|
+
config_attr :interceptors, nil, ::Array, nil
|
393
|
+
config_attr :timeout, nil, ::Numeric, nil
|
394
|
+
config_attr :metadata, nil, ::Hash, nil
|
395
|
+
config_attr :retry_policy, nil, ::Hash, Proc, nil
|
396
396
|
|
397
397
|
# @private
|
398
398
|
def initialize parent_config = nil
|
@@ -433,21 +433,21 @@ module Google
|
|
433
433
|
class Rpcs
|
434
434
|
##
|
435
435
|
# RPC-specific configuration for `batch_annotate_images`
|
436
|
-
# @return [Gapic::Config::Method]
|
436
|
+
# @return [::Gapic::Config::Method]
|
437
437
|
#
|
438
438
|
attr_reader :batch_annotate_images
|
439
439
|
##
|
440
440
|
# RPC-specific configuration for `async_batch_annotate_files`
|
441
|
-
# @return [Gapic::Config::Method]
|
441
|
+
# @return [::Gapic::Config::Method]
|
442
442
|
#
|
443
443
|
attr_reader :async_batch_annotate_files
|
444
444
|
|
445
445
|
# @private
|
446
446
|
def initialize parent_rpcs = nil
|
447
447
|
batch_annotate_images_config = parent_rpcs&.batch_annotate_images if parent_rpcs&.respond_to? :batch_annotate_images
|
448
|
-
@batch_annotate_images = Gapic::Config::Method.new batch_annotate_images_config
|
448
|
+
@batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
|
449
449
|
async_batch_annotate_files_config = parent_rpcs&.async_batch_annotate_files if parent_rpcs&.respond_to? :async_batch_annotate_files
|
450
|
-
@async_batch_annotate_files = Gapic::Config::Method.new async_batch_annotate_files_config
|
450
|
+
@async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config
|
451
451
|
|
452
452
|
yield self if block_given?
|
453
453
|
end
|
@@ -24,7 +24,7 @@ module Google
|
|
24
24
|
module V1p3beta1
|
25
25
|
module ImageAnnotator
|
26
26
|
# Credentials for the ImageAnnotator 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"
|
@@ -86,8 +86,8 @@ module Google
|
|
86
86
|
credentials = Credentials.new credentials, scope: @config.scope
|
87
87
|
end
|
88
88
|
|
89
|
-
@operations_stub = Gapic::ServiceStub.new(
|
90
|
-
Google::Longrunning::Operations::Stub,
|
89
|
+
@operations_stub = ::Gapic::ServiceStub.new(
|
90
|
+
::Google::Longrunning::Operations::Stub,
|
91
91
|
credentials: credentials,
|
92
92
|
endpoint: @config.endpoint,
|
93
93
|
channel_args: @config.channel_args,
|
@@ -106,12 +106,12 @@ module Google
|
|
106
106
|
#
|
107
107
|
# @overload list_operations(request, options = nil)
|
108
108
|
# Pass arguments to `list_operations` via a request object, either of type
|
109
|
-
# {Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
109
|
+
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
110
110
|
#
|
111
|
-
# @param request [Google::Longrunning::ListOperationsRequest, Hash]
|
111
|
+
# @param request [::Google::Longrunning::ListOperationsRequest, ::Hash]
|
112
112
|
# A request object representing the call parameters. Required. To specify no
|
113
113
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
114
|
-
# @param options [Gapic::CallOptions, Hash]
|
114
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
115
115
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
116
116
|
#
|
117
117
|
# @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
|
@@ -119,36 +119,36 @@ module Google
|
|
119
119
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
120
120
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
121
121
|
#
|
122
|
-
# @param name [String]
|
122
|
+
# @param name [::String]
|
123
123
|
# The name of the operation collection.
|
124
|
-
# @param filter [String]
|
124
|
+
# @param filter [::String]
|
125
125
|
# The standard list filter.
|
126
|
-
# @param page_size [Integer]
|
126
|
+
# @param page_size [::Integer]
|
127
127
|
# The standard list page size.
|
128
|
-
# @param page_token [String]
|
128
|
+
# @param page_token [::String]
|
129
129
|
# The standard list page token.
|
130
130
|
#
|
131
131
|
# @yield [response, operation] Access the result along with the RPC operation
|
132
|
-
# @yieldparam response [Gapic::PagedEnumerable
|
133
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
132
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]
|
133
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
134
134
|
#
|
135
|
-
# @return [Gapic::PagedEnumerable
|
135
|
+
# @return [::Gapic::PagedEnumerable<::Gapic::Operation>]
|
136
136
|
#
|
137
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
137
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
138
138
|
#
|
139
139
|
def list_operations request, options = nil
|
140
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
140
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
141
141
|
|
142
|
-
request = Gapic::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest
|
142
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest
|
143
143
|
|
144
144
|
# Converts hash and nil to an options object
|
145
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
145
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
146
146
|
|
147
147
|
# Customize the options with defaults
|
148
148
|
metadata = @config.rpcs.list_operations.metadata.to_h
|
149
149
|
|
150
150
|
# Set x-goog-api-client and x-goog-user-project headers
|
151
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
151
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
152
152
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
153
153
|
gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
|
154
154
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -166,13 +166,13 @@ module Google
|
|
166
166
|
retry_policy: @config.retry_policy
|
167
167
|
|
168
168
|
@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
|
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
171
|
yield response, operation if block_given?
|
172
172
|
return response
|
173
173
|
end
|
174
|
-
rescue GRPC::BadStatus => e
|
175
|
-
raise Google::Cloud::Error.from_error(e)
|
174
|
+
rescue ::GRPC::BadStatus => e
|
175
|
+
raise ::Google::Cloud::Error.from_error(e)
|
176
176
|
end
|
177
177
|
|
178
178
|
##
|
@@ -182,12 +182,12 @@ module Google
|
|
182
182
|
#
|
183
183
|
# @overload get_operation(request, options = nil)
|
184
184
|
# Pass arguments to `get_operation` via a request object, either of type
|
185
|
-
# {Google::Longrunning::GetOperationRequest} or an equivalent Hash.
|
185
|
+
# {::Google::Longrunning::GetOperationRequest} or an equivalent Hash.
|
186
186
|
#
|
187
|
-
# @param request [Google::Longrunning::GetOperationRequest, Hash]
|
187
|
+
# @param request [::Google::Longrunning::GetOperationRequest, ::Hash]
|
188
188
|
# A request object representing the call parameters. Required. To specify no
|
189
189
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
190
|
-
# @param options [Gapic::CallOptions, Hash]
|
190
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
191
191
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
192
192
|
#
|
193
193
|
# @overload get_operation(name: nil)
|
@@ -195,30 +195,30 @@ module Google
|
|
195
195
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
196
196
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
197
197
|
#
|
198
|
-
# @param name [String]
|
198
|
+
# @param name [::String]
|
199
199
|
# The name of the operation resource.
|
200
200
|
#
|
201
201
|
# @yield [response, operation] Access the result along with the RPC operation
|
202
|
-
# @yieldparam response [Gapic::Operation]
|
203
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
202
|
+
# @yieldparam response [::Gapic::Operation]
|
203
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
204
204
|
#
|
205
|
-
# @return [Gapic::Operation]
|
205
|
+
# @return [::Gapic::Operation]
|
206
206
|
#
|
207
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
207
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
208
208
|
#
|
209
209
|
def get_operation request, options = nil
|
210
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
210
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
211
211
|
|
212
|
-
request = Gapic::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest
|
212
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest
|
213
213
|
|
214
214
|
# Converts hash and nil to an options object
|
215
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
215
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
216
216
|
|
217
217
|
# Customize the options with defaults
|
218
218
|
metadata = @config.rpcs.get_operation.metadata.to_h
|
219
219
|
|
220
220
|
# Set x-goog-api-client and x-goog-user-project headers
|
221
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
221
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
222
222
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
223
223
|
gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
|
224
224
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -236,12 +236,12 @@ module Google
|
|
236
236
|
retry_policy: @config.retry_policy
|
237
237
|
|
238
238
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
239
|
-
response = Gapic::Operation.new response, @operations_client, options: options
|
239
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
240
240
|
yield response, operation if block_given?
|
241
241
|
return response
|
242
242
|
end
|
243
|
-
rescue GRPC::BadStatus => e
|
244
|
-
raise Google::Cloud::Error.from_error(e)
|
243
|
+
rescue ::GRPC::BadStatus => e
|
244
|
+
raise ::Google::Cloud::Error.from_error(e)
|
245
245
|
end
|
246
246
|
|
247
247
|
##
|
@@ -252,12 +252,12 @@ module Google
|
|
252
252
|
#
|
253
253
|
# @overload delete_operation(request, options = nil)
|
254
254
|
# Pass arguments to `delete_operation` via a request object, either of type
|
255
|
-
# {Google::Longrunning::DeleteOperationRequest} or an equivalent Hash.
|
255
|
+
# {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash.
|
256
256
|
#
|
257
|
-
# @param request [Google::Longrunning::DeleteOperationRequest, Hash]
|
257
|
+
# @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash]
|
258
258
|
# A request object representing the call parameters. Required. To specify no
|
259
259
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
260
|
-
# @param options [Gapic::CallOptions, Hash]
|
260
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
261
261
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
262
262
|
#
|
263
263
|
# @overload delete_operation(name: nil)
|
@@ -265,30 +265,30 @@ module Google
|
|
265
265
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
266
266
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
267
267
|
#
|
268
|
-
# @param name [String]
|
268
|
+
# @param name [::String]
|
269
269
|
# The name of the operation resource to be deleted.
|
270
270
|
#
|
271
271
|
# @yield [response, operation] Access the result along with the RPC operation
|
272
|
-
# @yieldparam response [Google::Protobuf::Empty]
|
273
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
272
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
273
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
274
274
|
#
|
275
|
-
# @return [Google::Protobuf::Empty]
|
275
|
+
# @return [::Google::Protobuf::Empty]
|
276
276
|
#
|
277
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
277
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
278
278
|
#
|
279
279
|
def delete_operation request, options = nil
|
280
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
280
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
281
281
|
|
282
|
-
request = Gapic::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest
|
282
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest
|
283
283
|
|
284
284
|
# Converts hash and nil to an options object
|
285
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
285
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
286
286
|
|
287
287
|
# Customize the options with defaults
|
288
288
|
metadata = @config.rpcs.delete_operation.metadata.to_h
|
289
289
|
|
290
290
|
# Set x-goog-api-client and x-goog-user-project headers
|
291
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
291
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
292
292
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
293
293
|
gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
|
294
294
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -309,8 +309,8 @@ module Google
|
|
309
309
|
yield response, operation if block_given?
|
310
310
|
return response
|
311
311
|
end
|
312
|
-
rescue GRPC::BadStatus => e
|
313
|
-
raise Google::Cloud::Error.from_error(e)
|
312
|
+
rescue ::GRPC::BadStatus => e
|
313
|
+
raise ::Google::Cloud::Error.from_error(e)
|
314
314
|
end
|
315
315
|
|
316
316
|
##
|
@@ -322,17 +322,17 @@ module Google
|
|
322
322
|
# other methods to check whether the cancellation succeeded or whether the
|
323
323
|
# operation completed despite cancellation. On successful cancellation,
|
324
324
|
# 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,
|
325
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
|
326
326
|
# corresponding to `Code.CANCELLED`.
|
327
327
|
#
|
328
328
|
# @overload cancel_operation(request, options = nil)
|
329
329
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
330
|
-
# {Google::Longrunning::CancelOperationRequest} or an equivalent Hash.
|
330
|
+
# {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash.
|
331
331
|
#
|
332
|
-
# @param request [Google::Longrunning::CancelOperationRequest, Hash]
|
332
|
+
# @param request [::Google::Longrunning::CancelOperationRequest, ::Hash]
|
333
333
|
# A request object representing the call parameters. Required. To specify no
|
334
334
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
335
|
-
# @param options [Gapic::CallOptions, Hash]
|
335
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
336
336
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
337
337
|
#
|
338
338
|
# @overload cancel_operation(name: nil)
|
@@ -340,30 +340,30 @@ module Google
|
|
340
340
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
341
341
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
342
342
|
#
|
343
|
-
# @param name [String]
|
343
|
+
# @param name [::String]
|
344
344
|
# The name of the operation resource to be cancelled.
|
345
345
|
#
|
346
346
|
# @yield [response, operation] Access the result along with the RPC operation
|
347
|
-
# @yieldparam response [Google::Protobuf::Empty]
|
348
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
347
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
348
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
349
349
|
#
|
350
|
-
# @return [Google::Protobuf::Empty]
|
350
|
+
# @return [::Google::Protobuf::Empty]
|
351
351
|
#
|
352
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
352
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
353
353
|
#
|
354
354
|
def cancel_operation request, options = nil
|
355
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
355
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
356
356
|
|
357
|
-
request = Gapic::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest
|
357
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest
|
358
358
|
|
359
359
|
# Converts hash and nil to an options object
|
360
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
360
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
361
361
|
|
362
362
|
# Customize the options with defaults
|
363
363
|
metadata = @config.rpcs.cancel_operation.metadata.to_h
|
364
364
|
|
365
365
|
# Set x-goog-api-client and x-goog-user-project headers
|
366
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
366
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
367
367
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
368
368
|
gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
|
369
369
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -384,8 +384,8 @@ module Google
|
|
384
384
|
yield response, operation if block_given?
|
385
385
|
return response
|
386
386
|
end
|
387
|
-
rescue GRPC::BadStatus => e
|
388
|
-
raise Google::Cloud::Error.from_error(e)
|
387
|
+
rescue ::GRPC::BadStatus => e
|
388
|
+
raise ::Google::Cloud::Error.from_error(e)
|
389
389
|
end
|
390
390
|
|
391
391
|
##
|
@@ -395,7 +395,7 @@ module Google
|
|
395
395
|
# providing control over timeouts, retry behavior, logging, transport
|
396
396
|
# parameters, and other low-level controls. Certain parameters can also be
|
397
397
|
# applied individually to specific RPCs. See
|
398
|
-
# {Google::Longrunning::Operations::Client::Configuration::Rpcs}
|
398
|
+
# {::Google::Longrunning::Operations::Client::Configuration::Rpcs}
|
399
399
|
# for a list of RPCs that can be configured independently.
|
400
400
|
#
|
401
401
|
# Configuration can be applied globally to all clients, or to a single client
|
@@ -406,22 +406,22 @@ module Google
|
|
406
406
|
# To modify the global config, setting the timeout for list_operations
|
407
407
|
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
408
408
|
#
|
409
|
-
# Google::Longrunning::Operations::Client.configure do |config|
|
410
|
-
# config.timeout =
|
411
|
-
# config.rpcs.list_operations.timeout =
|
409
|
+
# ::Google::Longrunning::Operations::Client.configure do |config|
|
410
|
+
# config.timeout = 10.0
|
411
|
+
# config.rpcs.list_operations.timeout = 20.0
|
412
412
|
# end
|
413
413
|
#
|
414
414
|
# To apply the above configuration only to a new client:
|
415
415
|
#
|
416
|
-
# client = Google::Longrunning::Operations::Client.new do |config|
|
417
|
-
# config.timeout =
|
418
|
-
# config.rpcs.list_operations.timeout =
|
416
|
+
# client = ::Google::Longrunning::Operations::Client.new do |config|
|
417
|
+
# config.timeout = 10.0
|
418
|
+
# config.rpcs.list_operations.timeout = 20.0
|
419
419
|
# end
|
420
420
|
#
|
421
421
|
# @!attribute [rw] endpoint
|
422
422
|
# The hostname or hostname:port of the service endpoint.
|
423
423
|
# Defaults to `"vision.googleapis.com"`.
|
424
|
-
# @return [String]
|
424
|
+
# @return [::String]
|
425
425
|
# @!attribute [rw] credentials
|
426
426
|
# Credentials to send with calls. You may provide any of the following types:
|
427
427
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -433,29 +433,29 @@ module Google
|
|
433
433
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
434
434
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
435
435
|
# * (`nil`) indicating no credentials
|
436
|
-
# @return [Object]
|
436
|
+
# @return [::Object]
|
437
437
|
# @!attribute [rw] scope
|
438
438
|
# The OAuth scopes
|
439
|
-
# @return [Array
|
439
|
+
# @return [::Array<::String>]
|
440
440
|
# @!attribute [rw] lib_name
|
441
441
|
# The library name as recorded in instrumentation and logging
|
442
|
-
# @return [String]
|
442
|
+
# @return [::String]
|
443
443
|
# @!attribute [rw] lib_version
|
444
444
|
# The library version as recorded in instrumentation and logging
|
445
|
-
# @return [String]
|
445
|
+
# @return [::String]
|
446
446
|
# @!attribute [rw] channel_args
|
447
447
|
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
448
448
|
# `GRPC::Core::Channel` object is provided as the credential.
|
449
|
-
# @return [Hash]
|
449
|
+
# @return [::Hash]
|
450
450
|
# @!attribute [rw] interceptors
|
451
451
|
# An array of interceptors that are run before calls are executed.
|
452
|
-
# @return [Array
|
452
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
453
453
|
# @!attribute [rw] timeout
|
454
|
-
# The call timeout in
|
455
|
-
# @return [Numeric]
|
454
|
+
# The call timeout in seconds.
|
455
|
+
# @return [::Numeric]
|
456
456
|
# @!attribute [rw] metadata
|
457
457
|
# Additional gRPC headers to be sent with the call.
|
458
|
-
# @return [Hash{Symbol
|
458
|
+
# @return [::Hash{::Symbol=>::String}]
|
459
459
|
# @!attribute [rw] retry_policy
|
460
460
|
# The retry policy. The value is a hash with the following keys:
|
461
461
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
@@ -463,10 +463,10 @@ module Google
|
|
463
463
|
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
464
464
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
465
465
|
# trigger a retry.
|
466
|
-
# @return [Hash]
|
466
|
+
# @return [::Hash]
|
467
467
|
#
|
468
468
|
class Configuration
|
469
|
-
extend Gapic::Config
|
469
|
+
extend ::Gapic::Config
|
470
470
|
|
471
471
|
config_attr :endpoint, "vision.googleapis.com", String
|
472
472
|
config_attr :credentials, nil do |value|
|
@@ -474,14 +474,14 @@ module Google
|
|
474
474
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
475
475
|
allowed.any? { |klass| klass === value }
|
476
476
|
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
|
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
|
485
485
|
|
486
486
|
# @private
|
487
487
|
def initialize parent_config = nil
|
@@ -522,35 +522,35 @@ module Google
|
|
522
522
|
class Rpcs
|
523
523
|
##
|
524
524
|
# RPC-specific configuration for `list_operations`
|
525
|
-
# @return [Gapic::Config::Method]
|
525
|
+
# @return [::Gapic::Config::Method]
|
526
526
|
#
|
527
527
|
attr_reader :list_operations
|
528
528
|
##
|
529
529
|
# RPC-specific configuration for `get_operation`
|
530
|
-
# @return [Gapic::Config::Method]
|
530
|
+
# @return [::Gapic::Config::Method]
|
531
531
|
#
|
532
532
|
attr_reader :get_operation
|
533
533
|
##
|
534
534
|
# RPC-specific configuration for `delete_operation`
|
535
|
-
# @return [Gapic::Config::Method]
|
535
|
+
# @return [::Gapic::Config::Method]
|
536
536
|
#
|
537
537
|
attr_reader :delete_operation
|
538
538
|
##
|
539
539
|
# RPC-specific configuration for `cancel_operation`
|
540
|
-
# @return [Gapic::Config::Method]
|
540
|
+
# @return [::Gapic::Config::Method]
|
541
541
|
#
|
542
542
|
attr_reader :cancel_operation
|
543
543
|
|
544
544
|
# @private
|
545
545
|
def initialize parent_rpcs = nil
|
546
546
|
list_operations_config = parent_rpcs&.list_operations if parent_rpcs&.respond_to? :list_operations
|
547
|
-
@list_operations = Gapic::Config::Method.new list_operations_config
|
547
|
+
@list_operations = ::Gapic::Config::Method.new list_operations_config
|
548
548
|
get_operation_config = parent_rpcs&.get_operation if parent_rpcs&.respond_to? :get_operation
|
549
|
-
@get_operation = Gapic::Config::Method.new get_operation_config
|
549
|
+
@get_operation = ::Gapic::Config::Method.new get_operation_config
|
550
550
|
delete_operation_config = parent_rpcs&.delete_operation if parent_rpcs&.respond_to? :delete_operation
|
551
|
-
@delete_operation = Gapic::Config::Method.new delete_operation_config
|
551
|
+
@delete_operation = ::Gapic::Config::Method.new delete_operation_config
|
552
552
|
cancel_operation_config = parent_rpcs&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
|
553
|
-
@cancel_operation = Gapic::Config::Method.new cancel_operation_config
|
553
|
+
@cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
|
554
554
|
|
555
555
|
yield self if block_given?
|
556
556
|
end
|