google-cloud-dataqna 0.5.1 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7795678834b4a824a9b9ba83b5b9fdc29d560fc9afe35ccf5fb22edd7c40199e
4
- data.tar.gz: acfbf984b7c1dcde6529b9a8ee4ea5a7aeb77b215c68b1e31764ae3175bc0205
3
+ metadata.gz: 52ede2cd35c3895408e9974373c86a24ed4d3fe7734474f2751cdbd61720eada
4
+ data.tar.gz: 8436272c6ab6c5c20e56974899884d3aa4dd77bfe72c0d77d83b7c1007455059
5
5
  SHA512:
6
- metadata.gz: 2352f44d6ac647a47562ea1266e23ad15bf10e10332bc398e3cd5c74d20eb65ee024ca154dd08dc665ede9bc02dbf1957c89cd7f4239b2202d0d5f68bd94dda9
7
- data.tar.gz: b9c58a2e15ecf95244392b8d4e57eb967b4c678d0f754328817db32c209843ba425667b64d1cf45a8640f8245828d24336c5fa2da1c091c273b8e18d8f3b1b51
6
+ metadata.gz: 5297639337b284a1d3d60545e628f52e7f80d69ddf97b15aad04ed4c946c13c8e5743d945b19544b68d06995b2f2360e4cd7bd8e36e44efe7afda040e3ed030f
7
+ data.tar.gz: a9b60b2678eeefa577e47733913987deb0db5bfd51accd1be440c32d8ef52a7f8f99cf3850077fe1c0613f584cec954388cf49ccd3da58adc47d2e1b02036056
data/README.md CHANGED
@@ -7,7 +7,7 @@ Data QnA is a natural language question and answer service for BigQuery data.
7
7
  Actual client classes for the various versions of this API are defined in
8
8
  _versioned_ client gems, with names of the form `google-cloud-dataqna-v*`.
9
9
  The gem `google-cloud-dataqna` is the main client library that brings the
10
- verisoned gems in as dependencies, and provides high-level methods for
10
+ versioned gems in as dependencies, and provides high-level methods for
11
11
  constructing clients. More information on versioned clients can be found below
12
12
  in the section titled *Which client should I use?*.
13
13
 
@@ -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.1"
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.1
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: 1980-01-02 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.8
82
79
  specification_version: 4
83
80
  summary: API Client library for the BigQuery Data QnA API
84
81
  test_files: []