From 641516224405ac91e08d5fee161a5fcde4ed0ba0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 16:13:08 -0500 Subject: [PATCH] docs: Add documentation for enums (#355) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: https://github.com/googleapis/googleapis/commit/a391fd1dac18dfdfa00c18c8404f2c3a6ff8e98e Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../services/text_to_speech/client.py | 2 +- .../client.py | 2 +- .../cloud/texttospeech_v1/types/cloud_tts.py | 58 ++++++++++++++++ .../services/text_to_speech/client.py | 2 +- .../client.py | 2 +- .../texttospeech_v1beta1/types/cloud_tts.py | 68 +++++++++++++++++++ ...metadata_google.cloud.texttospeech.v1.json | 2 +- ...ata_google.cloud.texttospeech.v1beta1.json | 2 +- 8 files changed, 132 insertions(+), 6 deletions(-) diff --git a/google/cloud/texttospeech_v1/services/text_to_speech/client.py b/google/cloud/texttospeech_v1/services/text_to_speech/client.py index 5eda490b..4a3b20d9 100644 --- a/google/cloud/texttospeech_v1/services/text_to_speech/client.py +++ b/google/cloud/texttospeech_v1/services/text_to_speech/client.py @@ -670,7 +670,7 @@ def sample_synthesize_speech(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "TextToSpeechClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/client.py b/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/client.py index 13f26aea..b0d95d69 100644 --- a/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/client.py +++ b/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/client.py @@ -557,7 +557,7 @@ def sample_synthesize_long_audio(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "TextToSpeechLongAudioSynthesizeClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/texttospeech_v1/types/cloud_tts.py b/google/cloud/texttospeech_v1/types/cloud_tts.py index 26268473..3dfe694f 100644 --- a/google/cloud/texttospeech_v1/types/cloud_tts.py +++ b/google/cloud/texttospeech_v1/types/cloud_tts.py @@ -38,6 +38,24 @@ class SsmlVoiceGender(proto.Enum): r"""Gender of the voice as described in `SSML voice element `__. + + Values: + SSML_VOICE_GENDER_UNSPECIFIED (0): + An unspecified gender. + In VoiceSelectionParams, this means that the + client doesn't care which gender the selected + voice will have. In the Voice field of + ListVoicesResponse, this may mean that the voice + doesn't fit any of the other categories in this + enum, or that the gender of the voice isn't + known. + MALE (1): + A male voice. + FEMALE (2): + A female voice. + NEUTRAL (3): + A gender-neutral voice. This voice is not yet + supported. """ SSML_VOICE_GENDER_UNSPECIFIED = 0 MALE = 1 @@ -48,6 +66,32 @@ class SsmlVoiceGender(proto.Enum): class AudioEncoding(proto.Enum): r"""Configuration to set up audio encoder. The encoding determines the output audio format that we'd like. + + Values: + AUDIO_ENCODING_UNSPECIFIED (0): + Not specified. Will return result + [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + LINEAR16 (1): + Uncompressed 16-bit signed little-endian + samples (Linear PCM). Audio content returned as + LINEAR16 also contains a WAV header. + MP3 (2): + MP3 audio at 32kbps. + OGG_OPUS (3): + Opus encoded audio wrapped in an ogg + container. The result will be a file which can + be played natively on Android, and in browsers + (at least Chrome and Firefox). The quality of + the encoding is considerably higher than MP3 + while using approximately the same bitrate. + MULAW (5): + 8-bit samples that compand 14-bit audio + samples using G.711 PCMU/mu-law. Audio content + returned as MULAW also contains a WAV header. + ALAW (6): + 8-bit samples that compand 14-bit audio + samples using G.711 PCMU/A-law. Audio content + returned as ALAW also contains a WAV header. """ AUDIO_ENCODING_UNSPECIFIED = 0 LINEAR16 = 1 @@ -353,6 +397,20 @@ class ReportedUsage(proto.Enum): r"""The usage of the synthesized audio. You must report your honest and correct usage of the service as it's regulated by contract and will cause significant difference in billing. + + Values: + REPORTED_USAGE_UNSPECIFIED (0): + Request with reported usage unspecified will + be rejected. + REALTIME (1): + For scenarios where the synthesized audio is + not downloadable and can only be used once. For + example, real-time request in IVR system. + OFFLINE (2): + For scenarios where the synthesized audio is + downloadable and can be reused. For example, the + synthesized audio is downloaded, stored in + customer service system and played repeatedly. """ REPORTED_USAGE_UNSPECIFIED = 0 REALTIME = 1 diff --git a/google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py b/google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py index bbf5726a..de7c3edc 100644 --- a/google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py +++ b/google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py @@ -670,7 +670,7 @@ def sample_synthesize_speech(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "TextToSpeechClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/texttospeech_v1beta1/services/text_to_speech_long_audio_synthesize/client.py b/google/cloud/texttospeech_v1beta1/services/text_to_speech_long_audio_synthesize/client.py index d9dcd9b7..cac198b3 100644 --- a/google/cloud/texttospeech_v1beta1/services/text_to_speech_long_audio_synthesize/client.py +++ b/google/cloud/texttospeech_v1beta1/services/text_to_speech_long_audio_synthesize/client.py @@ -557,7 +557,7 @@ def sample_synthesize_long_audio(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "TextToSpeechLongAudioSynthesizeClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/texttospeech_v1beta1/types/cloud_tts.py b/google/cloud/texttospeech_v1beta1/types/cloud_tts.py index f97a7302..35469139 100644 --- a/google/cloud/texttospeech_v1beta1/types/cloud_tts.py +++ b/google/cloud/texttospeech_v1beta1/types/cloud_tts.py @@ -39,6 +39,24 @@ class SsmlVoiceGender(proto.Enum): r"""Gender of the voice as described in `SSML voice element `__. + + Values: + SSML_VOICE_GENDER_UNSPECIFIED (0): + An unspecified gender. + In VoiceSelectionParams, this means that the + client doesn't care which gender the selected + voice will have. In the Voice field of + ListVoicesResponse, this may mean that the voice + doesn't fit any of the other categories in this + enum, or that the gender of the voice isn't + known. + MALE (1): + A male voice. + FEMALE (2): + A female voice. + NEUTRAL (3): + A gender-neutral voice. This voice is not yet + supported. """ SSML_VOICE_GENDER_UNSPECIFIED = 0 MALE = 1 @@ -49,6 +67,34 @@ class SsmlVoiceGender(proto.Enum): class AudioEncoding(proto.Enum): r"""Configuration to set up audio encoder. The encoding determines the output audio format that we'd like. + + Values: + AUDIO_ENCODING_UNSPECIFIED (0): + Not specified. Will return result + [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + LINEAR16 (1): + Uncompressed 16-bit signed little-endian + samples (Linear PCM). Audio content returned as + LINEAR16 also contains a WAV header. + MP3 (2): + MP3 audio at 32kbps. + MP3_64_KBPS (4): + MP3 at 64kbps. + OGG_OPUS (3): + Opus encoded audio wrapped in an ogg + container. The result will be a file which can + be played natively on Android, and in browsers + (at least Chrome and Firefox). The quality of + the encoding is considerably higher than MP3 + while using approximately the same bitrate. + MULAW (5): + 8-bit samples that compand 14-bit audio + samples using G.711 PCMU/mu-law. Audio content + returned as MULAW also contains a WAV header. + ALAW (6): + 8-bit samples that compand 14-bit audio + samples using G.711 PCMU/A-law. Audio content + returned as ALAW also contains a WAV header. """ AUDIO_ENCODING_UNSPECIFIED = 0 LINEAR16 = 1 @@ -156,6 +202,14 @@ class SynthesizeSpeechRequest(proto.Message): class TimepointType(proto.Enum): r"""The type of timepoint information that is returned in the response. + + Values: + TIMEPOINT_TYPE_UNSPECIFIED (0): + Not specified. No timepoint information will + be returned. + SSML_MARK (1): + Timepoint information of ```` tags in SSML input will + be returned. """ TIMEPOINT_TYPE_UNSPECIFIED = 0 SSML_MARK = 1 @@ -370,6 +424,20 @@ class ReportedUsage(proto.Enum): r"""The usage of the synthesized audio. You must report your honest and correct usage of the service as it's regulated by contract and will cause significant difference in billing. + + Values: + REPORTED_USAGE_UNSPECIFIED (0): + Request with reported usage unspecified will + be rejected. + REALTIME (1): + For scenarios where the synthesized audio is + not downloadable and can only be used once. For + example, real-time request in IVR system. + OFFLINE (2): + For scenarios where the synthesized audio is + downloadable and can be reused. For example, the + synthesized audio is downloaded, stored in + customer service system and played repeatedly. """ REPORTED_USAGE_UNSPECIFIED = 0 REALTIME = 1 diff --git a/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1.json index 42d8226f..0735eb51 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-texttospeech", - "version": "2.14.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1beta1.json index 8873e8de..e94d8681 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-texttospeech", - "version": "2.14.0" + "version": "0.1.0" }, "snippets": [ {