Skip to content

Commit

Permalink
feat: Enable REST transport support (#45)
Browse files Browse the repository at this point in the history
* fix: integrate  gapic-generator-python-1.4.1 and enable more py_test targets

PiperOrigin-RevId: 473833416

Source-Link: googleapis/googleapis@565a550

Source-Link: googleapis/googleapis-gen@1ee1a06
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWVlMWEwNmM2ZGUzY2E4Yjg0MzU3MmMxZmRlMDU0OGY4NDIzNjk4OSJ9

* 🦉 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,>=2.8.0

* fix(deps): require protobuf >= 3.20.1

* remove transitive dependency

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 Sep 13, 2022
1 parent 36b5ad0 commit f21f31d
Show file tree
Hide file tree
Showing 34 changed files with 8,053 additions and 194 deletions.
65 changes: 65 additions & 0 deletions packages/google-cloud-run/google/cloud/run_v2/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@
]
}
}
},
"rest": {
"libraryClient": "RevisionsClient",
"rpcs": {
"DeleteRevision": {
"methods": [
"delete_revision"
]
},
"GetRevision": {
"methods": [
"get_revision"
]
},
"ListRevisions": {
"methods": [
"list_revisions"
]
}
}
}
}
},
Expand Down Expand Up @@ -140,6 +160,51 @@
]
}
}
},
"rest": {
"libraryClient": "ServicesClient",
"rpcs": {
"CreateService": {
"methods": [
"create_service"
]
},
"DeleteService": {
"methods": [
"delete_service"
]
},
"GetIamPolicy": {
"methods": [
"get_iam_policy"
]
},
"GetService": {
"methods": [
"get_service"
]
},
"ListServices": {
"methods": [
"list_services"
]
},
"SetIamPolicy": {
"methods": [
"set_iam_policy"
]
},
"TestIamPermissions": {
"methods": [
"test_iam_permissions"
]
},
"UpdateService": {
"methods": [
"update_service"
]
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from .transports.base import RevisionsTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import RevisionsGrpcTransport
from .transports.grpc_asyncio import RevisionsGrpcAsyncIOTransport
from .transports.rest import RevisionsRestTransport


class RevisionsClientMeta(type):
Expand All @@ -60,6 +61,7 @@ class RevisionsClientMeta(type):
_transport_registry = OrderedDict() # type: Dict[str, Type[RevisionsTransport]]
_transport_registry["grpc"] = RevisionsGrpcTransport
_transport_registry["grpc_asyncio"] = RevisionsGrpcAsyncIOTransport
_transport_registry["rest"] = RevisionsRestTransport

def get_transport_class(
cls,
Expand Down Expand Up @@ -462,6 +464,9 @@ def __init__(
transport (Union[str, RevisionsTransport]): 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 (google.api_core.client_options.ClientOptions): 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,15 +19,20 @@
from .base import RevisionsTransport
from .grpc import RevisionsGrpcTransport
from .grpc_asyncio import RevisionsGrpcAsyncIOTransport
from .rest import RevisionsRestTransport
from .rest import RevisionsRestInterceptor


# Compile a registry of transports.
_transport_registry = OrderedDict() # type: Dict[str, Type[RevisionsTransport]]
_transport_registry["grpc"] = RevisionsGrpcTransport
_transport_registry["grpc_asyncio"] = RevisionsGrpcAsyncIOTransport
_transport_registry["rest"] = RevisionsRestTransport

__all__ = (
"RevisionsTransport",
"RevisionsGrpcTransport",
"RevisionsGrpcAsyncIOTransport",
"RevisionsRestTransport",
"RevisionsRestInterceptor",
)
Loading

0 comments on commit f21f31d

Please sign in to comment.