Skip to content

Commit

Permalink
feat: enable "rest" transport in Python for services supporting numer…
Browse files Browse the repository at this point in the history
…ic enums (#362)

* feat: enable "rest" transport in Python for services supporting numeric enums

PiperOrigin-RevId: 508143576

Source-Link: googleapis/googleapis@7a702a9

Source-Link: googleapis/googleapis-gen@6ad1279
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmFkMTI3OWMwZTdhYTc4N2FjNmI2NmM5ZmQ0YTIxMDY5MmVkZmZjZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: Update gapic-generator-python to v1.8.5

PiperOrigin-RevId: 511892190

Source-Link: googleapis/googleapis@a45d9c0

Source-Link: googleapis/googleapis-gen@1907294
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTkwNzI5NGIxZDgzNjVlYTI0ZjhjNWYyZTA1OWE2NDEyNGM0ZWQzYiJ9

* 🦉 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 authored Feb 28, 2023
1 parent 1d31bec commit 0796003
Show file tree
Hide file tree
Showing 22 changed files with 3,422 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@
]
}
}
},
"rest": {
"libraryClient": "TextToSpeechClient",
"rpcs": {
"ListVoices": {
"methods": [
"list_voices"
]
},
"SynthesizeSpeech": {
"methods": [
"synthesize_speech"
]
}
}
}
}
},
Expand All @@ -60,6 +75,16 @@
]
}
}
},
"rest": {
"libraryClient": "TextToSpeechLongAudioSynthesizeClient",
"rpcs": {
"SynthesizeLongAudio": {
"methods": [
"synthesize_long_audio"
]
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from .transports.base import DEFAULT_CLIENT_INFO, TextToSpeechTransport
from .transports.grpc import TextToSpeechGrpcTransport
from .transports.grpc_asyncio import TextToSpeechGrpcAsyncIOTransport
from .transports.rest import TextToSpeechRestTransport


class TextToSpeechClientMeta(type):
Expand All @@ -66,6 +67,7 @@ class TextToSpeechClientMeta(type):
_transport_registry = OrderedDict() # type: Dict[str, Type[TextToSpeechTransport]]
_transport_registry["grpc"] = TextToSpeechGrpcTransport
_transport_registry["grpc_asyncio"] = TextToSpeechGrpcAsyncIOTransport
_transport_registry["rest"] = TextToSpeechRestTransport

def get_transport_class(
cls,
Expand Down Expand Up @@ -359,6 +361,9 @@ def __init__(
transport (Union[str, TextToSpeechTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
NOTE: "rest" transport functionality is currently in a
beta state (preview). We welcome your feedback via an
issue in this library's source repository.
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@
from .base import TextToSpeechTransport
from .grpc import TextToSpeechGrpcTransport
from .grpc_asyncio import TextToSpeechGrpcAsyncIOTransport
from .rest import TextToSpeechRestInterceptor, TextToSpeechRestTransport

# Compile a registry of transports.
_transport_registry = OrderedDict() # type: Dict[str, Type[TextToSpeechTransport]]
_transport_registry["grpc"] = TextToSpeechGrpcTransport
_transport_registry["grpc_asyncio"] = TextToSpeechGrpcAsyncIOTransport
_transport_registry["rest"] = TextToSpeechRestTransport

__all__ = (
"TextToSpeechTransport",
"TextToSpeechGrpcTransport",
"TextToSpeechGrpcAsyncIOTransport",
"TextToSpeechRestTransport",
"TextToSpeechRestInterceptor",
)
Loading

0 comments on commit 0796003

Please sign in to comment.