google-cloud-speech 1.7.0 → 1.8.0

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: ea458c462b4915aa1e540a8bfd56db9c614c64a8cb4516dc5bf3c23480569e7a
4
- data.tar.gz: 7b23f58aed674d0a1ab37f57a51622a69df1c914c22a61414bbe30ce515e23e0
3
+ metadata.gz: b9186b6047e48e41b0f0d2eccd5ea0931383f52f4fd15ae0e22a23bea03e48b8
4
+ data.tar.gz: 3b143d887d233c21664adb173114e4a3ce4006a413973d760238e98a7a00add1
5
5
  SHA512:
6
- metadata.gz: 919738423f9f173ed383aad8db0dec3832a1882f88295d96aaf325c511ddee04bde82c6ab28b2aa4a77721443c23a67e09aa998f839dc3d1ae7bc9be050529aa
7
- data.tar.gz: cafb4db868037f75c91df5f5bae26f30196794e69aaf7eb19dd4cb15879112d70838ac5a8aa1a4bc0708aab2ed58bf157d3f073b06a4a23e6e6126d2fe22d470
6
+ metadata.gz: 5093dbdf27bba90fa357be780bcf86c79bc13c174923070e6b3d1f2cb2e496da83ce1c2d5ee56100c893f1b56d4ea5e257703971c5e0af56d47282648a760d1b
7
+ data.tar.gz: 10503ba0d4534a457d584ff7234c4f4bf125ac30ef98a9b5c0f4f5829b1cf8742ccd417e78b52015df0fb9e4ee8bd4dbc5b2d2125f907d5bbc4b26eea4434fe4
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-speech-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1/latest),
75
+ [google-cloud-speech-v1p1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1p1beta1/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
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Speech
19
- VERSION = "1.7.0".freeze
19
+ VERSION = "1.8.0".freeze
20
20
  end
21
21
  end
22
22
  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 Speech service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::Speech.speech_available?}.
65
+ #
61
66
  # ## About Speech
62
67
  #
63
68
  # Service that implements Google Cloud Speech API.
@@ -79,6 +84,37 @@ module Google
79
84
  service_module.const_get(:Client).new(&block)
80
85
  end
81
86
 
87
+ ##
88
+ # Determines whether the Speech service is supported by the current client.
89
+ # If true, you can retrieve a client object by calling {Google::Cloud::Speech.speech}.
90
+ # If false, that method will raise an exception. This could happen if the given
91
+ # API version does not exist or does not support the Speech service,
92
+ # or if the versioned client gem needs an update to support the Speech service.
93
+ #
94
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
95
+ # Defaults to `:v1`.
96
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
97
+ # @return [boolean] Whether the service is available.
98
+ #
99
+ def self.speech_available? version: :v1, transport: :grpc
100
+ require "google/cloud/speech/#{version.to_s.downcase}"
101
+ package_name = Google::Cloud::Speech
102
+ .constants
103
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
104
+ .first
105
+ return false unless package_name
106
+ service_module = Google::Cloud::Speech.const_get package_name
107
+ return false unless service_module.const_defined? :Speech
108
+ service_module = service_module.const_get :Speech
109
+ if transport == :rest
110
+ return false unless service_module.const_defined? :Rest
111
+ service_module = service_module.const_get :Rest
112
+ end
113
+ service_module.const_defined? :Client
114
+ rescue ::LoadError
115
+ false
116
+ end
117
+
82
118
  ##
83
119
  # Create a new client object for Adaptation.
84
120
  #
@@ -92,6 +128,11 @@ module Google
92
128
  # You can also specify a different transport by passing `:rest` or `:grpc` in
93
129
  # the `transport` parameter.
94
130
  #
131
+ # Raises an exception if the currently installed versioned client gem for the
132
+ # given API version does not support the given transport of the Adaptation service.
133
+ # You can determine whether the method will succeed by calling
134
+ # {Google::Cloud::Speech.adaptation_available?}.
135
+ #
95
136
  # ## About Adaptation
96
137
  #
97
138
  # Service that implements Google Cloud Speech Adaptation API.
@@ -113,6 +154,37 @@ module Google
113
154
  service_module.const_get(:Client).new(&block)
114
155
  end
115
156
 
157
+ ##
158
+ # Determines whether the Adaptation service is supported by the current client.
159
+ # If true, you can retrieve a client object by calling {Google::Cloud::Speech.adaptation}.
160
+ # If false, that method will raise an exception. This could happen if the given
161
+ # API version does not exist or does not support the Adaptation service,
162
+ # or if the versioned client gem needs an update to support the Adaptation service.
163
+ #
164
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
165
+ # Defaults to `:v1`.
166
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
167
+ # @return [boolean] Whether the service is available.
168
+ #
169
+ def self.adaptation_available? version: :v1, transport: :grpc
170
+ require "google/cloud/speech/#{version.to_s.downcase}"
171
+ package_name = Google::Cloud::Speech
172
+ .constants
173
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
174
+ .first
175
+ return false unless package_name
176
+ service_module = Google::Cloud::Speech.const_get package_name
177
+ return false unless service_module.const_defined? :Adaptation
178
+ service_module = service_module.const_get :Adaptation
179
+ if transport == :rest
180
+ return false unless service_module.const_defined? :Rest
181
+ service_module = service_module.const_get :Rest
182
+ end
183
+ service_module.const_defined? :Client
184
+ rescue ::LoadError
185
+ false
186
+ end
187
+
116
188
  ##
117
189
  # Configure the google-cloud-speech library.
118
190
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-speech
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.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-core
@@ -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 Speech-to-Text API
109
106
  test_files: []