Skip to content

Commit 232f258

Browse files
docs: fix minor docstring formatting (#349)
* fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: googleapis/googleapis@fea4387 Source-Link: googleapis/googleapis-gen@387b734 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py * feat: add LRS API PiperOrigin-RevId: 493338018 Source-Link: googleapis/googleapis@380b2f0 Source-Link: googleapis/googleapis-gen@5802e4b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTgwMmU0YmQyNDRmMTFhYmY4OGM4ZWUzOTY4ZGMxZDcyODFjNDk2YSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add LRS API PiperOrigin-RevId: 493606501 Source-Link: googleapis/googleapis@a1b5429 Source-Link: googleapis/googleapis-gen@ea4e780 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWE0ZTc4MDJiN2RhN2RiM2EyZjQyMmE1ZGJmNGUzZjRmOGM2MDY3ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: fix minor docstring formatting PiperOrigin-RevId: 495308712 Source-Link: googleapis/googleapis@45c90e2 Source-Link: googleapis/googleapis-gen@61828bb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjE4MjhiYmRjZjAwYWVhYmZlZDNmNTVlZDBmOWNiNTI1MmVmOWQ0NiJ9 * 🦉 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> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent a435b19 commit 232f258

File tree

57 files changed

+7776
-79
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+7776
-79
lines changed

packages/google-cloud-texttospeech/.coveragerc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ exclude_lines =
1010
pragma: NO COVER
1111
# Ignore debug-only repr
1212
def __repr__
13-
# Ignore pkg_resources exceptions.
14-
# This is added at the module level as a safeguard for if someone
15-
# generates the code and tries to run it without pip installing. This
16-
# makes it virtually impossible to test properly.
17-
except pkg_resources.DistributionNotFound

packages/google-cloud-texttospeech/docs/texttospeech_v1/services.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ Services for Google Cloud Texttospeech v1 API
44
:maxdepth: 2
55

66
text_to_speech
7+
text_to_speech_long_audio_synthesize
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
TextToSpeechLongAudioSynthesize
2+
-------------------------------------------------
3+
4+
.. automodule:: google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize
5+
:members:
6+
:inherited-members:

packages/google-cloud-texttospeech/docs/texttospeech_v1beta1/services.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ Services for Google Cloud Texttospeech v1beta1 API
44
:maxdepth: 2
55

66
text_to_speech
7+
text_to_speech_long_audio_synthesize
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
TextToSpeechLongAudioSynthesize
2+
-------------------------------------------------
3+
4+
.. automodule:: google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize
5+
:members:
6+
:inherited-members:

packages/google-cloud-texttospeech/google/cloud/texttospeech/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
from google.cloud.texttospeech_v1.services.text_to_speech.client import (
2525
TextToSpeechClient,
2626
)
27+
from google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.async_client import (
28+
TextToSpeechLongAudioSynthesizeAsyncClient,
29+
)
30+
from google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.client import (
31+
TextToSpeechLongAudioSynthesizeClient,
32+
)
2733
from google.cloud.texttospeech_v1.types.cloud_tts import (
2834
AudioConfig,
2935
AudioEncoding,
@@ -37,10 +43,17 @@
3743
Voice,
3844
VoiceSelectionParams,
3945
)
46+
from google.cloud.texttospeech_v1.types.cloud_tts_lrs import (
47+
SynthesizeLongAudioMetadata,
48+
SynthesizeLongAudioRequest,
49+
SynthesizeLongAudioResponse,
50+
)
4051

4152
__all__ = (
4253
"TextToSpeechClient",
4354
"TextToSpeechAsyncClient",
55+
"TextToSpeechLongAudioSynthesizeClient",
56+
"TextToSpeechLongAudioSynthesizeAsyncClient",
4457
"AudioConfig",
4558
"CustomVoiceParams",
4659
"ListVoicesRequest",
@@ -52,4 +65,7 @@
5265
"VoiceSelectionParams",
5366
"AudioEncoding",
5467
"SsmlVoiceGender",
68+
"SynthesizeLongAudioMetadata",
69+
"SynthesizeLongAudioRequest",
70+
"SynthesizeLongAudioResponse",
5571
)

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020

2121
from .services.text_to_speech import TextToSpeechAsyncClient, TextToSpeechClient
22+
from .services.text_to_speech_long_audio_synthesize import (
23+
TextToSpeechLongAudioSynthesizeAsyncClient,
24+
TextToSpeechLongAudioSynthesizeClient,
25+
)
2226
from .types.cloud_tts import (
2327
AudioConfig,
2428
AudioEncoding,
@@ -32,19 +36,29 @@
3236
Voice,
3337
VoiceSelectionParams,
3438
)
39+
from .types.cloud_tts_lrs import (
40+
SynthesizeLongAudioMetadata,
41+
SynthesizeLongAudioRequest,
42+
SynthesizeLongAudioResponse,
43+
)
3544

3645
__all__ = (
3746
"TextToSpeechAsyncClient",
47+
"TextToSpeechLongAudioSynthesizeAsyncClient",
3848
"AudioConfig",
3949
"AudioEncoding",
4050
"CustomVoiceParams",
4151
"ListVoicesRequest",
4252
"ListVoicesResponse",
4353
"SsmlVoiceGender",
4454
"SynthesisInput",
55+
"SynthesizeLongAudioMetadata",
56+
"SynthesizeLongAudioRequest",
57+
"SynthesizeLongAudioResponse",
4558
"SynthesizeSpeechRequest",
4659
"SynthesizeSpeechResponse",
4760
"TextToSpeechClient",
61+
"TextToSpeechLongAudioSynthesizeClient",
4862
"Voice",
4963
"VoiceSelectionParams",
5064
)

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/gapic_metadata.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,30 @@
3838
}
3939
}
4040
}
41+
},
42+
"TextToSpeechLongAudioSynthesize": {
43+
"clients": {
44+
"grpc": {
45+
"libraryClient": "TextToSpeechLongAudioSynthesizeClient",
46+
"rpcs": {
47+
"SynthesizeLongAudio": {
48+
"methods": [
49+
"synthesize_long_audio"
50+
]
51+
}
52+
}
53+
},
54+
"grpc-async": {
55+
"libraryClient": "TextToSpeechLongAudioSynthesizeAsyncClient",
56+
"rpcs": {
57+
"SynthesizeLongAudio": {
58+
"methods": [
59+
"synthesize_long_audio"
60+
]
61+
}
62+
}
63+
}
64+
}
4165
}
4266
}
4367
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "2.12.3" # {x-release-please-version}

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@
3434
from google.api_core.client_options import ClientOptions
3535
from google.auth import credentials as ga_credentials # type: ignore
3636
from google.oauth2 import service_account # type: ignore
37-
import pkg_resources
37+
38+
from google.cloud.texttospeech_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
4142
except AttributeError: # pragma: NO COVER
4243
OptionalRetry = Union[retries.Retry, object] # type: ignore
4344

45+
from google.longrunning import operations_pb2
46+
4447
from google.cloud.texttospeech_v1.types import cloud_tts
4548

4649
from .client import TextToSpeechClient
@@ -214,7 +217,7 @@ async def list_voices(
214217
*,
215218
language_code: Optional[str] = None,
216219
retry: OptionalRetry = gapic_v1.method.DEFAULT,
217-
timeout: Optional[float] = None,
220+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
218221
metadata: Sequence[Tuple[str, str]] = (),
219222
) -> cloud_tts.ListVoicesResponse:
220223
r"""Returns a list of Voice supported for synthesis.
@@ -318,7 +321,7 @@ async def synthesize_speech(
318321
voice: Optional[cloud_tts.VoiceSelectionParams] = None,
319322
audio_config: Optional[cloud_tts.AudioConfig] = None,
320323
retry: OptionalRetry = gapic_v1.method.DEFAULT,
321-
timeout: Optional[float] = None,
324+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
322325
metadata: Sequence[Tuple[str, str]] = (),
323326
) -> cloud_tts.SynthesizeSpeechResponse:
324327
r"""Synthesizes speech synchronously: receive results
@@ -445,14 +448,9 @@ async def __aexit__(self, exc_type, exc, tb):
445448
await self.transport.close()
446449

447450

448-
try:
449-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
450-
gapic_version=pkg_resources.get_distribution(
451-
"google-cloud-texttospeech",
452-
).version,
453-
)
454-
except pkg_resources.DistributionNotFound:
455-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
451+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
452+
gapic_version=package_version.__version__
453+
)
456454

457455

458456
__all__ = ("TextToSpeechAsyncClient",)

0 commit comments

Comments
 (0)