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

Commit b610e3d

Browse files
fix: Remove unsupported fields: recognition_result and alternative_source_language_codes (#61)
PiperOrigin-RevId: 373649163 Source-Link: googleapis/googleapis@7e1b14e Source-Link: https://github.com/googleapis/googleapis-gen/commit/0a3c7d272d697796db75857bac73905c68e498c3 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
1 parent 88e60cd commit b610e3d

File tree

21 files changed

+539
-223
lines changed

21 files changed

+539
-223
lines changed

google/cloud/mediatranslation/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
32
# Copyright 2020 Google LLC
43
#
54
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,12 +14,13 @@
1514
# limitations under the License.
1615
#
1716

18-
from google.cloud.mediatranslation_v1beta1.services.speech_translation_service.async_client import (
19-
SpeechTranslationServiceAsyncClient,
20-
)
2117
from google.cloud.mediatranslation_v1beta1.services.speech_translation_service.client import (
2218
SpeechTranslationServiceClient,
2319
)
20+
from google.cloud.mediatranslation_v1beta1.services.speech_translation_service.async_client import (
21+
SpeechTranslationServiceAsyncClient,
22+
)
23+
2424
from google.cloud.mediatranslation_v1beta1.types.media_translation import (
2525
StreamingTranslateSpeechConfig,
2626
)
@@ -38,8 +38,8 @@
3838
)
3939

4040
__all__ = (
41-
"SpeechTranslationServiceAsyncClient",
4241
"SpeechTranslationServiceClient",
42+
"SpeechTranslationServiceAsyncClient",
4343
"StreamingTranslateSpeechConfig",
4444
"StreamingTranslateSpeechRequest",
4545
"StreamingTranslateSpeechResponse",

google/cloud/mediatranslation_v1beta1/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
32
# Copyright 2020 Google LLC
43
#
54
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,18 +15,20 @@
1615
#
1716

1817
from .services.speech_translation_service import SpeechTranslationServiceClient
18+
from .services.speech_translation_service import SpeechTranslationServiceAsyncClient
19+
1920
from .types.media_translation import StreamingTranslateSpeechConfig
2021
from .types.media_translation import StreamingTranslateSpeechRequest
2122
from .types.media_translation import StreamingTranslateSpeechResponse
2223
from .types.media_translation import StreamingTranslateSpeechResult
2324
from .types.media_translation import TranslateSpeechConfig
2425

25-
2626
__all__ = (
27+
"SpeechTranslationServiceAsyncClient",
28+
"SpeechTranslationServiceClient",
2729
"StreamingTranslateSpeechConfig",
2830
"StreamingTranslateSpeechRequest",
2931
"StreamingTranslateSpeechResponse",
3032
"StreamingTranslateSpeechResult",
3133
"TranslateSpeechConfig",
32-
"SpeechTranslationServiceClient",
3334
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
3+
"language": "python",
4+
"libraryPackage": "google.cloud.mediatranslation_v1beta1",
5+
"protoPackage": "google.cloud.mediatranslation.v1beta1",
6+
"schema": "1.0",
7+
"services": {
8+
"SpeechTranslationService": {
9+
"clients": {
10+
"grpc": {
11+
"libraryClient": "SpeechTranslationServiceClient",
12+
"rpcs": {
13+
"StreamingTranslateSpeech": {
14+
"methods": [
15+
"streaming_translate_speech"
16+
]
17+
}
18+
}
19+
},
20+
"grpc-async": {
21+
"libraryClient": "SpeechTranslationServiceAsyncClient",
22+
"rpcs": {
23+
"StreamingTranslateSpeech": {
24+
"methods": [
25+
"streaming_translate_speech"
26+
]
27+
}
28+
}
29+
}
30+
}
31+
}
32+
}
33+
}

google/cloud/mediatranslation_v1beta1/services/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
32
# Copyright 2020 Google LLC
43
#
54
# Licensed under the Apache License, Version 2.0 (the "License");

google/cloud/mediatranslation_v1beta1/services/speech_translation_service/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
32
# Copyright 2020 Google LLC
43
#
54
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,7 +13,6 @@
1413
# See the License for the specific language governing permissions and
1514
# limitations under the License.
1615
#
17-
1816
from .client import SpeechTranslationServiceClient
1917
from .async_client import SpeechTranslationServiceAsyncClient
2018

google/cloud/mediatranslation_v1beta1/services/speech_translation_service/async_client.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
32
# Copyright 2020 Google LLC
43
#
54
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,7 +13,6 @@
1413
# See the License for the specific language governing permissions and
1514
# limitations under the License.
1615
#
17-
1816
from collections import OrderedDict
1917
import functools
2018
import re
@@ -31,15 +29,14 @@
3129
import pkg_resources
3230

3331
import google.api_core.client_options as ClientOptions # type: ignore
34-
from google.api_core import exceptions # type: ignore
32+
from google.api_core import exceptions as core_exceptions # type: ignore
3533
from google.api_core import gapic_v1 # type: ignore
3634
from google.api_core import retry as retries # type: ignore
37-
from google.auth import credentials # type: ignore
35+
from google.auth import credentials as ga_credentials # type: ignore
3836
from google.oauth2 import service_account # type: ignore
3937

4038
from google.cloud.mediatranslation_v1beta1.types import media_translation
41-
from google.rpc import status_pb2 as status # type: ignore
42-
39+
from google.rpc import status_pb2 # type: ignore
4340
from .transports.base import SpeechTranslationServiceTransport, DEFAULT_CLIENT_INFO
4441
from .transports.grpc_asyncio import SpeechTranslationServiceGrpcAsyncIOTransport
4542
from .client import SpeechTranslationServiceClient
@@ -59,26 +56,22 @@ class SpeechTranslationServiceAsyncClient:
5956
parse_common_billing_account_path = staticmethod(
6057
SpeechTranslationServiceClient.parse_common_billing_account_path
6158
)
62-
6359
common_folder_path = staticmethod(SpeechTranslationServiceClient.common_folder_path)
6460
parse_common_folder_path = staticmethod(
6561
SpeechTranslationServiceClient.parse_common_folder_path
6662
)
67-
6863
common_organization_path = staticmethod(
6964
SpeechTranslationServiceClient.common_organization_path
7065
)
7166
parse_common_organization_path = staticmethod(
7267
SpeechTranslationServiceClient.parse_common_organization_path
7368
)
74-
7569
common_project_path = staticmethod(
7670
SpeechTranslationServiceClient.common_project_path
7771
)
7872
parse_common_project_path = staticmethod(
7973
SpeechTranslationServiceClient.parse_common_project_path
8074
)
81-
8275
common_location_path = staticmethod(
8376
SpeechTranslationServiceClient.common_location_path
8477
)
@@ -88,7 +81,8 @@ class SpeechTranslationServiceAsyncClient:
8881

8982
@classmethod
9083
def from_service_account_info(cls, info: dict, *args, **kwargs):
91-
"""Creates an instance of this client using the provided credentials info.
84+
"""Creates an instance of this client using the provided credentials
85+
info.
9286
9387
Args:
9488
info (dict): The service account private key info.
@@ -103,7 +97,7 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
10397
@classmethod
10498
def from_service_account_file(cls, filename: str, *args, **kwargs):
10599
"""Creates an instance of this client using the provided credentials
106-
file.
100+
file.
107101
108102
Args:
109103
filename (str): The path to the service account private key json
@@ -120,7 +114,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
120114

121115
@property
122116
def transport(self) -> SpeechTranslationServiceTransport:
123-
"""Return the transport used by the client instance.
117+
"""Returns the transport used by the client instance.
124118
125119
Returns:
126120
SpeechTranslationServiceTransport: The transport used by the client instance.
@@ -135,12 +129,12 @@ def transport(self) -> SpeechTranslationServiceTransport:
135129
def __init__(
136130
self,
137131
*,
138-
credentials: credentials.Credentials = None,
132+
credentials: ga_credentials.Credentials = None,
139133
transport: Union[str, SpeechTranslationServiceTransport] = "grpc_asyncio",
140134
client_options: ClientOptions = None,
141135
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
142136
) -> None:
143-
"""Instantiate the speech translation service client.
137+
"""Instantiates the speech translation service client.
144138
145139
Args:
146140
credentials (Optional[google.auth.credentials.Credentials]): The
@@ -172,7 +166,6 @@ def __init__(
172166
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
173167
creation failed for any reason.
174168
"""
175-
176169
self._client = SpeechTranslationServiceClient(
177170
credentials=credentials,
178171
transport=transport,

0 commit comments

Comments
 (0)