Skip to content

Commit 46fe7f2

Browse files
authored
feat: Note that "rest" transport support is beta. (#1403)
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.
1 parent 6d26bc1 commit 46fe7f2

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

packages/gapic-generator/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
233233
transport (Union[str, {{ service.name }}Transport]): The
234234
transport to use. If set to None, a transport is chosen
235235
automatically.
236+
{% if 'rest' in opts.transport and not opts.rest_numeric_enums %}
237+
NOTE: "rest" transport functionality is currently in a
238+
beta state (preview). We welcome your feedback via an
239+
issue in this library's source repository.
240+
{% endif %}
236241
client_options (google.api_core.client_options.ClientOptions): Custom options for the
237242
client. It won't take effect if a ``transport`` instance is provided.
238243
(1) The ``api_endpoint`` property can be used to override the

packages/gapic-generator/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ class {{service.name}}RestTransport({{service.name}}Transport):
128128
and call it.
129129

130130
It sends JSON representations of protocol buffers over HTTP/1.1
131+
132+
{% if not opts.rest_numeric_enums %}
133+
NOTE: This REST transport functionality is currently in a beta
134+
state (preview). We welcome your feedback via an issue in this
135+
library's source repository. Thank you!
136+
{% endif %}
131137
"""
132138

133139

@@ -147,6 +153,12 @@ class {{service.name}}RestTransport({{service.name}}Transport):
147153
) -> None:
148154
"""Instantiate the transport.
149155

156+
{% if not opts.rest_numeric_enums %}
157+
NOTE: This REST transport functionality is currently in a beta
158+
state (preview). We welcome your feedback via a GitHub issue in
159+
this library's repository. Thank you!
160+
{% endif %}
161+
150162
Args:
151163
host ({% if service.host %}Optional[str]{% else %}str{% endif %}):
152164
{{ ' ' }}The hostname to connect to.

packages/gapic-generator/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
290290
transport (Union[str, {{ service.name }}Transport]): The
291291
transport to use. If set to None, a transport is chosen
292292
automatically.
293+
{% if 'rest' in opts.transport and not opts.rest_numeric_enums %}
294+
NOTE: "rest" transport functionality is currently in a
295+
beta state (preview). We welcome your feedback via an
296+
issue in this library's source repository.
297+
{% endif %}
293298
client_options (google.api_core.client_options.ClientOptions): Custom options for the
294299
client. It won't take effect if a ``transport`` instance is provided.
295300
(1) The ``api_endpoint`` property can be used to override the

packages/gapic-generator/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ class {{service.name}}RestTransport({{service.name}}Transport):
134134
and call it.
135135

136136
It sends JSON representations of protocol buffers over HTTP/1.1
137+
138+
{% if not opts.rest_numeric_enums %}
139+
NOTE: This REST transport functionality is currently in a beta
140+
state (preview). We welcome your feedback via an issue in this
141+
library's source repository. Thank you!
142+
{% endif %}
137143
"""
138144

139145

@@ -154,6 +160,12 @@ class {{service.name}}RestTransport({{service.name}}Transport):
154160
) -> None:
155161
"""Instantiate the transport.
156162

163+
{% if not opts.rest_numeric_enums %}
164+
NOTE: This REST transport functionality is currently in a beta
165+
state (preview). We welcome your feedback via a GitHub issue in
166+
this library's repository. Thank you!
167+
{% endif %}
168+
157169
Args:
158170
host ({% if service.host %}Optional[str]{% else %}str{% endif %}):
159171
{{ ' ' }}The hostname to connect to.

0 commit comments

Comments
 (0)