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

fix: add async client to %name_%version/init.py chore: add autogenerated snippets chore: remove auth, policy, and options from the reserved names list feat: support self-signed JWT flow for service accounts chore: enable GAPIC metadata generation chore: sort subpackages in %namespace/%name/init.py #59

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/feature_fragments
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@













}
10 changes: 5 additions & 5 deletions google/cloud/mediatranslation/__init__.py
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions google/cloud/mediatranslation_v1beta1/__init__.py
Original file line number Diff line number Diff line change
@@ -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,19 @@
#

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__ = (
"SpeechTranslationServiceClient",
"StreamingTranslateSpeechConfig",
"StreamingTranslateSpeechRequest",
"StreamingTranslateSpeechResponse",
"StreamingTranslateSpeechResult",
"TranslateSpeechConfig",
"SpeechTranslationServiceClient",
)
33 changes: 33 additions & 0 deletions google/cloud/mediatranslation_v1beta1/gapic_metadata.json
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 Down Expand Up @@ -135,7 +128,7 @@ 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,
Expand Down Expand Up @@ -172,7 +165,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
Original file line number Diff line number Diff line change
@@ -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
from distutils import util
import os
Expand All @@ -33,18 +31,17 @@
import pkg_resources

from google.api_core import client_options as client_options_lib # 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.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.exceptions import MutualTLSChannelError # 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 import SpeechTranslationServiceGrpcTransport
from .transports.grpc_asyncio import SpeechTranslationServiceGrpcAsyncIOTransport
Expand Down Expand Up @@ -229,7 +226,7 @@ def parse_common_location_path(path: str) -> Dict[str, str]:
def __init__(
self,
*,
credentials: Optional[credentials.Credentials] = None,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, SpeechTranslationServiceTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
from typing import Dict, Type

Expand Down