Skip to content

Commit a25e3fb

Browse files
committed
docs(templates): add explanatory comment for has_auto_populated_fields in client templates
1 parent 6eb89f7 commit a25e3fb

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{% import "%namespace/%name_%version/%sub/services/%service/_client_macros.j2" as macros %}
55
{% import "%namespace/%name_%version/%sub/services/%service/_shared_macros.j2" as shared_macros %}
66

7+
{# Check if any method in this service has auto-populated fields (e.g. AIP-4235 request_id)
8+
so setup_request_id is conditionally imported from _compat only when needed. #}
79
{% set has_auto_populated_fields = namespace(value=false) %}
810
{% for method in service.methods.values() %}
911
{% set method_settings = api.all_method_settings.get(method.meta.address.proto) %}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
{% import "%namespace/%name_%version/%sub/services/%service/_client_macros.j2" as macros %}
77
{% import "%namespace/%name_%version/%sub/services/%service/_shared_macros.j2" as shared_macros %}
88

9+
{# Check if any method in this service has auto-populated fields (e.g. AIP-4235 request_id)
10+
so setup_request_id is conditionally imported from _compat only when needed. #}
911
{% set has_auto_populated_fields = namespace(value=false) %}
1012
{% for method in service.methods.values() %}
1113
{% set method_settings = api.all_method_settings.get(method.meta.address.proto) %}

0 commit comments

Comments
 (0)