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

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

Merged
merged 2 commits into from
Feb 9, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions google/cloud/workflows_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,36 @@
]
}
}
},
"rest": {
"libraryClient": "WorkflowsClient",
"rpcs": {
"CreateWorkflow": {
"methods": [
"create_workflow"
]
},
"DeleteWorkflow": {
"methods": [
"delete_workflow"
]
},
"GetWorkflow": {
"methods": [
"get_workflow"
]
},
"ListWorkflows": {
"methods": [
"list_workflows"
]
},
"UpdateWorkflow": {
"methods": [
"update_workflow"
]
}
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/workflows_v1/services/workflows/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
from .transports.base import DEFAULT_CLIENT_INFO, WorkflowsTransport
from .transports.grpc import WorkflowsGrpcTransport
from .transports.grpc_asyncio import WorkflowsGrpcAsyncIOTransport
from .transports.rest import WorkflowsRestTransport


class WorkflowsClientMeta(type):
Expand All @@ -71,6 +72,7 @@ class WorkflowsClientMeta(type):
_transport_registry = OrderedDict() # type: Dict[str, Type[WorkflowsTransport]]
_transport_registry["grpc"] = WorkflowsGrpcTransport
_transport_registry["grpc_asyncio"] = WorkflowsGrpcAsyncIOTransport
_transport_registry["rest"] = WorkflowsRestTransport

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 WorkflowsTransport
from .grpc import WorkflowsGrpcTransport
from .grpc_asyncio import WorkflowsGrpcAsyncIOTransport
from .rest import WorkflowsRestInterceptor, WorkflowsRestTransport

# Compile a registry of transports.
_transport_registry = OrderedDict() # type: Dict[str, Type[WorkflowsTransport]]
_transport_registry["grpc"] = WorkflowsGrpcTransport
_transport_registry["grpc_asyncio"] = WorkflowsGrpcAsyncIOTransport
_transport_registry["rest"] = WorkflowsRestTransport

__all__ = (
"WorkflowsTransport",
"WorkflowsGrpcTransport",
"WorkflowsGrpcAsyncIOTransport",
"WorkflowsRestTransport",
"WorkflowsRestInterceptor",
)
Loading