Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
docs: fix minor docstring formatting (#349)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people committed Dec 14, 2022
1 parent 4fe5a34 commit 07227a0
Show file tree
Hide file tree
Showing 57 changed files with 7,776 additions and 79 deletions.
5 changes: 0 additions & 5 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ exclude_lines =
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
1 change: 1 addition & 0 deletions docs/texttospeech_v1/services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Services for Google Cloud Texttospeech v1 API
:maxdepth: 2

text_to_speech
text_to_speech_long_audio_synthesize
6 changes: 6 additions & 0 deletions docs/texttospeech_v1/text_to_speech_long_audio_synthesize.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TextToSpeechLongAudioSynthesize
-------------------------------------------------

.. automodule:: google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize
:members:
:inherited-members:
1 change: 1 addition & 0 deletions docs/texttospeech_v1beta1/services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Services for Google Cloud Texttospeech v1beta1 API
:maxdepth: 2

text_to_speech
text_to_speech_long_audio_synthesize
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TextToSpeechLongAudioSynthesize
-------------------------------------------------

.. automodule:: google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize
:members:
:inherited-members:
16 changes: 16 additions & 0 deletions google/cloud/texttospeech/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
from google.cloud.texttospeech_v1.services.text_to_speech.client import (
TextToSpeechClient,
)
from google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.async_client import (
TextToSpeechLongAudioSynthesizeAsyncClient,
)
from google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.client import (
TextToSpeechLongAudioSynthesizeClient,
)
from google.cloud.texttospeech_v1.types.cloud_tts import (
AudioConfig,
AudioEncoding,
Expand All @@ -37,10 +43,17 @@
Voice,
VoiceSelectionParams,
)
from google.cloud.texttospeech_v1.types.cloud_tts_lrs import (
SynthesizeLongAudioMetadata,
SynthesizeLongAudioRequest,
SynthesizeLongAudioResponse,
)

__all__ = (
"TextToSpeechClient",
"TextToSpeechAsyncClient",
"TextToSpeechLongAudioSynthesizeClient",
"TextToSpeechLongAudioSynthesizeAsyncClient",
"AudioConfig",
"CustomVoiceParams",
"ListVoicesRequest",
Expand All @@ -52,4 +65,7 @@
"VoiceSelectionParams",
"AudioEncoding",
"SsmlVoiceGender",
"SynthesizeLongAudioMetadata",
"SynthesizeLongAudioRequest",
"SynthesizeLongAudioResponse",
)
14 changes: 14 additions & 0 deletions google/cloud/texttospeech_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@


from .services.text_to_speech import TextToSpeechAsyncClient, TextToSpeechClient
from .services.text_to_speech_long_audio_synthesize import (
TextToSpeechLongAudioSynthesizeAsyncClient,
TextToSpeechLongAudioSynthesizeClient,
)
from .types.cloud_tts import (
AudioConfig,
AudioEncoding,
Expand All @@ -32,19 +36,29 @@
Voice,
VoiceSelectionParams,
)
from .types.cloud_tts_lrs import (
SynthesizeLongAudioMetadata,
SynthesizeLongAudioRequest,
SynthesizeLongAudioResponse,
)

__all__ = (
"TextToSpeechAsyncClient",
"TextToSpeechLongAudioSynthesizeAsyncClient",
"AudioConfig",
"AudioEncoding",
"CustomVoiceParams",
"ListVoicesRequest",
"ListVoicesResponse",
"SsmlVoiceGender",
"SynthesisInput",
"SynthesizeLongAudioMetadata",
"SynthesizeLongAudioRequest",
"SynthesizeLongAudioResponse",
"SynthesizeSpeechRequest",
"SynthesizeSpeechResponse",
"TextToSpeechClient",
"TextToSpeechLongAudioSynthesizeClient",
"Voice",
"VoiceSelectionParams",
)
24 changes: 24 additions & 0 deletions google/cloud/texttospeech_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,30 @@
}
}
}
},
"TextToSpeechLongAudioSynthesize": {
"clients": {
"grpc": {
"libraryClient": "TextToSpeechLongAudioSynthesizeClient",
"rpcs": {
"SynthesizeLongAudio": {
"methods": [
"synthesize_long_audio"
]
}
}
},
"grpc-async": {
"libraryClient": "TextToSpeechLongAudioSynthesizeAsyncClient",
"rpcs": {
"SynthesizeLongAudio": {
"methods": [
"synthesize_long_audio"
]
}
}
}
}
}
}
}
16 changes: 16 additions & 0 deletions google/cloud/texttospeech_v1/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.12.3" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@
from google.api_core.client_options import ClientOptions
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.texttospeech_v1 import gapic_version as package_version

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

from google.longrunning import operations_pb2

from google.cloud.texttospeech_v1.types import cloud_tts

from .client import TextToSpeechClient
Expand Down Expand Up @@ -214,7 +217,7 @@ async def list_voices(
*,
language_code: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_tts.ListVoicesResponse:
r"""Returns a list of Voice supported for synthesis.
Expand Down Expand Up @@ -318,7 +321,7 @@ async def synthesize_speech(
voice: Optional[cloud_tts.VoiceSelectionParams] = None,
audio_config: Optional[cloud_tts.AudioConfig] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_tts.SynthesizeSpeechResponse:
r"""Synthesizes speech synchronously: receive results
Expand Down Expand Up @@ -445,14 +448,9 @@ async def __aexit__(self, exc_type, exc, tb):
await self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-texttospeech",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("TextToSpeechAsyncClient",)
20 changes: 9 additions & 11 deletions google/cloud/texttospeech_v1/services/text_to_speech/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.texttospeech_v1 import gapic_version as package_version

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

from google.longrunning import operations_pb2

from google.cloud.texttospeech_v1.types import cloud_tts

from .transports.base import DEFAULT_CLIENT_INFO, TextToSpeechTransport
Expand Down Expand Up @@ -443,7 +446,7 @@ def list_voices(
*,
language_code: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_tts.ListVoicesResponse:
r"""Returns a list of Voice supported for synthesis.
Expand Down Expand Up @@ -547,7 +550,7 @@ def synthesize_speech(
voice: Optional[cloud_tts.VoiceSelectionParams] = None,
audio_config: Optional[cloud_tts.AudioConfig] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_tts.SynthesizeSpeechResponse:
r"""Synthesizes speech synchronously: receive results
Expand Down Expand Up @@ -681,14 +684,9 @@ def __exit__(self, type, value, traceback):
self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-texttospeech",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("TextToSpeechClient",)
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@
from google.api_core import retry as retries
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.longrunning import operations_pb2
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.texttospeech_v1 import gapic_version as package_version
from google.cloud.texttospeech_v1.types import cloud_tts

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-texttospeech",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


class TextToSpeechTransport(abc.ABC):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.longrunning import operations_pb2
import grpc # type: ignore

from google.cloud.texttospeech_v1.types import cloud_tts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from google.api_core import gapic_v1, grpc_helpers_async
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.longrunning import operations_pb2
import grpc # type: ignore
from grpc.experimental import aio # type: ignore

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from .async_client import TextToSpeechLongAudioSynthesizeAsyncClient
from .client import TextToSpeechLongAudioSynthesizeClient

__all__ = (
"TextToSpeechLongAudioSynthesizeClient",
"TextToSpeechLongAudioSynthesizeAsyncClient",
)
Loading

0 comments on commit 07227a0

Please sign in to comment.