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

* 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

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Feb 21, 2023
1 parent 76fdb6b commit 0bd530d
Show file tree
Hide file tree
Showing 5 changed files with 3,497 additions and 106 deletions.
40 changes: 40 additions & 0 deletions google/cloud/orgpolicy_v2/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,46 @@
]
}
}
},
"rest": {
"libraryClient": "OrgPolicyClient",
"rpcs": {
"CreatePolicy": {
"methods": [
"create_policy"
]
},
"DeletePolicy": {
"methods": [
"delete_policy"
]
},
"GetEffectivePolicy": {
"methods": [
"get_effective_policy"
]
},
"GetPolicy": {
"methods": [
"get_policy"
]
},
"ListConstraints": {
"methods": [
"list_constraints"
]
},
"ListPolicies": {
"methods": [
"list_policies"
]
},
"UpdatePolicy": {
"methods": [
"update_policy"
]
}
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/orgpolicy_v2/services/org_policy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from .transports.base import OrgPolicyTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import OrgPolicyGrpcTransport
from .transports.grpc_asyncio import OrgPolicyGrpcAsyncIOTransport
from .transports.rest import OrgPolicyRestTransport


class OrgPolicyClientMeta(type):
Expand All @@ -65,6 +66,7 @@ class OrgPolicyClientMeta(type):
_transport_registry = OrderedDict() # type: Dict[str, Type[OrgPolicyTransport]]
_transport_registry["grpc"] = OrgPolicyGrpcTransport
_transport_registry["grpc_asyncio"] = OrgPolicyGrpcAsyncIOTransport
_transport_registry["rest"] = OrgPolicyRestTransport

def get_transport_class(
cls,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@
from .base import OrgPolicyTransport
from .grpc import OrgPolicyGrpcTransport
from .grpc_asyncio import OrgPolicyGrpcAsyncIOTransport
from .rest import OrgPolicyRestTransport
from .rest import OrgPolicyRestInterceptor


# Compile a registry of transports.
_transport_registry = OrderedDict() # type: Dict[str, Type[OrgPolicyTransport]]
_transport_registry["grpc"] = OrgPolicyGrpcTransport
_transport_registry["grpc_asyncio"] = OrgPolicyGrpcAsyncIOTransport
_transport_registry["rest"] = OrgPolicyRestTransport

__all__ = (
"OrgPolicyTransport",
"OrgPolicyGrpcTransport",
"OrgPolicyGrpcAsyncIOTransport",
"OrgPolicyRestTransport",
"OrgPolicyRestInterceptor",
)
Loading

0 comments on commit 0bd530d

Please sign in to comment.