Skip to content

Commit 9d3ca48

Browse files
feat: Add support for REST transport (#68)
* feat: enable REST transport for Python Preview clients PiperOrigin-RevId: 474571730 Source-Link: googleapis/googleapis@5a9ee4d Source-Link: googleapis/googleapis-gen@ceafe52 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2VhZmU1MjFmMTM3NjgwZmRlZTJmOWNhOWUxOTQ3Y2RkODI1MDcwZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): require google-api-core>=1.33.1,>=2.8.0 * fix(deps): require protobuf >= 3.20.1 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 057cec5 commit 9d3ca48

12 files changed

+1183
-12
lines changed

packages/google-cloud-eventarc-publishing/google/cloud/eventarc_publishing_v1/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@
3636
]
3737
}
3838
}
39+
},
40+
"rest": {
41+
"libraryClient": "PublisherClient",
42+
"rpcs": {
43+
"PublishChannelConnectionEvents": {
44+
"methods": [
45+
"publish_channel_connection_events"
46+
]
47+
},
48+
"PublishEvents": {
49+
"methods": [
50+
"publish_events"
51+
]
52+
}
53+
}
3954
}
4055
}
4156
}

packages/google-cloud-eventarc-publishing/google/cloud/eventarc_publishing_v1/services/publisher/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from .transports.base import PublisherTransport, DEFAULT_CLIENT_INFO
3939
from .transports.grpc import PublisherGrpcTransport
4040
from .transports.grpc_asyncio import PublisherGrpcAsyncIOTransport
41+
from .transports.rest import PublisherRestTransport
4142

4243

4344
class PublisherClientMeta(type):
@@ -51,6 +52,7 @@ class PublisherClientMeta(type):
5152
_transport_registry = OrderedDict() # type: Dict[str, Type[PublisherTransport]]
5253
_transport_registry["grpc"] = PublisherGrpcTransport
5354
_transport_registry["grpc_asyncio"] = PublisherGrpcAsyncIOTransport
55+
_transport_registry["rest"] = PublisherRestTransport
5456

5557
def get_transport_class(
5658
cls,
@@ -346,6 +348,9 @@ def __init__(
346348
transport (Union[str, PublisherTransport]): The
347349
transport to use. If set to None, a transport is chosen
348350
automatically.
351+
NOTE: "rest" transport functionality is currently in a
352+
beta state (preview). We welcome your feedback via an
353+
issue in this library's source repository.
349354
client_options (google.api_core.client_options.ClientOptions): Custom options for the
350355
client. It won't take effect if a ``transport`` instance is provided.
351356
(1) The ``api_endpoint`` property can be used to override the

packages/google-cloud-eventarc-publishing/google/cloud/eventarc_publishing_v1/services/publisher/transports/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,20 @@
1919
from .base import PublisherTransport
2020
from .grpc import PublisherGrpcTransport
2121
from .grpc_asyncio import PublisherGrpcAsyncIOTransport
22+
from .rest import PublisherRestTransport
23+
from .rest import PublisherRestInterceptor
2224

2325

2426
# Compile a registry of transports.
2527
_transport_registry = OrderedDict() # type: Dict[str, Type[PublisherTransport]]
2628
_transport_registry["grpc"] = PublisherGrpcTransport
2729
_transport_registry["grpc_asyncio"] = PublisherGrpcAsyncIOTransport
30+
_transport_registry["rest"] = PublisherRestTransport
2831

2932
__all__ = (
3033
"PublisherTransport",
3134
"PublisherGrpcTransport",
3235
"PublisherGrpcAsyncIOTransport",
36+
"PublisherRestTransport",
37+
"PublisherRestInterceptor",
3338
)

0 commit comments

Comments
 (0)