chore: Update gapic-generator-python to v1.6.1 by gcf-owl-bot[bot] · Pull Request #342 · googleapis/python-texttospeech · GitHub
Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/release-please.yml
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "2.12.3"
}
1 change: 0 additions & 1 deletion docs/texttospeech_v1/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ Types for Google Cloud Texttospeech v1 API

.. automodule:: google.cloud.texttospeech_v1.types
:members:
:undoc-members:
:show-inheritance:
1 change: 0 additions & 1 deletion docs/texttospeech_v1beta1/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ Types for Google Cloud Texttospeech v1beta1 API

.. automodule:: google.cloud.texttospeech_v1beta1.types
:members:
:undoc-members:
:show-inheritance:
4 changes: 4 additions & 0 deletions google/cloud/texttospeech/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.texttospeech import gapic_version as package_version

__version__ = package_version.__version__


from google.cloud.texttospeech_v1.services.text_to_speech.async_client import (
TextToSpeechAsyncClient,
Expand Down
16 changes: 16 additions & 0 deletions google/cloud/texttospeech/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}
4 changes: 4 additions & 0 deletions google/cloud/texttospeech_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.texttospeech import gapic_version as package_version

__version__ = package_version.__version__


from .services.text_to_speech import TextToSpeechAsyncClient, TextToSpeechClient
from .types.cloud_tts import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@
from collections import OrderedDict
import functools
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
)

from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
Expand Down Expand Up @@ -154,9 +164,9 @@ def transport(self) -> TextToSpeechTransport:
def __init__(
self,
*,
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, TextToSpeechTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_options: Optional[ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the text to speech client.
Expand Down Expand Up @@ -200,11 +210,11 @@ def __init__(

async def list_voices(
self,
request: Union[cloud_tts.ListVoicesRequest, dict] = None,
request: Optional[Union[cloud_tts.ListVoicesRequest, dict]] = None,
*,
language_code: str = None,
language_code: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_tts.ListVoicesResponse:
r"""Returns a list of Voice supported for synthesis.
Expand Down Expand Up @@ -235,7 +245,7 @@ async def sample_list_voices():
print(response)

Args:
request (Union[google.cloud.texttospeech_v1.types.ListVoicesRequest, dict]):
request (Optional[Union[google.cloud.texttospeech_v1.types.ListVoicesRequest, dict]]):
The request object. The top-level message sent by the
client for the `ListVoices` method.
language_code (:class:`str`):
Expand Down Expand Up @@ -302,13 +312,13 @@ async def sample_list_voices():

async def synthesize_speech(
self,
request: Union[cloud_tts.SynthesizeSpeechRequest, dict] = None,
request: Optional[Union[cloud_tts.SynthesizeSpeechRequest, dict]] = None,
*,
input: cloud_tts.SynthesisInput = None,
voice: cloud_tts.VoiceSelectionParams = None,
audio_config: cloud_tts.AudioConfig = None,
input: Optional[cloud_tts.SynthesisInput] = None,
voice: Optional[cloud_tts.VoiceSelectionParams] = None,
audio_config: Optional[cloud_tts.AudioConfig] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_tts.SynthesizeSpeechResponse:
r"""Synthesizes speech synchronously: receive results
Expand Down Expand Up @@ -352,7 +362,7 @@ async def sample_synthesize_speech():
print(response)

Args:
request (Union[google.cloud.texttospeech_v1.types.SynthesizeSpeechRequest, dict]):
request (Optional[Union[google.cloud.texttospeech_v1.types.SynthesizeSpeechRequest, dict]]):
The request object. The top-level message sent by the
client for the `SynthesizeSpeech` method.
input (:class:`google.cloud.texttospeech_v1.types.SynthesisInput`):
Expand Down
38 changes: 25 additions & 13 deletions google/cloud/texttospeech_v1/services/text_to_speech/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@
from collections import OrderedDict
import os
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)

from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
Expand Down Expand Up @@ -55,7 +66,7 @@ class TextToSpeechClientMeta(type):

def get_transport_class(
cls,
label: str = None,
label: Optional[str] = None,
) -> Type[TextToSpeechTransport]:
"""Returns an appropriate transport class.

Expand Down Expand Up @@ -330,8 +341,8 @@ def __init__(
self,
*,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, TextToSpeechTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
transport: Optional[Union[str, TextToSpeechTransport]] = None,
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the text to speech client.
Expand All @@ -345,7 +356,7 @@ def __init__(
transport (Union[str, TextToSpeechTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
Expand Down Expand Up @@ -375,6 +386,7 @@ def __init__(
client_options = client_options_lib.from_dict(client_options)
if client_options is None:
client_options = client_options_lib.ClientOptions()
client_options = cast(client_options_lib.ClientOptions, client_options)

api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
client_options
Expand Down Expand Up @@ -427,11 +439,11 @@ def __init__(

def list_voices(
self,
request: Union[cloud_tts.ListVoicesRequest, dict] = None,
request: Optional[Union[cloud_tts.ListVoicesRequest, dict]] = None,
*,
language_code: str = None,
language_code: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_tts.ListVoicesResponse:
r"""Returns a list of Voice supported for synthesis.
Expand Down Expand Up @@ -529,13 +541,13 @@ def sample_list_voices():

def synthesize_speech(
self,
request: Union[cloud_tts.SynthesizeSpeechRequest, dict] = None,
request: Optional[Union[cloud_tts.SynthesizeSpeechRequest, dict]] = None,
*,
input: cloud_tts.SynthesisInput = None,
voice: cloud_tts.VoiceSelectionParams = None,
audio_config: cloud_tts.AudioConfig = None,
input: Optional[cloud_tts.SynthesisInput] = None,
voice: Optional[cloud_tts.VoiceSelectionParams] = None,
audio_config: Optional[cloud_tts.AudioConfig] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_tts.SynthesizeSpeechResponse:
r"""Synthesizes speech synchronously: receive results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(
self,
*,
host: str = DEFAULT_HOST,
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ def __init__(
self,
*,
host: str = "texttospeech.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
scopes: Sequence[str] = None,
channel: grpc.Channel = None,
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
channel: Optional[grpc.Channel] = None,
api_mtls_endpoint: Optional[str] = None,
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
Expand Down Expand Up @@ -180,8 +180,8 @@ def __init__(
def create_channel(
cls,
host: str = "texttospeech.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
**kwargs,
Expand Down
Loading