This repository was archived by the owner on Mar 26, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
templates/%namespace/%name_%version/%sub/services/%service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1734,6 +1734,17 @@ def host(self) -> str:
17341734 return self .options .Extensions [client_pb2 .default_host ]
17351735 return ''
17361736
1737+ @property
1738+ def api_version (self ) -> str :
1739+ """Return the API version for this service, if specified.
1740+
1741+ Returns:
1742+ str: The API version for this service.
1743+ """
1744+ if self .options .Extensions [client_pb2 .api_version ]:
1745+ return self .options .Extensions [client_pb2 .api_version ]
1746+ return ''
1747+
17371748 @property
17381749 def shortname (self ) -> str :
17391750 """Return the API short name. DRIFT uses this to identify
Original file line number Diff line number Diff line change @@ -102,7 +102,11 @@ class {{ service.client_name }}Meta(type):
102102
103103
104104class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
105- """{{ service.meta.doc|rst(width=72, indent=4) }}"""
105+ """{{ service.meta.doc|rst(width=72, indent=4) }}
106+ {% if service .api_version |length %}
107+ This class implements API version {{ service.api_version }}.
108+ {% endif %}
109+ """
106110
107111 @staticmethod
108112 def _get_default_mtls_endpoint(api_endpoint):
You can’t perform that action at this time.
0 commit comments