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

Commit

Permalink
fix: Remove unsupported fields: recognition_result and alternative_so…
Browse files Browse the repository at this point in the history
…urce_language_codes (#61)

PiperOrigin-RevId: 373649163

Source-Link: googleapis/googleapis@7e1b14e

Source-Link: googleapis/googleapis-gen@0a3c7d2

docs: Add more comments for supported audio type.
chore: upgrade gapic-generator-python to 0.46.3
fix: add async client to %name_%version/init.py
feat: support self-signed JWT flow for service accounts
chore: enable GAPIC metadata generation
chore: sort subpackages in %namespace/%name/init.py
  • Loading branch information
gcf-owl-bot[bot] committed May 21, 2021
1 parent 88e60cd commit b610e3d
Show file tree
Hide file tree
Showing 21 changed files with 539 additions and 223 deletions.
10 changes: 5 additions & 5 deletions google/cloud/mediatranslation/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,12 +14,13 @@
# limitations under the License.
#

from google.cloud.mediatranslation_v1beta1.services.speech_translation_service.async_client import (
SpeechTranslationServiceAsyncClient,
)
from google.cloud.mediatranslation_v1beta1.services.speech_translation_service.client import (
SpeechTranslationServiceClient,
)
from google.cloud.mediatranslation_v1beta1.services.speech_translation_service.async_client import (
SpeechTranslationServiceAsyncClient,
)

from google.cloud.mediatranslation_v1beta1.types.media_translation import (
StreamingTranslateSpeechConfig,
)
Expand All @@ -38,8 +38,8 @@
)

__all__ = (
"SpeechTranslationServiceAsyncClient",
"SpeechTranslationServiceClient",
"SpeechTranslationServiceAsyncClient",
"StreamingTranslateSpeechConfig",
"StreamingTranslateSpeechRequest",
"StreamingTranslateSpeechResponse",
Expand Down
7 changes: 4 additions & 3 deletions google/cloud/mediatranslation_v1beta1/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,18 +15,20 @@
#

from .services.speech_translation_service import SpeechTranslationServiceClient
from .services.speech_translation_service import SpeechTranslationServiceAsyncClient

from .types.media_translation import StreamingTranslateSpeechConfig
from .types.media_translation import StreamingTranslateSpeechRequest
from .types.media_translation import StreamingTranslateSpeechResponse
from .types.media_translation import StreamingTranslateSpeechResult
from .types.media_translation import TranslateSpeechConfig


__all__ = (
"SpeechTranslationServiceAsyncClient",
"SpeechTranslationServiceClient",
"StreamingTranslateSpeechConfig",
"StreamingTranslateSpeechRequest",
"StreamingTranslateSpeechResponse",
"StreamingTranslateSpeechResult",
"TranslateSpeechConfig",
"SpeechTranslationServiceClient",
)
33 changes: 33 additions & 0 deletions google/cloud/mediatranslation_v1beta1/gapic_metadata.json
@@ -0,0 +1,33 @@
{
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
"language": "python",
"libraryPackage": "google.cloud.mediatranslation_v1beta1",
"protoPackage": "google.cloud.mediatranslation.v1beta1",
"schema": "1.0",
"services": {
"SpeechTranslationService": {
"clients": {
"grpc": {
"libraryClient": "SpeechTranslationServiceClient",
"rpcs": {
"StreamingTranslateSpeech": {
"methods": [
"streaming_translate_speech"
]
}
}
},
"grpc-async": {
"libraryClient": "SpeechTranslationServiceAsyncClient",
"rpcs": {
"StreamingTranslateSpeech": {
"methods": [
"streaming_translate_speech"
]
}
}
}
}
}
}
}
1 change: 0 additions & 1 deletion google/cloud/mediatranslation_v1beta1/services/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from .client import SpeechTranslationServiceClient
from .async_client import SpeechTranslationServiceAsyncClient

Expand Down
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from collections import OrderedDict
import functools
import re
Expand All @@ -31,15 +29,14 @@
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

from google.cloud.mediatranslation_v1beta1.types import media_translation
from google.rpc import status_pb2 as status # type: ignore

from google.rpc import status_pb2 # type: ignore
from .transports.base import SpeechTranslationServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc_asyncio import SpeechTranslationServiceGrpcAsyncIOTransport
from .client import SpeechTranslationServiceClient
Expand All @@ -59,26 +56,22 @@ class SpeechTranslationServiceAsyncClient:
parse_common_billing_account_path = staticmethod(
SpeechTranslationServiceClient.parse_common_billing_account_path
)

common_folder_path = staticmethod(SpeechTranslationServiceClient.common_folder_path)
parse_common_folder_path = staticmethod(
SpeechTranslationServiceClient.parse_common_folder_path
)

common_organization_path = staticmethod(
SpeechTranslationServiceClient.common_organization_path
)
parse_common_organization_path = staticmethod(
SpeechTranslationServiceClient.parse_common_organization_path
)

common_project_path = staticmethod(
SpeechTranslationServiceClient.common_project_path
)
parse_common_project_path = staticmethod(
SpeechTranslationServiceClient.parse_common_project_path
)

common_location_path = staticmethod(
SpeechTranslationServiceClient.common_location_path
)
Expand All @@ -88,7 +81,8 @@ class SpeechTranslationServiceAsyncClient:

@classmethod
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials info.
"""Creates an instance of this client using the provided credentials
info.
Args:
info (dict): The service account private key info.
Expand All @@ -103,7 +97,7 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.
file.
Args:
filename (str): The path to the service account private key json
Expand All @@ -120,7 +114,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):

@property
def transport(self) -> SpeechTranslationServiceTransport:
"""Return the transport used by the client instance.
"""Returns the transport used by the client instance.
Returns:
SpeechTranslationServiceTransport: The transport used by the client instance.
Expand All @@ -135,12 +129,12 @@ def transport(self) -> SpeechTranslationServiceTransport:
def __init__(
self,
*,
credentials: credentials.Credentials = None,
credentials: ga_credentials.Credentials = None,
transport: Union[str, SpeechTranslationServiceTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the speech translation service client.
"""Instantiates the speech translation service client.
Args:
credentials (Optional[google.auth.credentials.Credentials]): The
Expand Down Expand Up @@ -172,7 +166,6 @@ def __init__(
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
creation failed for any reason.
"""

self._client = SpeechTranslationServiceClient(
credentials=credentials,
transport=transport,
Expand Down

0 comments on commit b610e3d

Please sign in to comment.