google-cloud-automl 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ac295115d39303979f27d5e2f21e309096062cdd726e5453f530308981ed5c6
4
- data.tar.gz: ad39d81074324e2b5c92af68e2e15907e0f7b786ddf3ac5695407e67346eb681
3
+ metadata.gz: d550fc6bd21ded468ddee19ead616df475c49daec46ac6dade21cddfb2a887a5
4
+ data.tar.gz: 68f1dd7e7208b29e5c5402555576f0cfedef14506a2662701a48e1eb72e12d18
5
5
  SHA512:
6
- metadata.gz: dfc69bbd140006f893580154340aa40e46c475aa0acb09a76fba3b302e497d046da2a7817391093a89c90e029a7d30ba05283780437ef19b65f6862d96976a34
7
- data.tar.gz: 2a9d74cc086f6bfb21c7629f505a6763448ca7c9208b5651cb5f7a25a473e5fa1f85093dbe45a263b1f5d73c9f90b912560755f8d90299a488dc0acafde5cbd4
6
+ metadata.gz: 5cce1b1939ac8e575ecdf44dd47573d5f9b6a4608a5f7ff7aca5b203249839c26c344ffa2dd2b473220f35fbc649c750bc8bad851aacc1b2f78d22deea3f606a
7
+ data.tar.gz: e8f06799e3a0745492f91c796c05acf957546f5e8ab23340e498158231372fa185a1918b24a82be324f7401bb284e512721076ed602fe6ee0e84aa4ff1be6d1f
data/README.md CHANGED
@@ -43,9 +43,40 @@ and includes substantial interface changes. Existing code written for earlier
43
43
  versions of this library will likely require updates to use this version.
44
44
  See the {file:MIGRATING.md MIGRATING.md} document for more information.
45
45
 
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ Debug logging also requires that the versioned clients for this service be
72
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
73
+ working, try updating the versioned clients in your bundle or installed gems:
74
+ [google-cloud-automl-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-automl-v1/latest),
75
+ [google-cloud-automl-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-automl-v1beta1/latest).
76
+
46
77
  ## Supported Ruby Versions
47
78
 
48
- This library is supported on Ruby 2.7+.
79
+ This library is supported on Ruby 3.0+.
49
80
 
50
81
  Google provides official support for Ruby versions that are actively supported
51
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module AutoML
23
- VERSION = "1.5.0"
23
+ VERSION = "1.6.0"
24
24
  end
25
25
  end
26
26
  end
@@ -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 PredictionService service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::AutoML.prediction_service_available?}.
65
+ #
61
66
  # ## About PredictionService
62
67
  #
63
68
  # AutoML Prediction API.
@@ -82,6 +87,37 @@ module Google
82
87
  service_module.const_get(:Client).new(&block)
83
88
  end
84
89
 
90
+ ##
91
+ # Determines whether the PredictionService service is supported by the current client.
92
+ # If true, you can retrieve a client object by calling {Google::Cloud::AutoML.prediction_service}.
93
+ # If false, that method will raise an exception. This could happen if the given
94
+ # API version does not exist or does not support the PredictionService service,
95
+ # or if the versioned client gem needs an update to support the PredictionService service.
96
+ #
97
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
98
+ # Defaults to `:v1`.
99
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
100
+ # @return [boolean] Whether the service is available.
101
+ #
102
+ def self.prediction_service_available? version: :v1, transport: :grpc
103
+ require "google/cloud/automl/#{version.to_s.downcase}"
104
+ package_name = Google::Cloud::AutoML
105
+ .constants
106
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
107
+ .first
108
+ return false unless package_name
109
+ service_module = Google::Cloud::AutoML.const_get package_name
110
+ return false unless service_module.const_defined? :PredictionService
111
+ service_module = service_module.const_get :PredictionService
112
+ if transport == :rest
113
+ return false unless service_module.const_defined? :Rest
114
+ service_module = service_module.const_get :Rest
115
+ end
116
+ service_module.const_defined? :Client
117
+ rescue ::LoadError
118
+ false
119
+ end
120
+
85
121
  ##
86
122
  # Create a new client object for AutoML.
87
123
  #
@@ -95,6 +131,11 @@ module Google
95
131
  # You can also specify a different transport by passing `:rest` or `:grpc` in
96
132
  # the `transport` parameter.
97
133
  #
134
+ # Raises an exception if the currently installed versioned client gem for the
135
+ # given API version does not support the given transport of the AutoML service.
136
+ # You can determine whether the method will succeed by calling
137
+ # {Google::Cloud::AutoML.automl_available?}.
138
+ #
98
139
  # ## About AutoML
99
140
  #
100
141
  # AutoML Server API.
@@ -129,6 +170,37 @@ module Google
129
170
  service_module.const_get(:Client).new(&block)
130
171
  end
131
172
 
173
+ ##
174
+ # Determines whether the AutoML service is supported by the current client.
175
+ # If true, you can retrieve a client object by calling {Google::Cloud::AutoML.automl}.
176
+ # If false, that method will raise an exception. This could happen if the given
177
+ # API version does not exist or does not support the AutoML service,
178
+ # or if the versioned client gem needs an update to support the AutoML service.
179
+ #
180
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
181
+ # Defaults to `:v1`.
182
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
183
+ # @return [boolean] Whether the service is available.
184
+ #
185
+ def self.automl_available? version: :v1, transport: :grpc
186
+ require "google/cloud/automl/#{version.to_s.downcase}"
187
+ package_name = Google::Cloud::AutoML
188
+ .constants
189
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
190
+ .first
191
+ return false unless package_name
192
+ service_module = Google::Cloud::AutoML.const_get package_name
193
+ return false unless service_module.const_defined? :AutoML
194
+ service_module = service_module.const_get :AutoML
195
+ if transport == :rest
196
+ return false unless service_module.const_defined? :Rest
197
+ service_module = service_module.const_get :Rest
198
+ end
199
+ service_module.const_defined? :Client
200
+ rescue ::LoadError
201
+ false
202
+ end
203
+
132
204
  ##
133
205
  # Configure the google-cloud-automl library.
134
206
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-automl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-26 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-automl-v1
@@ -87,7 +86,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
87
86
  licenses:
88
87
  - Apache-2.0
89
88
  metadata: {}
90
- post_install_message:
91
89
  rdoc_options: []
92
90
  require_paths:
93
91
  - lib
@@ -95,15 +93,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
93
  requirements:
96
94
  - - ">="
97
95
  - !ruby/object:Gem::Version
98
- version: '2.7'
96
+ version: '3.0'
99
97
  required_rubygems_version: !ruby/object:Gem::Requirement
100
98
  requirements:
101
99
  - - ">="
102
100
  - !ruby/object:Gem::Version
103
101
  version: '0'
104
102
  requirements: []
105
- rubygems_version: 3.5.6
106
- signing_key:
103
+ rubygems_version: 3.6.2
107
104
  specification_version: 4
108
105
  summary: API Client library for the Cloud AutoML API
109
106
  test_files: []