Skip to content

Commit

Permalink
feat: Add support for REST transport (#182)
Browse files Browse the repository at this point in the history
* feat: enable REST transport for Python Preview clients

PiperOrigin-RevId: 474571730

Source-Link: googleapis/googleapis@5a9ee4d

Source-Link: googleapis/googleapis-gen@ceafe52
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2VhZmU1MjFmMTM3NjgwZmRlZTJmOWNhOWUxOTQ3Y2RkODI1MDcwZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: Add Secure Boot support to TPU v2alpha1 API

PiperOrigin-RevId: 474644226

Source-Link: googleapis/googleapis@f90b329

Source-Link: googleapis/googleapis-gen@4ad8763
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGFkODc2M2JkZTY3NmY5MmEzZWI3MDc1M2FlMWNmZWQwZTgxMzg3ZSJ9

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

* fix(deps): require protobuf >= 3.20.1

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 Sep 16, 2022
1 parent 156df73 commit e5ebb1b
Show file tree
Hide file tree
Showing 24 changed files with 4,273 additions and 150 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
]
}
}
},
"rest": {
"libraryClient": "AutoSuggestionServiceClient",
"rpcs": {
"SuggestQueries": {
"methods": [
"suggest_queries"
]
}
}
}
}
},
Expand Down Expand Up @@ -90,6 +100,36 @@
]
}
}
},
"rest": {
"libraryClient": "QuestionServiceClient",
"rpcs": {
"CreateQuestion": {
"methods": [
"create_question"
]
},
"ExecuteQuestion": {
"methods": [
"execute_question"
]
},
"GetQuestion": {
"methods": [
"get_question"
]
},
"GetUserFeedback": {
"methods": [
"get_user_feedback"
]
},
"UpdateUserFeedback": {
"methods": [
"update_user_feedback"
]
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from .transports.base import DEFAULT_CLIENT_INFO, AutoSuggestionServiceTransport
from .transports.grpc import AutoSuggestionServiceGrpcTransport
from .transports.grpc_asyncio import AutoSuggestionServiceGrpcAsyncIOTransport
from .transports.rest import AutoSuggestionServiceRestTransport


class AutoSuggestionServiceClientMeta(type):
Expand All @@ -54,6 +55,7 @@ class AutoSuggestionServiceClientMeta(type):
) # type: Dict[str, Type[AutoSuggestionServiceTransport]]
_transport_registry["grpc"] = AutoSuggestionServiceGrpcTransport
_transport_registry["grpc_asyncio"] = AutoSuggestionServiceGrpcAsyncIOTransport
_transport_registry["rest"] = AutoSuggestionServiceRestTransport

def get_transport_class(
cls,
Expand Down Expand Up @@ -396,6 +398,9 @@ def __init__(
transport (Union[str, AutoSuggestionServiceTransport]): 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,16 +19,23 @@
from .base import AutoSuggestionServiceTransport
from .grpc import AutoSuggestionServiceGrpcTransport
from .grpc_asyncio import AutoSuggestionServiceGrpcAsyncIOTransport
from .rest import (
AutoSuggestionServiceRestInterceptor,
AutoSuggestionServiceRestTransport,
)

# Compile a registry of transports.
_transport_registry = (
OrderedDict()
) # type: Dict[str, Type[AutoSuggestionServiceTransport]]
_transport_registry["grpc"] = AutoSuggestionServiceGrpcTransport
_transport_registry["grpc_asyncio"] = AutoSuggestionServiceGrpcAsyncIOTransport
_transport_registry["rest"] = AutoSuggestionServiceRestTransport

__all__ = (
"AutoSuggestionServiceTransport",
"AutoSuggestionServiceGrpcTransport",
"AutoSuggestionServiceGrpcAsyncIOTransport",
"AutoSuggestionServiceRestTransport",
"AutoSuggestionServiceRestInterceptor",
)
Loading

0 comments on commit e5ebb1b

Please sign in to comment.