google-cloud-text_to_speech 1.1.0 → 1.1.1

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: d59186996a1418b65e467a28e6df399fb77db0850b98b872ede8726ad63fd514
4
- data.tar.gz: 87585f82c0f93f943c669e0fc0ea75b5c3cd5a6344402b07b054ee42ea4c97a5
3
+ metadata.gz: 7644a242f0fdb02d68e4fd6ecd7a56b8787e28b693e8ac5a6c6b74ec8fdf9abf
4
+ data.tar.gz: fe457fd08ebdc624063122203c4e906d63cc89f33eaff67f4ad220c7352fa02c
5
5
  SHA512:
6
- metadata.gz: feb2984e799bc2539ae858d26c83fa0773577f54587b066d44e812846d1fcacf231f8cd4eb497836c8647ca6b8b257caee44d20d9a89d0cd72d26465cb8c2c7d
7
- data.tar.gz: 5dbfdd112c6adfe3b3d89677ab0e7519b9ae642d8c08055e4a7d090ccd039ca4cdd5ff4fef50119caf817ff7ed2932eaec8fadbc4b5cb70742e8a9e08526a5f3
6
+ metadata.gz: ad9950862c86f20a973d1b487154da13dc82cc970423e1b5970107ba31a88172393b80e617a05f14bb0a8bf8bda64b99c8f2c2d175fb6aeb1e89af40399c7a01
7
+ data.tar.gz: e0f94c1b174c911c64e99b14e24ff0c97425c78e542be2fd352d73c2ee60fa5a56b72bc07352f6af05a2abc03a5fc96df8d1c88eda8057453513de38bd644574
@@ -26,6 +26,10 @@ To summarize:
26
26
  specifies whether they are required or optional. Additionally, you can pass
27
27
  a proto request object instead of separate arguments. See
28
28
  [Passing Arguments](#passing-arguments) for more info.
29
+ * Previously, clients reported RPC errors by raising instances of
30
+ `Google::Gax::GaxError` and its subclasses. Now, RPC exceptions are of type
31
+ `Google::Cloud::Error` and its subclasses. See
32
+ [Handling Errors](#handling-errors) for more info.
29
33
  * Some classes have moved into different namespaces. See
30
34
  [Class Namespaces](#class-namespaces) for more info.
31
35
 
@@ -207,6 +211,53 @@ response = client.synthesize_speech(
207
211
  )
208
212
  ```
209
213
 
214
+ ### Handling Errors
215
+
216
+ The client reports standard
217
+ [gRPC error codes](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)
218
+ by raising exceptions. In older releases, these exceptions were located in the
219
+ `Google::Gax` namespace and were subclasses of the `Google::Gax::GaxError` base
220
+ exception class, defined in the `google-gax` gem. However, these classes were
221
+ different from the standard exceptions (subclasses of `Google::Cloud::Error`)
222
+ thrown by other client libraries such as `google-cloud-storage`.
223
+
224
+ The 1.0 client library now uses the `Google::Cloud::Error` exception hierarchy,
225
+ for consistency across all the Google Cloud client libraries. In general, these
226
+ exceptions have the same name as their counterparts from older releases, but
227
+ are located in the `Google::Cloud` namespace rather than the `Google::Gax`
228
+ namespace.
229
+
230
+ Old:
231
+ ```
232
+ client = Google::Cloud::TextToSpeech.new
233
+
234
+ input = { text: "Hello, world!" }
235
+ voice = { language_code: "en-US" }
236
+ audio = { audio_encoding: Google::Cloud::Texttospeech::V1::AudioEncoding::MP3 }
237
+
238
+ begin
239
+ response = client.synthesize_speech input, voice, audio
240
+ rescue Google::Gax::Error => e
241
+ # Handle exceptions that subclass Google::Gax::Error
242
+ end
243
+ ```
244
+
245
+ New:
246
+ ```
247
+ client = Google::Cloud::TextToSpeech.text_to_speech
248
+
249
+ input = { text: "Hello, world!" }
250
+ voice = { language_code: "en-US" }
251
+ audio = { audio_encoding: Google::Cloud::TextToSpeech::V1::AudioEncoding::MP3 }
252
+
253
+ begin
254
+ response = client.synthesize_speech input: input, voice: voice,
255
+ audio_config: audio
256
+ rescue Google::Cloud::Error => e
257
+ # Handle exceptions that subclass Google::Cloud::Error
258
+ end
259
+ ```
260
+
210
261
  ### Class Namespaces
211
262
 
212
263
  In older releases, some data type (protobuf) classes were located under the module
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module TextToSpeech
23
- VERSION = "1.1.0"
23
+ VERSION = "1.1.1"
24
24
  end
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-text_to_speech
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core