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

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: https://github.com/googleapis/googleapis-gen/commit/ceafe521f137680fdee2f9ca9e1947cdd825070d
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: https://github.com/googleapis/googleapis-gen/commit/4ad8763bde676f92a3eb70753ae1cfed0e81387e
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 <partheniou@google.com>
  • Loading branch information
3 people authored Sep 16, 2022
1 parent a89bbbe commit a1dea02
Show file tree
Hide file tree
Showing 24 changed files with 4,273 additions and 150 deletions.
40 changes: 40 additions & 0 deletions google/cloud/dataqna_v1alpha/gapic_metadata.json
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 a1dea02

Please sign in to comment.