diff --git a/gapic-generator/lib/gapic/schema/wrappers.rb b/gapic-generator/lib/gapic/schema/wrappers.rb index eee0608f4..cc74b2dbc 100644 --- a/gapic-generator/lib/gapic/schema/wrappers.rb +++ b/gapic-generator/lib/gapic/schema/wrappers.rb @@ -347,6 +347,18 @@ def full_name @address.join "." end + # @private + # This is an override that adds mention of the client's service and API + # version if the service has a google.api.api_version set. + def docs_leading_comments disable_xrefs: false, transport: nil + str = super(disable_xrefs: disable_xrefs, transport: transport) + if !str || api_version.nil? || api_version.empty? + return str + end + + "#{str.strip}\n\nThis client uses #{name} version #{api_version}." + end + # @!method name # @return [String] the unqualified name of the service. # @!method options diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo.rb index edd8674b9..7bc4a2fdb 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo.rb @@ -47,6 +47,8 @@ module V1beta1 # 'x-goog-request-params' metadata key on any method to have the values # echoed in the response headers. # + # This client uses Echo version v1_20240408. + # # @example Load this service and instantiate a gRPC client # # require "google/showcase/v1beta1/echo" diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/client.rb index 6f6b03575..4ef593f4c 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/client.rb @@ -44,6 +44,8 @@ module Echo # 'x-goog-request-params' metadata key on any method to have the values # echoed in the response headers. # + # This client uses Echo version v1_20240408. + # class Client # @private API_VERSION = "v1_20240408" diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest.rb index 74da6687f..d02e943ed 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest.rb @@ -47,6 +47,8 @@ module V1beta1 # 'x-goog-request-params' metadata key on any method to have the values # echoed in the response headers. # + # This client uses Echo version v1_20240408. + # # To load this service and instantiate a REST client: # # require "google/showcase/v1beta1/echo/rest" diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/client.rb index 16b371c66..241782f34 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/client.rb @@ -46,6 +46,8 @@ module Rest # 'x-goog-request-params' metadata key on any method to have the values # echoed in the response headers. # + # This client uses Echo version v1_20240408. + # class Client # @private API_VERSION = "v1_20240408"