From e8d34ec115197d39c22f2c356864fdd847d139d7 Mon Sep 17 00:00:00 2001 From: Victor Chudnovsky Date: Fri, 12 Aug 2022 12:05:30 -0700 Subject: [PATCH] feat: Note that "rest" transport support is beta. This beta notice is triggered by having numeric enum support disabled (the default), since numeric enum support is currently the only blocker to supporting REST transport fully. This condition can be changed if further blockers arise to a GA release of REST transport. This logic and notice can be removed entirely once we are satisfied that REST transport works with or without numeric enums. --- .../%version/%sub/services/%service/client.py.j2 | 5 +++++ .../%sub/services/%service/transports/rest.py.j2 | 12 ++++++++++++ .../%sub/services/%service/client.py.j2 | 5 +++++ .../%sub/services/%service/transports/rest.py.j2 | 12 ++++++++++++ 4 files changed, 34 insertions(+) diff --git a/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 b/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 index 2426f5bc45..4666ab3e0f 100644 --- a/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 +++ b/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 @@ -233,6 +233,11 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta): transport (Union[str, {{ service.name }}Transport]): The transport to use. If set to None, a transport is chosen automatically. + {% if 'rest' in opts.transport and not opts.rest_numeric_enums %} + NOTE: "rest" transport functionality is currently in a + beta state (preview). We welcome your feedback via an + issue in this library's source repository. + {% endif %} 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 diff --git a/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/transports/rest.py.j2 b/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/transports/rest.py.j2 index feaa18f44b..99156e3251 100644 --- a/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/transports/rest.py.j2 +++ b/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/transports/rest.py.j2 @@ -128,6 +128,12 @@ class {{service.name}}RestTransport({{service.name}}Transport): and call it. It sends JSON representations of protocol buffers over HTTP/1.1 + + {% if not opts.rest_numeric_enums %} + NOTE: This REST transport functionality is currently in a beta + state (preview). We welcome your feedback via an issue in this + library's source repository. Thank you! + {% endif %} """ @@ -147,6 +153,12 @@ class {{service.name}}RestTransport({{service.name}}Transport): ) -> None: """Instantiate the transport. + {% if not opts.rest_numeric_enums %} + NOTE: This REST transport functionality is currently in a beta + state (preview). We welcome your feedback via a GitHub issue in + this library's repository. Thank you! + {% endif %} + Args: host ({% if service.host %}Optional[str]{% else %}str{% endif %}): {{ ' ' }}The hostname to connect to. diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 index 9a4bc5d3e6..be54b73db8 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 @@ -290,6 +290,11 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta): transport (Union[str, {{ service.name }}Transport]): The transport to use. If set to None, a transport is chosen automatically. + {% if 'rest' in opts.transport and not opts.rest_numeric_enums %} + NOTE: "rest" transport functionality is currently in a + beta state (preview). We welcome your feedback via an + issue in this library's source repository. + {% endif %} 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 diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 index ea1d45af0f..5f5c46660d 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 @@ -134,6 +134,12 @@ class {{service.name}}RestTransport({{service.name}}Transport): and call it. It sends JSON representations of protocol buffers over HTTP/1.1 + + {% if not opts.rest_numeric_enums %} + NOTE: This REST transport functionality is currently in a beta + state (preview). We welcome your feedback via an issue in this + library's source repository. Thank you! + {% endif %} """ @@ -154,6 +160,12 @@ class {{service.name}}RestTransport({{service.name}}Transport): ) -> None: """Instantiate the transport. + {% if not opts.rest_numeric_enums %} + NOTE: This REST transport functionality is currently in a beta + state (preview). We welcome your feedback via a GitHub issue in + this library's repository. Thank you! + {% endif %} + Args: host ({% if service.host %}Optional[str]{% else %}str{% endif %}): {{ ' ' }}The hostname to connect to.