google-cloud-dataqna 0.5.1 → 0.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: 7795678834b4a824a9b9ba83b5b9fdc29d560fc9afe35ccf5fb22edd7c40199e
4
- data.tar.gz: acfbf984b7c1dcde6529b9a8ee4ea5a7aeb77b215c68b1e31764ae3175bc0205
3
+ metadata.gz: 1023a0a7fd85a15a126dc7ab540083178580dc5e324ec3c7f133db04c340b449
4
+ data.tar.gz: adccacbe7eb87d28d0d24668ad765cdbf427ae20d3d252a21dd6d538cd481bcc
5
5
  SHA512:
6
- metadata.gz: 2352f44d6ac647a47562ea1266e23ad15bf10e10332bc398e3cd5c74d20eb65ee024ca154dd08dc665ede9bc02dbf1957c89cd7f4239b2202d0d5f68bd94dda9
7
- data.tar.gz: b9c58a2e15ecf95244392b8d4e57eb967b4c678d0f754328817db32c209843ba425667b64d1cf45a8640f8245828d24336c5fa2da1c091c273b8e18d8f3b1b51
6
+ metadata.gz: 7b642281cec9cad12776a9f3f7f2d33c476bc04378dc80643364c89ad504fc2340500302dcd62752f4b68eac66d81e5221b176349f543418f372a574aab2a715
7
+ data.tar.gz: ada3c929224bf04383bcc2093303e1dea4f28c88d2112f0c661b0f3397d0a9cee10c432be8bda046bfeeb8fd1beeb9286a143027f1eec9686a811e6e86aa5534
data/README.md CHANGED
@@ -31,35 +31,39 @@ In order to use this library, you first need to go through the following steps:
31
31
  1. [Enable the API.](https://console.cloud.google.com/apis/library/dataqna.googleapis.com)
32
32
  1. {file:AUTHENTICATION.md Set up authentication.}
33
33
 
34
- ## Enabling Logging
35
-
36
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
37
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
38
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
39
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
40
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
41
-
42
- Configuring a Ruby stdlib logger:
43
-
44
- ```ruby
45
- require "logger"
46
-
47
- module MyLogger
48
- LOGGER = Logger.new $stderr, level: Logger::WARN
49
- def logger
50
- LOGGER
51
- end
52
- end
53
-
54
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
55
- module GRPC
56
- extend MyLogger
57
- end
58
- ```
34
+ ## Debug Logging
35
+
36
+ This library comes with opt-in Debug Logging that can help you troubleshoot
37
+ your application's integration with the API. When logging is activated, key
38
+ events such as requests and responses, along with data payloads and metadata
39
+ such as headers and client configuration, are logged to the standard error
40
+ stream.
41
+
42
+ **WARNING:** Client Library Debug Logging includes your data payloads in
43
+ plaintext, which could include sensitive data such as PII for yourself or your
44
+ customers, private keys, or other security data that could be compromising if
45
+ leaked. Always practice good data hygiene with your application logs, and follow
46
+ the principle of least access. Google also recommends that Client Library Debug
47
+ Logging be enabled only temporarily during active debugging, and not used
48
+ permanently in production.
49
+
50
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
51
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
52
+ list of client library gem names. This will select the default logging behavior,
53
+ which writes logs to the standard error stream. On a local workstation, this may
54
+ result in logs appearing on the console. When running on a Google Cloud hosting
55
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
56
+ results in logs appearing alongside your application logs in the
57
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
58
+
59
+ Debug logging also requires that the versioned clients for this service be
60
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
61
+ working, try updating the versioned clients in your bundle or installed gems:
62
+ [google-cloud-dataqna-v1alpha](https://cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest).
59
63
 
60
64
  ## Supported Ruby Versions
61
65
 
62
- This library is supported on Ruby 2.7+.
66
+ This library is supported on Ruby 3.0+.
63
67
 
64
68
  Google provides official support for Ruby versions that are actively supported
65
69
  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 DataQnA
23
- VERSION = "0.5.1"
23
+ VERSION = "0.6.0"
24
24
  end
25
25
  end
26
26
  end
@@ -56,6 +56,11 @@ module Google
56
56
  # supported by that API version, and the corresponding gem is available, the
57
57
  # appropriate versioned client will be returned.
58
58
  #
59
+ # Raises an exception if the currently installed versioned client gem for the
60
+ # given API version does not support the AutoSuggestionService service.
61
+ # You can determine whether the method will succeed by calling
62
+ # {Google::Cloud::DataQnA.auto_suggestion_service_available?}.
63
+ #
59
64
  # ## About AutoSuggestionService
60
65
  #
61
66
  # This stateless API provides automatic suggestions for natural language
@@ -140,6 +145,32 @@ module Google
140
145
  service_module.const_get(:Client).new(&block)
141
146
  end
142
147
 
148
+ ##
149
+ # Determines whether the AutoSuggestionService service is supported by the current client.
150
+ # If true, you can retrieve a client object by calling {Google::Cloud::DataQnA.auto_suggestion_service}.
151
+ # If false, that method will raise an exception. This could happen if the given
152
+ # API version does not exist or does not support the AutoSuggestionService service,
153
+ # or if the versioned client gem needs an update to support the AutoSuggestionService service.
154
+ #
155
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
156
+ # Defaults to `:v1alpha`.
157
+ # @return [boolean] Whether the service is available.
158
+ #
159
+ def self.auto_suggestion_service_available? version: :v1alpha
160
+ require "google/cloud/dataqna/#{version.to_s.downcase}"
161
+ package_name = Google::Cloud::DataQnA
162
+ .constants
163
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
164
+ .first
165
+ return false unless package_name
166
+ service_module = Google::Cloud::DataQnA.const_get package_name
167
+ return false unless service_module.const_defined? :AutoSuggestionService
168
+ service_module = service_module.const_get :AutoSuggestionService
169
+ service_module.const_defined? :Client
170
+ rescue ::LoadError
171
+ false
172
+ end
173
+
143
174
  ##
144
175
  # Create a new client object for QuestionService.
145
176
  #
@@ -151,6 +182,11 @@ module Google
151
182
  # supported by that API version, and the corresponding gem is available, the
152
183
  # appropriate versioned client will be returned.
153
184
  #
185
+ # Raises an exception if the currently installed versioned client gem for the
186
+ # given API version does not support the QuestionService service.
187
+ # You can determine whether the method will succeed by calling
188
+ # {Google::Cloud::DataQnA.question_service_available?}.
189
+ #
154
190
  # ## About QuestionService
155
191
  #
156
192
  # Service to interpret natural language queries.
@@ -184,6 +220,32 @@ module Google
184
220
  service_module.const_get(:Client).new(&block)
185
221
  end
186
222
 
223
+ ##
224
+ # Determines whether the QuestionService service is supported by the current client.
225
+ # If true, you can retrieve a client object by calling {Google::Cloud::DataQnA.question_service}.
226
+ # If false, that method will raise an exception. This could happen if the given
227
+ # API version does not exist or does not support the QuestionService service,
228
+ # or if the versioned client gem needs an update to support the QuestionService service.
229
+ #
230
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
231
+ # Defaults to `:v1alpha`.
232
+ # @return [boolean] Whether the service is available.
233
+ #
234
+ def self.question_service_available? version: :v1alpha
235
+ require "google/cloud/dataqna/#{version.to_s.downcase}"
236
+ package_name = Google::Cloud::DataQnA
237
+ .constants
238
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
239
+ .first
240
+ return false unless package_name
241
+ service_module = Google::Cloud::DataQnA.const_get package_name
242
+ return false unless service_module.const_defined? :QuestionService
243
+ service_module = service_module.const_get :QuestionService
244
+ service_module.const_defined? :Client
245
+ rescue ::LoadError
246
+ false
247
+ end
248
+
187
249
  ##
188
250
  # Configure the google-cloud-dataqna library.
189
251
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-dataqna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.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-08-09 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-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: '2.7'
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.5.6
81
- signing_key:
78
+ rubygems_version: 3.6.2
82
79
  specification_version: 4
83
80
  summary: API Client library for the BigQuery Data QnA API
84
81
  test_files: []