Skip to content

Commit

Permalink
chore: optionally generate async rest and client files
Browse files Browse the repository at this point in the history
  • Loading branch information
ohmayr committed Sep 3, 2024
1 parent bfd4825 commit aa4bfa6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gapic/generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,13 @@ def _render_template(
('transport' in template_name
and not self._is_desired_transport(template_name, opts))
or
# TODO(yon-mg) - remove when rest async implementation resolved
# temporarily stop async client gen while rest async is unkown
('async' in template_name and 'grpc' not in opts.transport)
# TODO: Remove the following conditions once support for async rest transport is GA:
# See related issue: https://github.com/googleapis/gapic-generator-python/issues/2121.
('async_client' in template_name and ('grpc' not in opts.transport or
not api_schema.all_library_settings[api_schema.naming.proto_package].python_settings.experimental_features.rest_async_io_enabled))
or
('rest_asyncio' in template_name and
not api_schema.all_library_settings[api_schema.naming.proto_package].python_settings.experimental_features.rest_async_io_enabled)
or
('rest_base' in template_name and 'rest' not in opts.transport)
):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{# TODO: Remove the following condition for async rest transport once support for it is GA:
# {% if rest_async_io_enabled %}
# See related issue: https://github.com/googleapis/gapic-generator-python/issues/2121.
#}
{% set rest_async_io_enabled = api.all_library_settings[api.naming.proto_package].python_settings.experimental_features.rest_async_io_enabled %}

0 comments on commit aa4bfa6

Please sign in to comment.