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

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

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

PiperOrigin-RevId: 508143576

Source-Link: googleapis/googleapis@7a702a9

Source-Link: https://github.com/googleapis/googleapis-gen/commit/6ad1279c0e7aa787ac6b66c9fd4a210692edffcd
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmFkMTI3OWMwZTdhYTc4N2FjNmI2NmM5ZmQ0YTIxMDY5MmVkZmZjZCJ9

* fix typo

* 🦉 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>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Feb 16, 2023
1 parent 58a7be2 commit 21c09b8
Show file tree
Hide file tree
Showing 11 changed files with 5,825 additions and 266 deletions.
2 changes: 0 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:f62c53736eccb0c4934a3ea9316e0d57696bb49c1a7c86c726e9bb8a2f87dadf

trigger ci
35 changes: 35 additions & 0 deletions google/cloud/language_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,41 @@
]
}
}
},
"rest": {
"libraryClient": "LanguageServiceClient",
"rpcs": {
"AnalyzeEntities": {
"methods": [
"analyze_entities"
]
},
"AnalyzeEntitySentiment": {
"methods": [
"analyze_entity_sentiment"
]
},
"AnalyzeSentiment": {
"methods": [
"analyze_sentiment"
]
},
"AnalyzeSyntax": {
"methods": [
"analyze_syntax"
]
},
"AnnotateText": {
"methods": [
"annotate_text"
]
},
"ClassifyText": {
"methods": [
"classify_text"
]
}
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/language_v1/services/language_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from .transports.base import DEFAULT_CLIENT_INFO, LanguageServiceTransport
from .transports.grpc import LanguageServiceGrpcTransport
from .transports.grpc_asyncio import LanguageServiceGrpcAsyncIOTransport
from .transports.rest import LanguageServiceRestTransport


class LanguageServiceClientMeta(type):
Expand All @@ -66,6 +67,7 @@ class LanguageServiceClientMeta(type):
) # type: Dict[str, Type[LanguageServiceTransport]]
_transport_registry["grpc"] = LanguageServiceGrpcTransport
_transport_registry["grpc_asyncio"] = LanguageServiceGrpcAsyncIOTransport
_transport_registry["rest"] = LanguageServiceRestTransport

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 LanguageServiceTransport
from .grpc import LanguageServiceGrpcTransport
from .grpc_asyncio import LanguageServiceGrpcAsyncIOTransport
from .rest import LanguageServiceRestInterceptor, LanguageServiceRestTransport

# Compile a registry of transports.
_transport_registry = OrderedDict() # type: Dict[str, Type[LanguageServiceTransport]]
_transport_registry["grpc"] = LanguageServiceGrpcTransport
_transport_registry["grpc_asyncio"] = LanguageServiceGrpcAsyncIOTransport
_transport_registry["rest"] = LanguageServiceRestTransport

__all__ = (
"LanguageServiceTransport",
"LanguageServiceGrpcTransport",
"LanguageServiceGrpcAsyncIOTransport",
"LanguageServiceRestTransport",
"LanguageServiceRestInterceptor",
)
Loading

0 comments on commit 21c09b8

Please sign in to comment.