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

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

Merged
merged 8 commits into from Feb 16, 2023
Merged
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
45 changes: 45 additions & 0 deletions google/cloud/bigquery_connection_v1/gapic_metadata.json
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
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
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",
)