Skip to content

Commit e5ebb1b

Browse files
feat: Add support for REST transport (#182)
* 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]>
1 parent 156df73 commit e5ebb1b

24 files changed

+4273
-150
lines changed

packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/gapic_metadata.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626
]
2727
}
2828
}
29+
},
30+
"rest": {
31+
"libraryClient": "AutoSuggestionServiceClient",
32+
"rpcs": {
33+
"SuggestQueries": {
34+
"methods": [
35+
"suggest_queries"
36+
]
37+
}
38+
}
2939
}
3040
}
3141
},
@@ -90,6 +100,36 @@
90100
]
91101
}
92102
}
103+
},
104+
"rest": {
105+
"libraryClient": "QuestionServiceClient",
106+
"rpcs": {
107+
"CreateQuestion": {
108+
"methods": [
109+
"create_question"
110+
]
111+
},
112+
"ExecuteQuestion": {
113+
"methods": [
114+
"execute_question"
115+
]
116+
},
117+
"GetQuestion": {
118+
"methods": [
119+
"get_question"
120+
]
121+
},
122+
"GetUserFeedback": {
123+
"methods": [
124+
"get_user_feedback"
125+
]
126+
},
127+
"UpdateUserFeedback": {
128+
"methods": [
129+
"update_user_feedback"
130+
]
131+
}
132+
}
93133
}
94134
}
95135
}

packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/services/auto_suggestion_service/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from .transports.base import DEFAULT_CLIENT_INFO, AutoSuggestionServiceTransport
4040
from .transports.grpc import AutoSuggestionServiceGrpcTransport
4141
from .transports.grpc_asyncio import AutoSuggestionServiceGrpcAsyncIOTransport
42+
from .transports.rest import AutoSuggestionServiceRestTransport
4243

4344

4445
class AutoSuggestionServiceClientMeta(type):
@@ -54,6 +55,7 @@ class AutoSuggestionServiceClientMeta(type):
5455
) # type: Dict[str, Type[AutoSuggestionServiceTransport]]
5556
_transport_registry["grpc"] = AutoSuggestionServiceGrpcTransport
5657
_transport_registry["grpc_asyncio"] = AutoSuggestionServiceGrpcAsyncIOTransport
58+
_transport_registry["rest"] = AutoSuggestionServiceRestTransport
5759

5860
def get_transport_class(
5961
cls,
@@ -396,6 +398,9 @@ def __init__(
396398
transport (Union[str, AutoSuggestionServiceTransport]): The
397399
transport to use. If set to None, a transport is chosen
398400
automatically.
401+
NOTE: "rest" transport functionality is currently in a
402+
beta state (preview). We welcome your feedback via an
403+
issue in this library's source repository.
399404
client_options (google.api_core.client_options.ClientOptions): Custom options for the
400405
client. It won't take effect if a ``transport`` instance is provided.
401406
(1) The ``api_endpoint`` property can be used to override the

packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/services/auto_suggestion_service/transports/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,23 @@
1919
from .base import AutoSuggestionServiceTransport
2020
from .grpc import AutoSuggestionServiceGrpcTransport
2121
from .grpc_asyncio import AutoSuggestionServiceGrpcAsyncIOTransport
22+
from .rest import (
23+
AutoSuggestionServiceRestInterceptor,
24+
AutoSuggestionServiceRestTransport,
25+
)
2226

2327
# Compile a registry of transports.
2428
_transport_registry = (
2529
OrderedDict()
2630
) # type: Dict[str, Type[AutoSuggestionServiceTransport]]
2731
_transport_registry["grpc"] = AutoSuggestionServiceGrpcTransport
2832
_transport_registry["grpc_asyncio"] = AutoSuggestionServiceGrpcAsyncIOTransport
33+
_transport_registry["rest"] = AutoSuggestionServiceRestTransport
2934

3035
__all__ = (
3136
"AutoSuggestionServiceTransport",
3237
"AutoSuggestionServiceGrpcTransport",
3338
"AutoSuggestionServiceGrpcAsyncIOTransport",
39+
"AutoSuggestionServiceRestTransport",
40+
"AutoSuggestionServiceRestInterceptor",
3441
)

0 commit comments

Comments
 (0)