google-cloud-vision_ai 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -1
- data/lib/google/cloud/vision_ai/version.rb +1 -1
- data/lib/google/cloud/vision_ai.rb +216 -0
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54e6687ed0e7c0c2a9ac99afb3fdbb10cc1dff0e6bc9469af8076f09321480a1
|
4
|
+
data.tar.gz: 48101540545e0ba4d956e180ae646453af4d7923aba00966198984cbf2832104
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e78e45530dd42e031a352b6f35f0ee48070df9b93aa117c0908e0de9db9989a87ff56715df384b5f2e6cc61c6b6f4d4881ffdd7d04eb00e053fb3d62d2e8a850
|
7
|
+
data.tar.gz: 930afbb4a2632a7b07332b489eb986f86dc81c1bad8162cfbe778f2502b0c92852c14d7731e710988eb9305d98f0a8d702c30f978d8258602607387458921a70
|
data/README.md
CHANGED
@@ -34,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
|
|
34
34
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/visionai.googleapis.com)
|
35
35
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
36
36
|
|
37
|
+
## Debug Logging
|
38
|
+
|
39
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
40
|
+
your application's integration with the API. When logging is activated, key
|
41
|
+
events such as requests and responses, along with data payloads and metadata
|
42
|
+
such as headers and client configuration, are logged to the standard error
|
43
|
+
stream.
|
44
|
+
|
45
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
46
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
47
|
+
customers, private keys, or other security data that could be compromising if
|
48
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
49
|
+
the principle of least access. Google also recommends that Client Library Debug
|
50
|
+
Logging be enabled only temporarily during active debugging, and not used
|
51
|
+
permanently in production.
|
52
|
+
|
53
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
54
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
55
|
+
list of client library gem names. This will select the default logging behavior,
|
56
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
57
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
58
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
59
|
+
results in logs appearing alongside your application logs in the
|
60
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
61
|
+
|
62
|
+
Debug logging also requires that the versioned clients for this service be
|
63
|
+
sufficiently recent, released after about Dec 10, 2024. If logging is not
|
64
|
+
working, try updating the versioned clients in your bundle or installed gems:
|
65
|
+
[google-cloud-vision_ai-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest).
|
66
|
+
|
37
67
|
## Supported Ruby Versions
|
38
68
|
|
39
|
-
This library is supported on Ruby
|
69
|
+
This library is supported on Ruby 3.0+.
|
40
70
|
|
41
71
|
Google provides official support for Ruby versions that are actively supported
|
42
72
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -58,6 +58,11 @@ module Google
|
|
58
58
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
59
59
|
# the `transport` parameter.
|
60
60
|
#
|
61
|
+
# Raises an exception if the currently installed versioned client gem for the
|
62
|
+
# given API version does not support the given transport of the LiveVideoAnalytics service.
|
63
|
+
# You can determine whether the method will succeed by calling
|
64
|
+
# {Google::Cloud::VisionAI.live_video_analytics_available?}.
|
65
|
+
#
|
61
66
|
# ## About LiveVideoAnalytics
|
62
67
|
#
|
63
68
|
# Service describing handlers for resources. The service enables clients to run
|
@@ -80,6 +85,37 @@ module Google
|
|
80
85
|
service_module.const_get(:Client).new(&block)
|
81
86
|
end
|
82
87
|
|
88
|
+
##
|
89
|
+
# Determines whether the LiveVideoAnalytics service is supported by the current client.
|
90
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::VisionAI.live_video_analytics}.
|
91
|
+
# If false, that method will raise an exception. This could happen if the given
|
92
|
+
# API version does not exist or does not support the LiveVideoAnalytics service,
|
93
|
+
# or if the versioned client gem needs an update to support the LiveVideoAnalytics service.
|
94
|
+
#
|
95
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
96
|
+
# Defaults to `:v1`.
|
97
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
98
|
+
# @return [boolean] Whether the service is available.
|
99
|
+
#
|
100
|
+
def self.live_video_analytics_available? version: :v1, transport: :grpc
|
101
|
+
require "google/cloud/vision_ai/#{version.to_s.downcase}"
|
102
|
+
package_name = Google::Cloud::VisionAI
|
103
|
+
.constants
|
104
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
105
|
+
.first
|
106
|
+
return false unless package_name
|
107
|
+
service_module = Google::Cloud::VisionAI.const_get package_name
|
108
|
+
return false unless service_module.const_defined? :LiveVideoAnalytics
|
109
|
+
service_module = service_module.const_get :LiveVideoAnalytics
|
110
|
+
if transport == :rest
|
111
|
+
return false unless service_module.const_defined? :Rest
|
112
|
+
service_module = service_module.const_get :Rest
|
113
|
+
end
|
114
|
+
service_module.const_defined? :Client
|
115
|
+
rescue ::LoadError
|
116
|
+
false
|
117
|
+
end
|
118
|
+
|
83
119
|
##
|
84
120
|
# Create a new client object for AppPlatform.
|
85
121
|
#
|
@@ -93,6 +129,11 @@ module Google
|
|
93
129
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
94
130
|
# the `transport` parameter.
|
95
131
|
#
|
132
|
+
# Raises an exception if the currently installed versioned client gem for the
|
133
|
+
# given API version does not support the given transport of the AppPlatform service.
|
134
|
+
# You can determine whether the method will succeed by calling
|
135
|
+
# {Google::Cloud::VisionAI.app_platform_available?}.
|
136
|
+
#
|
96
137
|
# ## About AppPlatform
|
97
138
|
#
|
98
139
|
# Service describing handlers for resources
|
@@ -114,6 +155,37 @@ module Google
|
|
114
155
|
service_module.const_get(:Client).new(&block)
|
115
156
|
end
|
116
157
|
|
158
|
+
##
|
159
|
+
# Determines whether the AppPlatform service is supported by the current client.
|
160
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::VisionAI.app_platform}.
|
161
|
+
# If false, that method will raise an exception. This could happen if the given
|
162
|
+
# API version does not exist or does not support the AppPlatform service,
|
163
|
+
# or if the versioned client gem needs an update to support the AppPlatform service.
|
164
|
+
#
|
165
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
166
|
+
# Defaults to `:v1`.
|
167
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
168
|
+
# @return [boolean] Whether the service is available.
|
169
|
+
#
|
170
|
+
def self.app_platform_available? version: :v1, transport: :grpc
|
171
|
+
require "google/cloud/vision_ai/#{version.to_s.downcase}"
|
172
|
+
package_name = Google::Cloud::VisionAI
|
173
|
+
.constants
|
174
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
175
|
+
.first
|
176
|
+
return false unless package_name
|
177
|
+
service_module = Google::Cloud::VisionAI.const_get package_name
|
178
|
+
return false unless service_module.const_defined? :AppPlatform
|
179
|
+
service_module = service_module.const_get :AppPlatform
|
180
|
+
if transport == :rest
|
181
|
+
return false unless service_module.const_defined? :Rest
|
182
|
+
service_module = service_module.const_get :Rest
|
183
|
+
end
|
184
|
+
service_module.const_defined? :Client
|
185
|
+
rescue ::LoadError
|
186
|
+
false
|
187
|
+
end
|
188
|
+
|
117
189
|
##
|
118
190
|
# Create a new client object for StreamingService.
|
119
191
|
#
|
@@ -127,6 +199,11 @@ module Google
|
|
127
199
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
128
200
|
# the `transport` parameter.
|
129
201
|
#
|
202
|
+
# Raises an exception if the currently installed versioned client gem for the
|
203
|
+
# given API version does not support the given transport of the StreamingService service.
|
204
|
+
# You can determine whether the method will succeed by calling
|
205
|
+
# {Google::Cloud::VisionAI.streaming_service_available?}.
|
206
|
+
#
|
130
207
|
# ## About StreamingService
|
131
208
|
#
|
132
209
|
# Streaming service for receiving and sending packets.
|
@@ -148,6 +225,37 @@ module Google
|
|
148
225
|
service_module.const_get(:Client).new(&block)
|
149
226
|
end
|
150
227
|
|
228
|
+
##
|
229
|
+
# Determines whether the StreamingService service is supported by the current client.
|
230
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::VisionAI.streaming_service}.
|
231
|
+
# If false, that method will raise an exception. This could happen if the given
|
232
|
+
# API version does not exist or does not support the StreamingService service,
|
233
|
+
# or if the versioned client gem needs an update to support the StreamingService service.
|
234
|
+
#
|
235
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
236
|
+
# Defaults to `:v1`.
|
237
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
238
|
+
# @return [boolean] Whether the service is available.
|
239
|
+
#
|
240
|
+
def self.streaming_service_available? version: :v1, transport: :grpc
|
241
|
+
require "google/cloud/vision_ai/#{version.to_s.downcase}"
|
242
|
+
package_name = Google::Cloud::VisionAI
|
243
|
+
.constants
|
244
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
245
|
+
.first
|
246
|
+
return false unless package_name
|
247
|
+
service_module = Google::Cloud::VisionAI.const_get package_name
|
248
|
+
return false unless service_module.const_defined? :StreamingService
|
249
|
+
service_module = service_module.const_get :StreamingService
|
250
|
+
if transport == :rest
|
251
|
+
return false unless service_module.const_defined? :Rest
|
252
|
+
service_module = service_module.const_get :Rest
|
253
|
+
end
|
254
|
+
service_module.const_defined? :Client
|
255
|
+
rescue ::LoadError
|
256
|
+
false
|
257
|
+
end
|
258
|
+
|
151
259
|
##
|
152
260
|
# Create a new client object for StreamsService.
|
153
261
|
#
|
@@ -161,6 +269,11 @@ module Google
|
|
161
269
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
162
270
|
# the `transport` parameter.
|
163
271
|
#
|
272
|
+
# Raises an exception if the currently installed versioned client gem for the
|
273
|
+
# given API version does not support the given transport of the StreamsService service.
|
274
|
+
# You can determine whether the method will succeed by calling
|
275
|
+
# {Google::Cloud::VisionAI.streams_service_available?}.
|
276
|
+
#
|
164
277
|
# ## About StreamsService
|
165
278
|
#
|
166
279
|
# Service describing handlers for resources.
|
@@ -185,6 +298,37 @@ module Google
|
|
185
298
|
service_module.const_get(:Client).new(&block)
|
186
299
|
end
|
187
300
|
|
301
|
+
##
|
302
|
+
# Determines whether the StreamsService service is supported by the current client.
|
303
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::VisionAI.streams_service}.
|
304
|
+
# If false, that method will raise an exception. This could happen if the given
|
305
|
+
# API version does not exist or does not support the StreamsService service,
|
306
|
+
# or if the versioned client gem needs an update to support the StreamsService service.
|
307
|
+
#
|
308
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
309
|
+
# Defaults to `:v1`.
|
310
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
311
|
+
# @return [boolean] Whether the service is available.
|
312
|
+
#
|
313
|
+
def self.streams_service_available? version: :v1, transport: :grpc
|
314
|
+
require "google/cloud/vision_ai/#{version.to_s.downcase}"
|
315
|
+
package_name = Google::Cloud::VisionAI
|
316
|
+
.constants
|
317
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
318
|
+
.first
|
319
|
+
return false unless package_name
|
320
|
+
service_module = Google::Cloud::VisionAI.const_get package_name
|
321
|
+
return false unless service_module.const_defined? :StreamsService
|
322
|
+
service_module = service_module.const_get :StreamsService
|
323
|
+
if transport == :rest
|
324
|
+
return false unless service_module.const_defined? :Rest
|
325
|
+
service_module = service_module.const_get :Rest
|
326
|
+
end
|
327
|
+
service_module.const_defined? :Client
|
328
|
+
rescue ::LoadError
|
329
|
+
false
|
330
|
+
end
|
331
|
+
|
188
332
|
##
|
189
333
|
# Create a new client object for Warehouse.
|
190
334
|
#
|
@@ -198,6 +342,11 @@ module Google
|
|
198
342
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
199
343
|
# the `transport` parameter.
|
200
344
|
#
|
345
|
+
# Raises an exception if the currently installed versioned client gem for the
|
346
|
+
# given API version does not support the given transport of the Warehouse service.
|
347
|
+
# You can determine whether the method will succeed by calling
|
348
|
+
# {Google::Cloud::VisionAI.warehouse_available?}.
|
349
|
+
#
|
201
350
|
# ## About Warehouse
|
202
351
|
#
|
203
352
|
# Service that manages media content + metadata for streaming.
|
@@ -219,6 +368,37 @@ module Google
|
|
219
368
|
service_module.const_get(:Client).new(&block)
|
220
369
|
end
|
221
370
|
|
371
|
+
##
|
372
|
+
# Determines whether the Warehouse service is supported by the current client.
|
373
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::VisionAI.warehouse}.
|
374
|
+
# If false, that method will raise an exception. This could happen if the given
|
375
|
+
# API version does not exist or does not support the Warehouse service,
|
376
|
+
# or if the versioned client gem needs an update to support the Warehouse service.
|
377
|
+
#
|
378
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
379
|
+
# Defaults to `:v1`.
|
380
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
381
|
+
# @return [boolean] Whether the service is available.
|
382
|
+
#
|
383
|
+
def self.warehouse_available? version: :v1, transport: :grpc
|
384
|
+
require "google/cloud/vision_ai/#{version.to_s.downcase}"
|
385
|
+
package_name = Google::Cloud::VisionAI
|
386
|
+
.constants
|
387
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
388
|
+
.first
|
389
|
+
return false unless package_name
|
390
|
+
service_module = Google::Cloud::VisionAI.const_get package_name
|
391
|
+
return false unless service_module.const_defined? :Warehouse
|
392
|
+
service_module = service_module.const_get :Warehouse
|
393
|
+
if transport == :rest
|
394
|
+
return false unless service_module.const_defined? :Rest
|
395
|
+
service_module = service_module.const_get :Rest
|
396
|
+
end
|
397
|
+
service_module.const_defined? :Client
|
398
|
+
rescue ::LoadError
|
399
|
+
false
|
400
|
+
end
|
401
|
+
|
222
402
|
##
|
223
403
|
# Create a new client object for HealthCheckService.
|
224
404
|
#
|
@@ -232,6 +412,11 @@ module Google
|
|
232
412
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
233
413
|
# the `transport` parameter.
|
234
414
|
#
|
415
|
+
# Raises an exception if the currently installed versioned client gem for the
|
416
|
+
# given API version does not support the given transport of the HealthCheckService service.
|
417
|
+
# You can determine whether the method will succeed by calling
|
418
|
+
# {Google::Cloud::VisionAI.health_check_service_available?}.
|
419
|
+
#
|
235
420
|
# ## About HealthCheckService
|
236
421
|
#
|
237
422
|
# HealthCheckService provides an interface for Vertex AI Vision Cluster Health
|
@@ -254,6 +439,37 @@ module Google
|
|
254
439
|
service_module.const_get(:Client).new(&block)
|
255
440
|
end
|
256
441
|
|
442
|
+
##
|
443
|
+
# Determines whether the HealthCheckService service is supported by the current client.
|
444
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::VisionAI.health_check_service}.
|
445
|
+
# If false, that method will raise an exception. This could happen if the given
|
446
|
+
# API version does not exist or does not support the HealthCheckService service,
|
447
|
+
# or if the versioned client gem needs an update to support the HealthCheckService service.
|
448
|
+
#
|
449
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
450
|
+
# Defaults to `:v1`.
|
451
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
452
|
+
# @return [boolean] Whether the service is available.
|
453
|
+
#
|
454
|
+
def self.health_check_service_available? version: :v1, transport: :grpc
|
455
|
+
require "google/cloud/vision_ai/#{version.to_s.downcase}"
|
456
|
+
package_name = Google::Cloud::VisionAI
|
457
|
+
.constants
|
458
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
459
|
+
.first
|
460
|
+
return false unless package_name
|
461
|
+
service_module = Google::Cloud::VisionAI.const_get package_name
|
462
|
+
return false unless service_module.const_defined? :HealthCheckService
|
463
|
+
service_module = service_module.const_get :HealthCheckService
|
464
|
+
if transport == :rest
|
465
|
+
return false unless service_module.const_defined? :Rest
|
466
|
+
service_module = service_module.const_get :Rest
|
467
|
+
end
|
468
|
+
service_module.const_defined? :Client
|
469
|
+
rescue ::LoadError
|
470
|
+
false
|
471
|
+
end
|
472
|
+
|
257
473
|
##
|
258
474
|
# Configure the google-cloud-vision_ai library.
|
259
475
|
#
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-vision_ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: google-cloud-core
|
@@ -62,7 +61,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
|
|
62
61
|
licenses:
|
63
62
|
- Apache-2.0
|
64
63
|
metadata: {}
|
65
|
-
post_install_message:
|
66
64
|
rdoc_options: []
|
67
65
|
require_paths:
|
68
66
|
- lib
|
@@ -70,15 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
70
68
|
requirements:
|
71
69
|
- - ">="
|
72
70
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
71
|
+
version: '3.0'
|
74
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
73
|
requirements:
|
76
74
|
- - ">="
|
77
75
|
- !ruby/object:Gem::Version
|
78
76
|
version: '0'
|
79
77
|
requirements: []
|
80
|
-
rubygems_version: 3.
|
81
|
-
signing_key:
|
78
|
+
rubygems_version: 3.6.2
|
82
79
|
specification_version: 4
|
83
80
|
summary: API Client library for the Vision AI API
|
84
81
|
test_files: []
|