Skip to content

Commit

Permalink
feat: Include the api_version in GAPIC generated summary docs.
Browse files Browse the repository at this point in the history
(Ideally we should include this in release notes as well, but this
is a start.)
  • Loading branch information
jskeet committed Mar 21, 2024
1 parent f71eb99 commit a806ef2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ private ServiceWithApiVersionClient BuildImpl()
protected override gaxgrpc::ChannelPool GetChannelPool() => ServiceWithApiVersionClient.ChannelPool;
}

/// <summary>ServiceWithApiVersion client wrapper, for convenient use.</summary>
/// <summary>
/// ServiceWithApiVersion client wrapper, for convenient use. This client implements API version v1_20240313.
/// </summary>
/// <remarks>
/// This is a service using the api_version extension.
/// </remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ internal class ServiceAbstractClientClassCodeGenerator

private ClassDeclarationSyntax Generate()
{
string summaryPrefix = $"{_svc.DocumentationName} client wrapper, for convenient use.";
string summaryDoc = _svc.ApiVersion is null
? summaryPrefix
: $"{summaryPrefix} This client implements API version {_svc.ApiVersion}.";
var cls = Class(Public | Abstract | Partial, _svc.ClientAbstractTyp)
.MaybeWithAttribute(_svc.IsDeprecated, () => _ctx.Type<ObsoleteAttribute>())()
.WithXmlDoc(
XmlDoc.Summary($"{_svc.DocumentationName} client wrapper, for convenient use."),
XmlDoc.Summary(summaryDoc),
XmlDoc.RemarksPreFormatted(_svc.DocLines));
using (_ctx.InClass(cls))
{
Expand Down

0 comments on commit a806ef2

Please sign in to comment.