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 (#294)

* 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

* use REST transport in samples/tests

* 🦉 Updates from OwlBot post-processor

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

* revert changes to fixtures

* revert

* revert

---------

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 committed Feb 16, 2023
1 parent 5782713 commit 7744a6d
Show file tree
Hide file tree
Showing 10 changed files with 4,132 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,51 @@
]
}
}
},
"rest": {
"libraryClient": "ConnectionServiceClient",
"rpcs": {
"CreateConnection": {
"methods": [
"create_connection"
]
},
"DeleteConnection": {
"methods": [
"delete_connection"
]
},
"GetConnection": {
"methods": [
"get_connection"
]
},
"GetIamPolicy": {
"methods": [
"get_iam_policy"
]
},
"ListConnections": {
"methods": [
"list_connections"
]
},
"SetIamPolicy": {
"methods": [
"set_iam_policy"
]
},
"TestIamPermissions": {
"methods": [
"test_iam_permissions"
]
},
"UpdateConnection": {
"methods": [
"update_connection"
]
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
from .transports.base import DEFAULT_CLIENT_INFO, ConnectionServiceTransport
from .transports.grpc import ConnectionServiceGrpcTransport
from .transports.grpc_asyncio import ConnectionServiceGrpcAsyncIOTransport
from .transports.rest import ConnectionServiceRestTransport


class ConnectionServiceClientMeta(type):
Expand All @@ -72,6 +73,7 @@ class ConnectionServiceClientMeta(type):
) # type: Dict[str, Type[ConnectionServiceTransport]]
_transport_registry["grpc"] = ConnectionServiceGrpcTransport
_transport_registry["grpc_asyncio"] = ConnectionServiceGrpcAsyncIOTransport
_transport_registry["rest"] = ConnectionServiceRestTransport

def get_transport_class(
cls,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@
from .base import ConnectionServiceTransport
from .grpc import ConnectionServiceGrpcTransport
from .grpc_asyncio import ConnectionServiceGrpcAsyncIOTransport
from .rest import ConnectionServiceRestInterceptor, ConnectionServiceRestTransport

# Compile a registry of transports.
_transport_registry = OrderedDict() # type: Dict[str, Type[ConnectionServiceTransport]]
_transport_registry["grpc"] = ConnectionServiceGrpcTransport
_transport_registry["grpc_asyncio"] = ConnectionServiceGrpcAsyncIOTransport
_transport_registry["rest"] = ConnectionServiceRestTransport

__all__ = (
"ConnectionServiceTransport",
"ConnectionServiceGrpcTransport",
"ConnectionServiceGrpcAsyncIOTransport",
"ConnectionServiceRestTransport",
"ConnectionServiceRestInterceptor",
)
Loading

0 comments on commit 7744a6d

Please sign in to comment.