google-cloud-vision-v1 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/v1.rb +1 -1
- data/lib/google/cloud/vision/v1/image_annotator.rb +1 -1
- data/lib/google/cloud/vision/v1/image_annotator/client.rb +108 -108
- data/lib/google/cloud/vision/v1/image_annotator/credentials.rb +1 -1
- data/lib/google/cloud/vision/v1/image_annotator/operations.rb +100 -100
- data/lib/google/cloud/vision/v1/image_annotator/paths.rb +3 -3
- data/lib/google/cloud/vision/v1/product_search.rb +4 -4
- data/lib/google/cloud/vision/v1/product_search/client.rb +377 -377
- data/lib/google/cloud/vision/v1/product_search/credentials.rb +1 -1
- data/lib/google/cloud/vision/v1/product_search/operations.rb +100 -100
- data/lib/google/cloud/vision/v1/product_search/paths.rb +12 -12
- data/lib/google/cloud/vision/v1/version.rb +1 -1
- data/proto_docs/google/api/resource.rb +12 -12
- data/proto_docs/google/cloud/vision/v1/geometry.rb +17 -17
- data/proto_docs/google/cloud/vision/v1/image_annotator.rb +204 -204
- data/proto_docs/google/cloud/vision/v1/product_search.rb +28 -28
- data/proto_docs/google/cloud/vision/v1/product_search_service.rb +144 -144
- data/proto_docs/google/cloud/vision/v1/text_annotation.rb +49 -49
- data/proto_docs/google/cloud/vision/v1/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: d81ce2def979a8926d57ea35998eba4c3fcdf298c1feb74812bae55f44c13fc0
|
4
|
+
data.tar.gz: 1e77680af535c48d5c6e4e47722410ed747ce2be6a7e89552cd6531396a3b754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8686b163bf82bb0eb713c2b1f4338011f5dc83d254d79a6ca9454376e5adc0456cf454420abc4416da006ff4dca0d835d446f9ebd0bfed8659ac56fd0f496ffb
|
7
|
+
data.tar.gz: 7f599b5344bf45a276fe664f0b1ffc553024c8c7e2d75e63d9578947a6ba6e5fde9f891666e78e13878a27fa7b0f55e5947dd46073d442748cd30cf464762ec4
|
data/AUTHENTICATION.md
CHANGED
@@ -27,7 +27,7 @@ export VISION_CREDENTIALS=path/to/keyfile.json
|
|
27
27
|
```ruby
|
28
28
|
require "google/cloud/vision/v1"
|
29
29
|
|
30
|
-
client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
30
|
+
client = ::Google::Cloud::Vision::V1::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-v1
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
{Google::Cloud::Vision::V1::ProductSearch::Credentials}):
|
67
|
+
{::Google::Cloud::Vision::V1::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/v1"
|
|
77
77
|
|
78
78
|
ENV["VISION_CREDENTIALS"] = "path/to/keyfile.json"
|
79
79
|
|
80
|
-
client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
80
|
+
client = ::Google::Cloud::Vision::V1::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/v1"
|
90
90
|
|
91
|
-
client = Google::Cloud::Vision::V1::ProductSearch::Client.new do |config|
|
91
|
+
client = ::Google::Cloud::Vision::V1::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/v1"
|
100
100
|
|
101
|
-
Google::Cloud::Vision::V1::ProductSearch::Client.configure do |config|
|
101
|
+
::Google::Cloud::Vision::V1::ProductSearch::Client.configure do |config|
|
102
102
|
config.credentials = "path/to/keyfile.json"
|
103
103
|
end
|
104
104
|
|
105
|
-
client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
105
|
+
client = ::Google::Cloud::Vision::V1::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/v1"
|
27
27
|
|
28
|
-
client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
28
|
+
client = ::Google::Cloud::Vision::V1::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/v1"
|
30
|
-
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
30
|
+
# client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new
|
31
31
|
#
|
32
32
|
module V1
|
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/v1/image_annotator"
|
42
|
-
# client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new
|
42
|
+
# client = ::Google::Cloud::Vision::V1::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::V1::ImageAnnotator::Client::Configuration}
|
43
|
+
# See {::Google::Cloud::Vision::V1::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::V1::ImageAnnotator::Client.configure do |config|
|
51
|
-
# config.timeout =
|
50
|
+
# ::Google::Cloud::Vision::V1::ImageAnnotator::Client.configure do |config|
|
51
|
+
# config.timeout = 10.0
|
52
52
|
# end
|
53
53
|
#
|
54
54
|
# @yield [config] Configure the Client client.
|
@@ -112,7 +112,7 @@ module Google
|
|
112
112
|
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
113
113
|
# should be made on {Client.configure}.
|
114
114
|
#
|
115
|
-
# See {Google::Cloud::Vision::V1::ImageAnnotator::Client::Configuration}
|
115
|
+
# See {::Google::Cloud::Vision::V1::ImageAnnotator::Client::Configuration}
|
116
116
|
# for a description of the configuration fields.
|
117
117
|
#
|
118
118
|
# @yield [config] Configure the Client client.
|
@@ -133,13 +133,13 @@ module Google
|
|
133
133
|
# To create a new ImageAnnotator client with the default
|
134
134
|
# configuration:
|
135
135
|
#
|
136
|
-
# client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new
|
136
|
+
# client = ::Google::Cloud::Vision::V1::ImageAnnotator::Client.new
|
137
137
|
#
|
138
138
|
# To create a new ImageAnnotator client with a custom
|
139
139
|
# configuration:
|
140
140
|
#
|
141
|
-
# client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new do |config|
|
142
|
-
# config.timeout =
|
141
|
+
# client = ::Google::Cloud::Vision::V1::ImageAnnotator::Client.new do |config|
|
142
|
+
# config.timeout = 10.0
|
143
143
|
# end
|
144
144
|
#
|
145
145
|
# @yield [config] Configure the ImageAnnotator client.
|
@@ -171,8 +171,8 @@ module Google
|
|
171
171
|
config.endpoint = @config.endpoint
|
172
172
|
end
|
173
173
|
|
174
|
-
@image_annotator_stub = Gapic::ServiceStub.new(
|
175
|
-
Google::Cloud::Vision::V1::ImageAnnotator::Stub,
|
174
|
+
@image_annotator_stub = ::Gapic::ServiceStub.new(
|
175
|
+
::Google::Cloud::Vision::V1::ImageAnnotator::Stub,
|
176
176
|
credentials: credentials,
|
177
177
|
endpoint: @config.endpoint,
|
178
178
|
channel_args: @config.channel_args,
|
@@ -183,7 +183,7 @@ module Google
|
|
183
183
|
##
|
184
184
|
# Get the associated client for long-running operations.
|
185
185
|
#
|
186
|
-
# @return [Google::Cloud::Vision::V1::ImageAnnotator::Operations]
|
186
|
+
# @return [::Google::Cloud::Vision::V1::ImageAnnotator::Operations]
|
187
187
|
#
|
188
188
|
attr_reader :operations_client
|
189
189
|
|
@@ -194,12 +194,12 @@ module Google
|
|
194
194
|
#
|
195
195
|
# @overload batch_annotate_images(request, options = nil)
|
196
196
|
# Pass arguments to `batch_annotate_images` via a request object, either of type
|
197
|
-
# {Google::Cloud::Vision::V1::BatchAnnotateImagesRequest} or an equivalent Hash.
|
197
|
+
# {::Google::Cloud::Vision::V1::BatchAnnotateImagesRequest} or an equivalent Hash.
|
198
198
|
#
|
199
|
-
# @param request [Google::Cloud::Vision::V1::BatchAnnotateImagesRequest, Hash]
|
199
|
+
# @param request [::Google::Cloud::Vision::V1::BatchAnnotateImagesRequest, ::Hash]
|
200
200
|
# A request object representing the call parameters. Required. To specify no
|
201
201
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
202
|
-
# @param options [Gapic::CallOptions, Hash]
|
202
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
203
203
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
204
204
|
#
|
205
205
|
# @overload batch_annotate_images(requests: nil, parent: nil)
|
@@ -207,9 +207,9 @@ module Google
|
|
207
207
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
208
208
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
209
209
|
#
|
210
|
-
# @param requests [Array
|
210
|
+
# @param requests [::Array<::Google::Cloud::Vision::V1::AnnotateImageRequest, ::Hash>]
|
211
211
|
# Required. Individual image annotation requests for this batch.
|
212
|
-
# @param parent [String]
|
212
|
+
# @param parent [::String]
|
213
213
|
# Optional. Target project and location to make a call.
|
214
214
|
#
|
215
215
|
# Format: `projects/{project-id}/locations/{location-id}`.
|
@@ -224,26 +224,26 @@ module Google
|
|
224
224
|
# Example: `projects/project-A/locations/eu`.
|
225
225
|
#
|
226
226
|
# @yield [response, operation] Access the result along with the RPC operation
|
227
|
-
# @yieldparam response [Google::Cloud::Vision::V1::BatchAnnotateImagesResponse]
|
228
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
227
|
+
# @yieldparam response [::Google::Cloud::Vision::V1::BatchAnnotateImagesResponse]
|
228
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
229
229
|
#
|
230
|
-
# @return [Google::Cloud::Vision::V1::BatchAnnotateImagesResponse]
|
230
|
+
# @return [::Google::Cloud::Vision::V1::BatchAnnotateImagesResponse]
|
231
231
|
#
|
232
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
232
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
233
233
|
#
|
234
234
|
def batch_annotate_images request, options = nil
|
235
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
235
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
236
236
|
|
237
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1::BatchAnnotateImagesRequest
|
237
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1::BatchAnnotateImagesRequest
|
238
238
|
|
239
239
|
# Converts hash and nil to an options object
|
240
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
240
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
241
241
|
|
242
242
|
# Customize the options with defaults
|
243
243
|
metadata = @config.rpcs.batch_annotate_images.metadata.to_h
|
244
244
|
|
245
245
|
# Set x-goog-api-client and x-goog-user-project headers
|
246
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
246
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
247
247
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
248
248
|
gapic_version: ::Google::Cloud::Vision::V1::VERSION
|
249
249
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -258,8 +258,8 @@ module Google
|
|
258
258
|
yield response, operation if block_given?
|
259
259
|
return response
|
260
260
|
end
|
261
|
-
rescue GRPC::BadStatus => e
|
262
|
-
raise Google::Cloud::Error.from_error(e)
|
261
|
+
rescue ::GRPC::BadStatus => e
|
262
|
+
raise ::Google::Cloud::Error.from_error(e)
|
263
263
|
end
|
264
264
|
|
265
265
|
##
|
@@ -273,12 +273,12 @@ module Google
|
|
273
273
|
#
|
274
274
|
# @overload batch_annotate_files(request, options = nil)
|
275
275
|
# Pass arguments to `batch_annotate_files` via a request object, either of type
|
276
|
-
# {Google::Cloud::Vision::V1::BatchAnnotateFilesRequest} or an equivalent Hash.
|
276
|
+
# {::Google::Cloud::Vision::V1::BatchAnnotateFilesRequest} or an equivalent Hash.
|
277
277
|
#
|
278
|
-
# @param request [Google::Cloud::Vision::V1::BatchAnnotateFilesRequest, Hash]
|
278
|
+
# @param request [::Google::Cloud::Vision::V1::BatchAnnotateFilesRequest, ::Hash]
|
279
279
|
# A request object representing the call parameters. Required. To specify no
|
280
280
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
281
|
-
# @param options [Gapic::CallOptions, Hash]
|
281
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
282
282
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
283
283
|
#
|
284
284
|
# @overload batch_annotate_files(requests: nil, parent: nil)
|
@@ -286,10 +286,10 @@ module Google
|
|
286
286
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
287
287
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
288
288
|
#
|
289
|
-
# @param requests [Array
|
289
|
+
# @param requests [::Array<::Google::Cloud::Vision::V1::AnnotateFileRequest, ::Hash>]
|
290
290
|
# Required. The list of file annotation requests. Right now we support only one
|
291
291
|
# AnnotateFileRequest in BatchAnnotateFilesRequest.
|
292
|
-
# @param parent [String]
|
292
|
+
# @param parent [::String]
|
293
293
|
# Optional. Target project and location to make a call.
|
294
294
|
#
|
295
295
|
# Format: `projects/{project-id}/locations/{location-id}`.
|
@@ -304,26 +304,26 @@ module Google
|
|
304
304
|
# Example: `projects/project-A/locations/eu`.
|
305
305
|
#
|
306
306
|
# @yield [response, operation] Access the result along with the RPC operation
|
307
|
-
# @yieldparam response [Google::Cloud::Vision::V1::BatchAnnotateFilesResponse]
|
308
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
307
|
+
# @yieldparam response [::Google::Cloud::Vision::V1::BatchAnnotateFilesResponse]
|
308
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
309
309
|
#
|
310
|
-
# @return [Google::Cloud::Vision::V1::BatchAnnotateFilesResponse]
|
310
|
+
# @return [::Google::Cloud::Vision::V1::BatchAnnotateFilesResponse]
|
311
311
|
#
|
312
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
312
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
313
313
|
#
|
314
314
|
def batch_annotate_files request, options = nil
|
315
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
315
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
316
316
|
|
317
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1::BatchAnnotateFilesRequest
|
317
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1::BatchAnnotateFilesRequest
|
318
318
|
|
319
319
|
# Converts hash and nil to an options object
|
320
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
320
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
321
321
|
|
322
322
|
# Customize the options with defaults
|
323
323
|
metadata = @config.rpcs.batch_annotate_files.metadata.to_h
|
324
324
|
|
325
325
|
# Set x-goog-api-client and x-goog-user-project headers
|
326
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
326
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
327
327
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
328
328
|
gapic_version: ::Google::Cloud::Vision::V1::VERSION
|
329
329
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -338,8 +338,8 @@ module Google
|
|
338
338
|
yield response, operation if block_given?
|
339
339
|
return response
|
340
340
|
end
|
341
|
-
rescue GRPC::BadStatus => e
|
342
|
-
raise Google::Cloud::Error.from_error(e)
|
341
|
+
rescue ::GRPC::BadStatus => e
|
342
|
+
raise ::Google::Cloud::Error.from_error(e)
|
343
343
|
end
|
344
344
|
|
345
345
|
##
|
@@ -355,12 +355,12 @@ module Google
|
|
355
355
|
#
|
356
356
|
# @overload async_batch_annotate_images(request, options = nil)
|
357
357
|
# Pass arguments to `async_batch_annotate_images` via a request object, either of type
|
358
|
-
# {Google::Cloud::Vision::V1::AsyncBatchAnnotateImagesRequest} or an equivalent Hash.
|
358
|
+
# {::Google::Cloud::Vision::V1::AsyncBatchAnnotateImagesRequest} or an equivalent Hash.
|
359
359
|
#
|
360
|
-
# @param request [Google::Cloud::Vision::V1::AsyncBatchAnnotateImagesRequest, Hash]
|
360
|
+
# @param request [::Google::Cloud::Vision::V1::AsyncBatchAnnotateImagesRequest, ::Hash]
|
361
361
|
# A request object representing the call parameters. Required. To specify no
|
362
362
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
363
|
-
# @param options [Gapic::CallOptions, Hash]
|
363
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
364
364
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
365
365
|
#
|
366
366
|
# @overload async_batch_annotate_images(requests: nil, output_config: nil, parent: nil)
|
@@ -368,11 +368,11 @@ module Google
|
|
368
368
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
369
369
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
370
370
|
#
|
371
|
-
# @param requests [Array
|
371
|
+
# @param requests [::Array<::Google::Cloud::Vision::V1::AnnotateImageRequest, ::Hash>]
|
372
372
|
# Required. Individual image annotation requests for this batch.
|
373
|
-
# @param output_config [Google::Cloud::Vision::V1::OutputConfig, Hash]
|
373
|
+
# @param output_config [::Google::Cloud::Vision::V1::OutputConfig, ::Hash]
|
374
374
|
# Required. The desired output location and metadata (e.g. format).
|
375
|
-
# @param parent [String]
|
375
|
+
# @param parent [::String]
|
376
376
|
# Optional. Target project and location to make a call.
|
377
377
|
#
|
378
378
|
# Format: `projects/{project-id}/locations/{location-id}`.
|
@@ -387,26 +387,26 @@ module Google
|
|
387
387
|
# Example: `projects/project-A/locations/eu`.
|
388
388
|
#
|
389
389
|
# @yield [response, operation] Access the result along with the RPC operation
|
390
|
-
# @yieldparam response [Gapic::Operation]
|
391
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
390
|
+
# @yieldparam response [::Gapic::Operation]
|
391
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
392
392
|
#
|
393
|
-
# @return [Gapic::Operation]
|
393
|
+
# @return [::Gapic::Operation]
|
394
394
|
#
|
395
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
395
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
396
396
|
#
|
397
397
|
def async_batch_annotate_images request, options = nil
|
398
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
398
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
399
399
|
|
400
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1::AsyncBatchAnnotateImagesRequest
|
400
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1::AsyncBatchAnnotateImagesRequest
|
401
401
|
|
402
402
|
# Converts hash and nil to an options object
|
403
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
403
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
404
404
|
|
405
405
|
# Customize the options with defaults
|
406
406
|
metadata = @config.rpcs.async_batch_annotate_images.metadata.to_h
|
407
407
|
|
408
408
|
# Set x-goog-api-client and x-goog-user-project headers
|
409
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
409
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
410
410
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
411
411
|
gapic_version: ::Google::Cloud::Vision::V1::VERSION
|
412
412
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -418,12 +418,12 @@ module Google
|
|
418
418
|
retry_policy: @config.retry_policy
|
419
419
|
|
420
420
|
@image_annotator_stub.call_rpc :async_batch_annotate_images, request, options: options do |response, operation|
|
421
|
-
response = Gapic::Operation.new response, @operations_client, options: options
|
421
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
422
422
|
yield response, operation if block_given?
|
423
423
|
return response
|
424
424
|
end
|
425
|
-
rescue GRPC::BadStatus => e
|
426
|
-
raise Google::Cloud::Error.from_error(e)
|
425
|
+
rescue ::GRPC::BadStatus => e
|
426
|
+
raise ::Google::Cloud::Error.from_error(e)
|
427
427
|
end
|
428
428
|
|
429
429
|
##
|
@@ -436,12 +436,12 @@ module Google
|
|
436
436
|
#
|
437
437
|
# @overload async_batch_annotate_files(request, options = nil)
|
438
438
|
# Pass arguments to `async_batch_annotate_files` via a request object, either of type
|
439
|
-
# {Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash.
|
439
|
+
# {::Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash.
|
440
440
|
#
|
441
|
-
# @param request [Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest, Hash]
|
441
|
+
# @param request [::Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest, ::Hash]
|
442
442
|
# A request object representing the call parameters. Required. To specify no
|
443
443
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
444
|
-
# @param options [Gapic::CallOptions, Hash]
|
444
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
445
445
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
446
446
|
#
|
447
447
|
# @overload async_batch_annotate_files(requests: nil, parent: nil)
|
@@ -449,9 +449,9 @@ module Google
|
|
449
449
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
450
450
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
451
451
|
#
|
452
|
-
# @param requests [Array
|
452
|
+
# @param requests [::Array<::Google::Cloud::Vision::V1::AsyncAnnotateFileRequest, ::Hash>]
|
453
453
|
# Required. Individual async file annotation requests for this batch.
|
454
|
-
# @param parent [String]
|
454
|
+
# @param parent [::String]
|
455
455
|
# Optional. Target project and location to make a call.
|
456
456
|
#
|
457
457
|
# Format: `projects/{project-id}/locations/{location-id}`.
|
@@ -466,26 +466,26 @@ module Google
|
|
466
466
|
# Example: `projects/project-A/locations/eu`.
|
467
467
|
#
|
468
468
|
# @yield [response, operation] Access the result along with the RPC operation
|
469
|
-
# @yieldparam response [Gapic::Operation]
|
470
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
469
|
+
# @yieldparam response [::Gapic::Operation]
|
470
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
471
471
|
#
|
472
|
-
# @return [Gapic::Operation]
|
472
|
+
# @return [::Gapic::Operation]
|
473
473
|
#
|
474
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
474
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
475
475
|
#
|
476
476
|
def async_batch_annotate_files request, options = nil
|
477
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
477
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
478
478
|
|
479
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest
|
479
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest
|
480
480
|
|
481
481
|
# Converts hash and nil to an options object
|
482
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
482
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
483
483
|
|
484
484
|
# Customize the options with defaults
|
485
485
|
metadata = @config.rpcs.async_batch_annotate_files.metadata.to_h
|
486
486
|
|
487
487
|
# Set x-goog-api-client and x-goog-user-project headers
|
488
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
488
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
489
489
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
490
490
|
gapic_version: ::Google::Cloud::Vision::V1::VERSION
|
491
491
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -497,12 +497,12 @@ module Google
|
|
497
497
|
retry_policy: @config.retry_policy
|
498
498
|
|
499
499
|
@image_annotator_stub.call_rpc :async_batch_annotate_files, request, options: options do |response, operation|
|
500
|
-
response = Gapic::Operation.new response, @operations_client, options: options
|
500
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
501
501
|
yield response, operation if block_given?
|
502
502
|
return response
|
503
503
|
end
|
504
|
-
rescue GRPC::BadStatus => e
|
505
|
-
raise Google::Cloud::Error.from_error(e)
|
504
|
+
rescue ::GRPC::BadStatus => e
|
505
|
+
raise ::Google::Cloud::Error.from_error(e)
|
506
506
|
end
|
507
507
|
|
508
508
|
##
|
@@ -512,7 +512,7 @@ module Google
|
|
512
512
|
# providing control over timeouts, retry behavior, logging, transport
|
513
513
|
# parameters, and other low-level controls. Certain parameters can also be
|
514
514
|
# applied individually to specific RPCs. See
|
515
|
-
# {Google::Cloud::Vision::V1::ImageAnnotator::Client::Configuration::Rpcs}
|
515
|
+
# {::Google::Cloud::Vision::V1::ImageAnnotator::Client::Configuration::Rpcs}
|
516
516
|
# for a list of RPCs that can be configured independently.
|
517
517
|
#
|
518
518
|
# Configuration can be applied globally to all clients, or to a single client
|
@@ -523,22 +523,22 @@ module Google
|
|
523
523
|
# To modify the global config, setting the timeout for batch_annotate_images
|
524
524
|
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
525
525
|
#
|
526
|
-
# Google::Cloud::Vision::V1::ImageAnnotator::Client.configure do |config|
|
527
|
-
# config.timeout =
|
528
|
-
# config.rpcs.batch_annotate_images.timeout =
|
526
|
+
# ::Google::Cloud::Vision::V1::ImageAnnotator::Client.configure do |config|
|
527
|
+
# config.timeout = 10.0
|
528
|
+
# config.rpcs.batch_annotate_images.timeout = 20.0
|
529
529
|
# end
|
530
530
|
#
|
531
531
|
# To apply the above configuration only to a new client:
|
532
532
|
#
|
533
|
-
# client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new do |config|
|
534
|
-
# config.timeout =
|
535
|
-
# config.rpcs.batch_annotate_images.timeout =
|
533
|
+
# client = ::Google::Cloud::Vision::V1::ImageAnnotator::Client.new do |config|
|
534
|
+
# config.timeout = 10.0
|
535
|
+
# config.rpcs.batch_annotate_images.timeout = 20.0
|
536
536
|
# end
|
537
537
|
#
|
538
538
|
# @!attribute [rw] endpoint
|
539
539
|
# The hostname or hostname:port of the service endpoint.
|
540
540
|
# Defaults to `"vision.googleapis.com"`.
|
541
|
-
# @return [String]
|
541
|
+
# @return [::String]
|
542
542
|
# @!attribute [rw] credentials
|
543
543
|
# Credentials to send with calls. You may provide any of the following types:
|
544
544
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -550,29 +550,29 @@ module Google
|
|
550
550
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
551
551
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
552
552
|
# * (`nil`) indicating no credentials
|
553
|
-
# @return [Object]
|
553
|
+
# @return [::Object]
|
554
554
|
# @!attribute [rw] scope
|
555
555
|
# The OAuth scopes
|
556
|
-
# @return [Array
|
556
|
+
# @return [::Array<::String>]
|
557
557
|
# @!attribute [rw] lib_name
|
558
558
|
# The library name as recorded in instrumentation and logging
|
559
|
-
# @return [String]
|
559
|
+
# @return [::String]
|
560
560
|
# @!attribute [rw] lib_version
|
561
561
|
# The library version as recorded in instrumentation and logging
|
562
|
-
# @return [String]
|
562
|
+
# @return [::String]
|
563
563
|
# @!attribute [rw] channel_args
|
564
564
|
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
565
565
|
# `GRPC::Core::Channel` object is provided as the credential.
|
566
|
-
# @return [Hash]
|
566
|
+
# @return [::Hash]
|
567
567
|
# @!attribute [rw] interceptors
|
568
568
|
# An array of interceptors that are run before calls are executed.
|
569
|
-
# @return [Array
|
569
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
570
570
|
# @!attribute [rw] timeout
|
571
|
-
# The call timeout in
|
572
|
-
# @return [Numeric]
|
571
|
+
# The call timeout in seconds.
|
572
|
+
# @return [::Numeric]
|
573
573
|
# @!attribute [rw] metadata
|
574
574
|
# Additional gRPC headers to be sent with the call.
|
575
|
-
# @return [Hash{Symbol
|
575
|
+
# @return [::Hash{::Symbol=>::String}]
|
576
576
|
# @!attribute [rw] retry_policy
|
577
577
|
# The retry policy. The value is a hash with the following keys:
|
578
578
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
@@ -580,10 +580,10 @@ module Google
|
|
580
580
|
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
581
581
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
582
582
|
# trigger a retry.
|
583
|
-
# @return [Hash]
|
583
|
+
# @return [::Hash]
|
584
584
|
#
|
585
585
|
class Configuration
|
586
|
-
extend Gapic::Config
|
586
|
+
extend ::Gapic::Config
|
587
587
|
|
588
588
|
config_attr :endpoint, "vision.googleapis.com", String
|
589
589
|
config_attr :credentials, nil do |value|
|
@@ -591,14 +591,14 @@ module Google
|
|
591
591
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
592
592
|
allowed.any? { |klass| klass === value }
|
593
593
|
end
|
594
|
-
config_attr :scope, nil, String, Array, nil
|
595
|
-
config_attr :lib_name, nil, String, nil
|
596
|
-
config_attr :lib_version, nil, String, nil
|
597
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
|
598
|
-
config_attr :interceptors, nil, Array, nil
|
599
|
-
config_attr :timeout, nil, Numeric, nil
|
600
|
-
config_attr :metadata, nil, Hash, nil
|
601
|
-
config_attr :retry_policy, nil, Hash, Proc, nil
|
594
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
595
|
+
config_attr :lib_name, nil, ::String, nil
|
596
|
+
config_attr :lib_version, nil, ::String, nil
|
597
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
598
|
+
config_attr :interceptors, nil, ::Array, nil
|
599
|
+
config_attr :timeout, nil, ::Numeric, nil
|
600
|
+
config_attr :metadata, nil, ::Hash, nil
|
601
|
+
config_attr :retry_policy, nil, ::Hash, Proc, nil
|
602
602
|
|
603
603
|
# @private
|
604
604
|
def initialize parent_config = nil
|
@@ -639,35 +639,35 @@ module Google
|
|
639
639
|
class Rpcs
|
640
640
|
##
|
641
641
|
# RPC-specific configuration for `batch_annotate_images`
|
642
|
-
# @return [Gapic::Config::Method]
|
642
|
+
# @return [::Gapic::Config::Method]
|
643
643
|
#
|
644
644
|
attr_reader :batch_annotate_images
|
645
645
|
##
|
646
646
|
# RPC-specific configuration for `batch_annotate_files`
|
647
|
-
# @return [Gapic::Config::Method]
|
647
|
+
# @return [::Gapic::Config::Method]
|
648
648
|
#
|
649
649
|
attr_reader :batch_annotate_files
|
650
650
|
##
|
651
651
|
# RPC-specific configuration for `async_batch_annotate_images`
|
652
|
-
# @return [Gapic::Config::Method]
|
652
|
+
# @return [::Gapic::Config::Method]
|
653
653
|
#
|
654
654
|
attr_reader :async_batch_annotate_images
|
655
655
|
##
|
656
656
|
# RPC-specific configuration for `async_batch_annotate_files`
|
657
|
-
# @return [Gapic::Config::Method]
|
657
|
+
# @return [::Gapic::Config::Method]
|
658
658
|
#
|
659
659
|
attr_reader :async_batch_annotate_files
|
660
660
|
|
661
661
|
# @private
|
662
662
|
def initialize parent_rpcs = nil
|
663
663
|
batch_annotate_images_config = parent_rpcs&.batch_annotate_images if parent_rpcs&.respond_to? :batch_annotate_images
|
664
|
-
@batch_annotate_images = Gapic::Config::Method.new batch_annotate_images_config
|
664
|
+
@batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
|
665
665
|
batch_annotate_files_config = parent_rpcs&.batch_annotate_files if parent_rpcs&.respond_to? :batch_annotate_files
|
666
|
-
@batch_annotate_files = Gapic::Config::Method.new batch_annotate_files_config
|
666
|
+
@batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
|
667
667
|
async_batch_annotate_images_config = parent_rpcs&.async_batch_annotate_images if parent_rpcs&.respond_to? :async_batch_annotate_images
|
668
|
-
@async_batch_annotate_images = Gapic::Config::Method.new async_batch_annotate_images_config
|
668
|
+
@async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
|
669
669
|
async_batch_annotate_files_config = parent_rpcs&.async_batch_annotate_files if parent_rpcs&.respond_to? :async_batch_annotate_files
|
670
|
-
@async_batch_annotate_files = Gapic::Config::Method.new async_batch_annotate_files_config
|
670
|
+
@async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config
|
671
671
|
|
672
672
|
yield self if block_given?
|
673
673
|
end
|