8000 docs: Add documentation for enums (#355) · googleapis/google-cloud-python@51a0288 · GitHub
[go: up one dir, main page]

Skip to content

Commit 51a0288

Browse files
docs: Add documentation for enums (#355)
* 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: googleapis/googleapis@a391fd1 Source-Link: googleapis/googleapis-gen@0080f83 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 55cef84 commit 51a0288

File tree

8 files changed

+132
-6
lines changed

8 files changed

+132
-6
lines changed

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def sample_synthesize_speech():
670670
# Done; return the response.
671671
return response
672672

673-
def __enter__(self):
673+
def __enter__(self) -> "TextToSpeechClient":
674674
return self
675675

676676
def __exit__(self, type, value, traceback):

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def sample_synthesize_long_audio():
557557
# Done; return the response.
558558
return response
559559

560-
def __enter__(self):
560+
def __enter__(self) -> "TextToSpeechLongAudioSynthesizeClient":
561561
return self
562562

563563
def __exit__(self, type, value, traceback):

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/cloud_tts.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@
3838
class SsmlVoiceGender(proto.Enum):
3939
r"""Gender of the voice as described in `SSML voice
4040
element <https://www.w3.org/TR/speech-synthesis11/#edef_voice>`__.
41+
42+
Values:
43+
SSML_VOICE_GENDER_UNSPECIFIED (0):
44+
An unspecified gender.
45+
In VoiceSelectionParams, this means that the
46+
client doesn't care which gender the selected
47+
voice will have. In the Voice field of
48+
ListVoicesResponse, this may mean that the voice
49+
doesn't fit any of the other categories in this
50+
enum, or that the gender of the voice isn't
51+
known.
52+
MALE (1):
53+
A male voice.
54+
FEMALE (2):
55+
A female voice.
56+
NEUTRAL (3):
57+
A gender-neutral voice. This voice is not yet
58+
supported.
4159
"""
4260
SSML_VOICE_GENDER_UNSPECIFIED = 0
4361
MALE = 1
@@ -48,6 +66,32 @@ class SsmlVoiceGender(proto.Enum):
4866
class AudioEncoding(proto.Enum):
4967
r"""Configuration to set up audio encoder. The encoding
5068
determines the output audio format that we'd like.
69+
70+
Values:
71+
AUDIO_ENCODING_UNSPECIFIED (0):
72+
Not specified. Will return result
73+
[google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
74+
LINEAR16 (1):
75+
Uncompressed 16-bit signed little-endian
76+
samples (Linear PCM). Audio content returned as
77+
LINEAR16 also contains a WAV header.
78+
MP3 (2):
79+
MP3 audio at 32kbps.
80+
OGG_OPUS (3):
81+
Opus encoded audio wrapped in an ogg
82+
container. The result will be a file which can
83+
be played natively on Android, and in browsers
84+
(at least Chrome and Firefox). The quality of
85+
the encoding is considerably higher than MP3
86+
while using approximately the same bitrate.
87+
MULAW (5):
88+
8-bit samples that compand 14-bit audio
89+
samples using G.711 PCMU/mu-law. Audio content
90+
returned as MULAW also contains a WAV header.
91+
ALAW (6):
92+
8-bit samples that compand 14-bit audio
93+
samples using G.711 PCMU/A-law. Audio content
94+
returned as ALAW also contains a WAV header.
5195
"""
5296
AUDIO_ENCODING_UNSPECIFIED = 0
5397
LINEAR16 = 1
@@ -353,6 +397,20 @@ class ReportedUsage(proto.Enum):
353397
r"""The usage of the synthesized audio. You must report your
354398
honest and correct usage of the service as it's regulated by
355399
contract and will cause significant difference in billing.
400+
401+
Values:
402+
REPORTED_USAGE_UNSPECIFIED (0):
403+
Request with reported usage unspecified will
404+
be rejected.
405+
REALTIME (1):
406+
For scenarios where the synthesized audio is
407+
not downloadable and can only be used once. For
408+
example, real-time request in IVR system.
409+
OFFLINE (2):
410+
For scenarios where the synthesized audio is
411+
downloadable and can be reused. For example, the
412+
synthesized audio is downloaded, stored in
413+
customer service system and played repeatedly.
356414
"""
357415
REPORTED_USAGE_UNSPECIFIED = 0
358416
REALTIME = 1

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def sample_synthesize_speech():
670670
# Done; return the response.
671671
return response
672672

673-
def __enter__(self):
673+
def __enter__(self) -> "TextToSpeechClient":
674674
return self
675675

676676
def __exit__(self, type, value, traceback):

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/services/text_to_speech_long_audio_synthesize/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def sample_synthesize_long_audio():
557557
# Done; return the response.
558558
return response
559559

560-
def __enter__(self):
560+
def __enter__(self) -> "TextToSpeechLongAudioSynthesizeClient":
561561
return self
562562

563563
def __exit__(self, type, value, traceback):

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/types/cloud_tts.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@
3939
class SsmlVoiceGender(proto.Enum):
4040
r"""Gender of the voice as described in `SSML voice
4141
element <https://www.w3.org/TR/speech-synthesis11/#edef_voice>`__.
42+
43+
Values:
44+
SSML_VOICE_GENDER_UNSPECIFIED (0):
45+
An unspecified gender.
46+
In VoiceSelectionParams, this means that the
47+
client doesn't care which gender the selected
48+
voice will have. In the Voice field of
49+
ListVoicesResponse, this may mean that the voice
50+
doesn't fit any of the other categories in this
51+
enum, or that the gender of the voice isn't
52+
known.
53+
MALE (1):
54+
A male voice.
55+
FEMALE (2):
56+
A female voice.
57+
NEUTRAL (3):
58+
A gender-neutral voice. This voice is not yet
59+
supported.
4260
"""
4361
SSML_VOICE_GENDER_UNSPECIFIED = 0
4462
MALE = 1
@@ -49,6 +67,34 @@ class SsmlVoiceGender(proto.Enum):
4967
class AudioEncoding(proto.Enum):
5068
r"""Configuration to set up audio encoder. The encoding
5169
determines the output audio format that we'd like.
70+
71+
Values:
72+
AUDIO_ENCODING_UNSPECIFIED (0):
73+
Not specified. Will return result
74+
[google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
75+
LINEAR16 (1):
76+
Uncompressed 16-bit signed little-endian
77+
samples (Linear PCM). Audio content returned as
78+
LINEAR16 also contains a WAV header.
79+
MP3 (2):
80+
MP3 audio at 32kbps.
81+
MP3_64_KBPS (4):
82+
MP3 at 64kbps.
83+
OGG_OPUS (3):
84+
Opus encoded audio wrapped in an ogg
85+
container. The result will be a file which can
86+
be played natively on Android, and in browsers
87+
(at least Chrome and Firefox). The quality of
88+
the encoding is considerably higher than MP3
89+
while using approximately the same bitrate.
90+
MULAW (5):
91+
8-bit samples that compand 14-bit audio
92+
samples using G.711 PCMU/mu-law. Audio content
93+
returned as MULAW also contains a WAV header.
94+
ALAW (6):
95+
8-bit samples that compand 14-bit audio
96+
samples using G.711 PCMU/A-law. Audio content
97+
returned as ALAW also contains a WAV header.
5298
"""
5399
AUDIO_ENCODING_UNSPECIFIED = 0
54100
LINEAR16 = 1
@@ -156,6 +202,14 @@ class SynthesizeSpeechRequest(proto.Message):
156202
class TimepointType(proto.Enum):
157203
r"""The type of timepoint information that is returned in the
158204
response.
205+
206+
Values:
207+
TIMEPOINT_TYPE_UNSPECIFIED (0):
208+
Not specified. No timepoint information will
209+
be returned.
210+
SSML_MARK (1):
211+
Timepoint information of ``<mark>`` tags in SSML input will
212+
be returned.
159213
"""
160214
TIMEPOINT_TYPE_UNSPECIFIED = 0
161215
SSML_MARK = 1
@@ -370,6 +424,20 @@ class ReportedUsage(proto.Enum):
370424
r"""The usage of the synthesized audio. You must report your
371425
honest and correct usage of the service as it's regulated by
372426
contract and will cause significant difference in billing.
427+
428+
Values:
429+
REPORTED_USAGE_UNSPECIFIED (0):
430+
Request with reported usage unspecified will
431+
be rejected.
432+
REALTIME (1):
433+
For scenarios where the synthesized audio is
434+
not downloadable and can only be used once. For
435+
example, real-time request in IVR system.
436+
OFFLINE (2):
437+
For scenarios where the synthesized audio is
438+
downloadable and can be reused. For example, the
439+
synthesized audio is downloaded, stored in
440+
customer service system and played repeatedly.
373441
"""
374442
REPORTED_USAGE_UNSPECIFIED = 0
375443
REALTIME = 1

packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-texttospeech",
11-
"version": "2.14.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1beta1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-texttospeech",
11-
"version": "2.14.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)
0