google-cloud-vision-v1p3beta1 0.1.4 → 0.2.3
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 +5 -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 +79 -74
- data/lib/google/cloud/vision/v1p3beta1/image_annotator/credentials.rb +1 -1
- data/lib/google/cloud/vision/v1p3beta1/image_annotator/operations.rb +109 -103
- 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 +365 -360
- data/lib/google/cloud/vision/v1p3beta1/product_search/credentials.rb +1 -1
- data/lib/google/cloud/vision/v1p3beta1/product_search/operations.rb +109 -103
- 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 +33 -6
- data/lib/google/cloud/common_resources_pb.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c25449bf32edc9b890979b41ecaf717f8dabc566c2b8a9f882cfd88f127be526
|
4
|
+
data.tar.gz: 8ada7b57d6ff941ab0c657aabf6f893cbd2479ed4bff4aa0f61ca822afe1b6fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7b734a155e8a9f3a85abbf3b99992cc5ba2e29c7c5c3e39e834e507e973f379fe307d76891a9b79a9c864ee100556f2a27adfd54c47ccf5adf0194ccd91c022
|
7
|
+
data.tar.gz: fcf9b452d770de449cf780bf938a22c6a947d87305707a23fb7cbcd4ee38223a58f03b0ea3f67bbe976965f152424ea2d63a32551ca0a65c7e3eeb9e5117d0a0
|
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
@@ -18,6 +18,7 @@ In order to use this library, you first need to go through the following steps:
|
|
18
18
|
|
19
19
|
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
20
20
|
1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
21
|
+
1. [Enable the API.](https://console.cloud.google.com/apis/library/vision.googleapis.com)
|
21
22
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
22
23
|
|
23
24
|
## Quick Start
|
@@ -25,7 +26,7 @@ In order to use this library, you first need to go through the following steps:
|
|
25
26
|
```ruby
|
26
27
|
require "google/cloud/vision/v1p3beta1"
|
27
28
|
|
28
|
-
client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
|
29
|
+
client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
|
29
30
|
request = my_create_request
|
30
31
|
response = client.create_product_set request
|
31
32
|
```
|
@@ -33,6 +34,9 @@ response = client.create_product_set request
|
|
33
34
|
View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-vision-v1p3beta1/latest)
|
34
35
|
for class and method documentation.
|
35
36
|
|
37
|
+
See also the [Product Documentation](https://cloud.google.com/vision)
|
38
|
+
for general usage information.
|
39
|
+
|
36
40
|
## Enabling Logging
|
37
41
|
|
38
42
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
@@ -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.
|
@@ -148,15 +148,16 @@ module Google
|
|
148
148
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
149
149
|
credentials = Credentials.new credentials, scope: @config.scope
|
150
150
|
end
|
151
|
-
@quota_project_id =
|
151
|
+
@quota_project_id = @config.quota_project
|
152
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
152
153
|
|
153
154
|
@operations_client = Operations.new do |config|
|
154
155
|
config.credentials = credentials
|
155
156
|
config.endpoint = @config.endpoint
|
156
157
|
end
|
157
158
|
|
158
|
-
@image_annotator_stub = Gapic::ServiceStub.new(
|
159
|
-
Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Stub,
|
159
|
+
@image_annotator_stub = ::Gapic::ServiceStub.new(
|
160
|
+
::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Stub,
|
160
161
|
credentials: credentials,
|
161
162
|
endpoint: @config.endpoint,
|
162
163
|
channel_args: @config.channel_args,
|
@@ -167,7 +168,7 @@ module Google
|
|
167
168
|
##
|
168
169
|
# Get the associated client for long-running operations.
|
169
170
|
#
|
170
|
-
# @return [Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Operations]
|
171
|
+
# @return [::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Operations]
|
171
172
|
#
|
172
173
|
attr_reader :operations_client
|
173
174
|
|
@@ -178,12 +179,12 @@ module Google
|
|
178
179
|
#
|
179
180
|
# @overload batch_annotate_images(request, options = nil)
|
180
181
|
# Pass arguments to `batch_annotate_images` via a request object, either of type
|
181
|
-
# {Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest} or an equivalent Hash.
|
182
|
+
# {::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest} or an equivalent Hash.
|
182
183
|
#
|
183
|
-
# @param request [Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, Hash]
|
184
|
+
# @param request [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, ::Hash]
|
184
185
|
# A request object representing the call parameters. Required. To specify no
|
185
186
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
186
|
-
# @param options [Gapic::CallOptions, Hash]
|
187
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
187
188
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
188
189
|
#
|
189
190
|
# @overload batch_annotate_images(requests: nil)
|
@@ -191,30 +192,30 @@ module Google
|
|
191
192
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
192
193
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
193
194
|
#
|
194
|
-
# @param requests [Array
|
195
|
+
# @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest, ::Hash>]
|
195
196
|
# Individual image annotation requests for this batch.
|
196
197
|
#
|
197
198
|
# @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]
|
199
|
+
# @yieldparam response [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse]
|
200
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
200
201
|
#
|
201
|
-
# @return [Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse]
|
202
|
+
# @return [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse]
|
202
203
|
#
|
203
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
204
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
204
205
|
#
|
205
206
|
def batch_annotate_images request, options = nil
|
206
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
207
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
207
208
|
|
208
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest
|
209
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest
|
209
210
|
|
210
211
|
# Converts hash and nil to an options object
|
211
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
212
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
212
213
|
|
213
214
|
# Customize the options with defaults
|
214
215
|
metadata = @config.rpcs.batch_annotate_images.metadata.to_h
|
215
216
|
|
216
217
|
# Set x-goog-api-client and x-goog-user-project headers
|
217
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
218
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
218
219
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
219
220
|
gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
|
220
221
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -229,8 +230,8 @@ module Google
|
|
229
230
|
yield response, operation if block_given?
|
230
231
|
return response
|
231
232
|
end
|
232
|
-
rescue GRPC::BadStatus => e
|
233
|
-
raise Google::Cloud::Error.from_error(e)
|
233
|
+
rescue ::GRPC::BadStatus => e
|
234
|
+
raise ::Google::Cloud::Error.from_error(e)
|
234
235
|
end
|
235
236
|
|
236
237
|
##
|
@@ -243,12 +244,12 @@ module Google
|
|
243
244
|
#
|
244
245
|
# @overload async_batch_annotate_files(request, options = nil)
|
245
246
|
# Pass arguments to `async_batch_annotate_files` via a request object, either of type
|
246
|
-
# {Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash.
|
247
|
+
# {::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash.
|
247
248
|
#
|
248
|
-
# @param request [Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, Hash]
|
249
|
+
# @param request [::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, ::Hash]
|
249
250
|
# A request object representing the call parameters. Required. To specify no
|
250
251
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
251
|
-
# @param options [Gapic::CallOptions, Hash]
|
252
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
252
253
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
253
254
|
#
|
254
255
|
# @overload async_batch_annotate_files(requests: nil)
|
@@ -256,30 +257,30 @@ module Google
|
|
256
257
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
257
258
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
258
259
|
#
|
259
|
-
# @param requests [Array
|
260
|
+
# @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest, ::Hash>]
|
260
261
|
# Required. Individual async file annotation requests for this batch.
|
261
262
|
#
|
262
263
|
# @yield [response, operation] Access the result along with the RPC operation
|
263
|
-
# @yieldparam response [Gapic::Operation]
|
264
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
264
|
+
# @yieldparam response [::Gapic::Operation]
|
265
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
265
266
|
#
|
266
|
-
# @return [Gapic::Operation]
|
267
|
+
# @return [::Gapic::Operation]
|
267
268
|
#
|
268
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
269
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
269
270
|
#
|
270
271
|
def async_batch_annotate_files request, options = nil
|
271
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
272
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
272
273
|
|
273
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest
|
274
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest
|
274
275
|
|
275
276
|
# Converts hash and nil to an options object
|
276
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
277
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
277
278
|
|
278
279
|
# Customize the options with defaults
|
279
280
|
metadata = @config.rpcs.async_batch_annotate_files.metadata.to_h
|
280
281
|
|
281
282
|
# Set x-goog-api-client and x-goog-user-project headers
|
282
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
283
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
283
284
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
284
285
|
gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
|
285
286
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -291,12 +292,12 @@ module Google
|
|
291
292
|
retry_policy: @config.retry_policy
|
292
293
|
|
293
294
|
@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
|
295
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
295
296
|
yield response, operation if block_given?
|
296
297
|
return response
|
297
298
|
end
|
298
|
-
rescue GRPC::BadStatus => e
|
299
|
-
raise Google::Cloud::Error.from_error(e)
|
299
|
+
rescue ::GRPC::BadStatus => e
|
300
|
+
raise ::Google::Cloud::Error.from_error(e)
|
300
301
|
end
|
301
302
|
|
302
303
|
##
|
@@ -306,7 +307,7 @@ module Google
|
|
306
307
|
# providing control over timeouts, retry behavior, logging, transport
|
307
308
|
# parameters, and other low-level controls. Certain parameters can also be
|
308
309
|
# applied individually to specific RPCs. See
|
309
|
-
# {Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client::Configuration::Rpcs}
|
310
|
+
# {::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client::Configuration::Rpcs}
|
310
311
|
# for a list of RPCs that can be configured independently.
|
311
312
|
#
|
312
313
|
# Configuration can be applied globally to all clients, or to a single client
|
@@ -317,22 +318,22 @@ module Google
|
|
317
318
|
# To modify the global config, setting the timeout for batch_annotate_images
|
318
319
|
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
319
320
|
#
|
320
|
-
# Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.configure do |config|
|
321
|
-
# config.timeout =
|
322
|
-
# config.rpcs.batch_annotate_images.timeout =
|
321
|
+
# ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.configure do |config|
|
322
|
+
# config.timeout = 10.0
|
323
|
+
# config.rpcs.batch_annotate_images.timeout = 20.0
|
323
324
|
# end
|
324
325
|
#
|
325
326
|
# To apply the above configuration only to a new client:
|
326
327
|
#
|
327
|
-
# client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config|
|
328
|
-
# config.timeout =
|
329
|
-
# config.rpcs.batch_annotate_images.timeout =
|
328
|
+
# client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config|
|
329
|
+
# config.timeout = 10.0
|
330
|
+
# config.rpcs.batch_annotate_images.timeout = 20.0
|
330
331
|
# end
|
331
332
|
#
|
332
333
|
# @!attribute [rw] endpoint
|
333
334
|
# The hostname or hostname:port of the service endpoint.
|
334
335
|
# Defaults to `"vision.googleapis.com"`.
|
335
|
-
# @return [String]
|
336
|
+
# @return [::String]
|
336
337
|
# @!attribute [rw] credentials
|
337
338
|
# Credentials to send with calls. You may provide any of the following types:
|
338
339
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -344,29 +345,29 @@ module Google
|
|
344
345
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
345
346
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
346
347
|
# * (`nil`) indicating no credentials
|
347
|
-
# @return [Object]
|
348
|
+
# @return [::Object]
|
348
349
|
# @!attribute [rw] scope
|
349
350
|
# The OAuth scopes
|
350
|
-
# @return [Array
|
351
|
+
# @return [::Array<::String>]
|
351
352
|
# @!attribute [rw] lib_name
|
352
353
|
# The library name as recorded in instrumentation and logging
|
353
|
-
# @return [String]
|
354
|
+
# @return [::String]
|
354
355
|
# @!attribute [rw] lib_version
|
355
356
|
# The library version as recorded in instrumentation and logging
|
356
|
-
# @return [String]
|
357
|
+
# @return [::String]
|
357
358
|
# @!attribute [rw] channel_args
|
358
359
|
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
359
360
|
# `GRPC::Core::Channel` object is provided as the credential.
|
360
|
-
# @return [Hash]
|
361
|
+
# @return [::Hash]
|
361
362
|
# @!attribute [rw] interceptors
|
362
363
|
# An array of interceptors that are run before calls are executed.
|
363
|
-
# @return [Array
|
364
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
364
365
|
# @!attribute [rw] timeout
|
365
|
-
# The call timeout in
|
366
|
-
# @return [Numeric]
|
366
|
+
# The call timeout in seconds.
|
367
|
+
# @return [::Numeric]
|
367
368
|
# @!attribute [rw] metadata
|
368
369
|
# Additional gRPC headers to be sent with the call.
|
369
|
-
# @return [Hash{Symbol
|
370
|
+
# @return [::Hash{::Symbol=>::String}]
|
370
371
|
# @!attribute [rw] retry_policy
|
371
372
|
# The retry policy. The value is a hash with the following keys:
|
372
373
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
@@ -374,25 +375,29 @@ module Google
|
|
374
375
|
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
375
376
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
376
377
|
# trigger a retry.
|
377
|
-
# @return [Hash]
|
378
|
+
# @return [::Hash]
|
379
|
+
# @!attribute [rw] quota_project
|
380
|
+
# A separate project against which to charge quota.
|
381
|
+
# @return [::String]
|
378
382
|
#
|
379
383
|
class Configuration
|
380
|
-
extend Gapic::Config
|
384
|
+
extend ::Gapic::Config
|
381
385
|
|
382
|
-
config_attr :endpoint,
|
383
|
-
config_attr :credentials,
|
386
|
+
config_attr :endpoint, "vision.googleapis.com", ::String
|
387
|
+
config_attr :credentials, nil do |value|
|
384
388
|
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
385
389
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
386
390
|
allowed.any? { |klass| klass === value }
|
387
391
|
end
|
388
|
-
config_attr :scope,
|
389
|
-
config_attr :lib_name,
|
390
|
-
config_attr :lib_version,
|
391
|
-
config_attr(:channel_args,
|
392
|
-
config_attr :interceptors,
|
393
|
-
config_attr :timeout,
|
394
|
-
config_attr :metadata,
|
395
|
-
config_attr :retry_policy,
|
392
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
393
|
+
config_attr :lib_name, nil, ::String, nil
|
394
|
+
config_attr :lib_version, nil, ::String, nil
|
395
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
396
|
+
config_attr :interceptors, nil, ::Array, nil
|
397
|
+
config_attr :timeout, nil, ::Numeric, nil
|
398
|
+
config_attr :metadata, nil, ::Hash, nil
|
399
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
400
|
+
config_attr :quota_project, nil, ::String, nil
|
396
401
|
|
397
402
|
# @private
|
398
403
|
def initialize parent_config = nil
|
@@ -408,7 +413,7 @@ module Google
|
|
408
413
|
def rpcs
|
409
414
|
@rpcs ||= begin
|
410
415
|
parent_rpcs = nil
|
411
|
-
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to?
|
416
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
412
417
|
Rpcs.new parent_rpcs
|
413
418
|
end
|
414
419
|
end
|
@@ -433,21 +438,21 @@ module Google
|
|
433
438
|
class Rpcs
|
434
439
|
##
|
435
440
|
# RPC-specific configuration for `batch_annotate_images`
|
436
|
-
# @return [Gapic::Config::Method]
|
441
|
+
# @return [::Gapic::Config::Method]
|
437
442
|
#
|
438
443
|
attr_reader :batch_annotate_images
|
439
444
|
##
|
440
445
|
# RPC-specific configuration for `async_batch_annotate_files`
|
441
|
-
# @return [Gapic::Config::Method]
|
446
|
+
# @return [::Gapic::Config::Method]
|
442
447
|
#
|
443
448
|
attr_reader :async_batch_annotate_files
|
444
449
|
|
445
450
|
# @private
|
446
451
|
def initialize parent_rpcs = nil
|
447
452
|
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
|
453
|
+
@batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
|
449
454
|
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
|
455
|
+
@async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config
|
451
456
|
|
452
457
|
yield self if block_given?
|
453
458
|
end
|