From a2d7f8f4673ff6116a3e0046169dd3d0898b227a Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 24 Jul 2024 17:08:26 +0100 Subject: [PATCH] fix: Include the final argument in method signatures transformed into blocks (e.g. for pagination) --- .../Testing.Paginated/PaginatedClient.g.cs | 28 +++++++++---------- .../MessagingClient.g.cs | 8 +++--- .../ServiceMethodGenerator.Signatures.cs | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Google.Api.Generator.Tests/ProtoTests/Paginated/Testing.Paginated/PaginatedClient.g.cs b/Google.Api.Generator.Tests/ProtoTests/Paginated/Testing.Paginated/PaginatedClient.g.cs index 671ddf1d..ce18f285 100644 --- a/Google.Api.Generator.Tests/ProtoTests/Paginated/Testing.Paginated/PaginatedClient.g.cs +++ b/Google.Api.Generator.Tests/ProtoTests/Paginated/Testing.Paginated/PaginatedClient.g.cs @@ -80,7 +80,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return SignatureMethod(request); + return SignatureMethod(request, callSettings); } /// @@ -115,7 +115,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return SignatureMethodAsync(request); + return SignatureMethodAsync(request, callSettings); } /// @@ -147,7 +147,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return SignatureMethod(request); + return SignatureMethod(request, callSettings); } /// @@ -179,7 +179,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return SignatureMethodAsync(request); + return SignatureMethodAsync(request, callSettings); } /// @@ -206,7 +206,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return SignatureMethod(request); + return SignatureMethod(request, callSettings); } /// @@ -233,7 +233,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return SignatureMethodAsync(request); + return SignatureMethodAsync(request, callSettings); } /// @@ -301,7 +301,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return ResourcedMethod(request); + return ResourcedMethod(request, callSettings); } /// @@ -331,7 +331,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return ResourcedMethodAsync(request); + return ResourcedMethodAsync(request, callSettings); } /// @@ -361,7 +361,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return ResourcedMethod(request); + return ResourcedMethod(request, callSettings); } /// @@ -391,7 +391,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return ResourcedMethodAsync(request); + return ResourcedMethodAsync(request, callSettings); } /// @@ -427,7 +427,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return ResourcedMethod(request); + return ResourcedMethod(request, callSettings); } /// @@ -463,7 +463,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return ResourcedMethodAsync(request); + return ResourcedMethodAsync(request, callSettings); } /// @@ -499,7 +499,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return ResourcedMethod(request); + return ResourcedMethod(request, callSettings); } /// @@ -535,7 +535,7 @@ public abstract class PaginatedClient { request.PageSize = pageSize.Value; } - return ResourcedMethodAsync(request); + return ResourcedMethodAsync(request, callSettings); } // TEST_END } diff --git a/Google.Api.Generator.Tests/ProtoTests/Showcase/Google.Showcase.V1Beta1/MessagingClient.g.cs b/Google.Api.Generator.Tests/ProtoTests/Showcase/Google.Showcase.V1Beta1/MessagingClient.g.cs index 3c9e5369..57dc7c31 100644 --- a/Google.Api.Generator.Tests/ProtoTests/Showcase/Google.Showcase.V1Beta1/MessagingClient.g.cs +++ b/Google.Api.Generator.Tests/ProtoTests/Showcase/Google.Showcase.V1Beta1/MessagingClient.g.cs @@ -1386,7 +1386,7 @@ public virtual void DeleteBlurb(BlurbName name, gaxgrpc::CallSettings callSettin { request.PageSize = pageSize.Value; } - return ListBlurbs(request); + return ListBlurbs(request, callSettings); } /// @@ -1420,7 +1420,7 @@ public virtual void DeleteBlurb(BlurbName name, gaxgrpc::CallSettings callSettin { request.PageSize = pageSize.Value; } - return ListBlurbsAsync(request); + return ListBlurbsAsync(request, callSettings); } /// @@ -1454,7 +1454,7 @@ public virtual void DeleteBlurb(BlurbName name, gaxgrpc::CallSettings callSettin { request.PageSize = pageSize.Value; } - return ListBlurbs(request); + return ListBlurbs(request, callSettings); } /// @@ -1488,7 +1488,7 @@ public virtual void DeleteBlurb(BlurbName name, gaxgrpc::CallSettings callSettin { request.PageSize = pageSize.Value; } - return ListBlurbsAsync(request); + return ListBlurbsAsync(request, callSettings); } /// diff --git a/Google.Api.Generator/Generation/ServiceMethodGenerator.Signatures.cs b/Google.Api.Generator/Generation/ServiceMethodGenerator.Signatures.cs index 9e2d0cab..b8147baa 100644 --- a/Google.Api.Generator/Generation/ServiceMethodGenerator.Signatures.cs +++ b/Google.Api.Generator/Generation/ServiceMethodGenerator.Signatures.cs @@ -183,7 +183,7 @@ private MethodDeclarationSyntax AbstractRequestMethod(bool sync, bool callSettin var type = Ctx.Type(MethodDetails.RequestTyp); var request = Local(Ctx.Type(MethodDetails.RequestTyp), "request").WithInitializer(newRequest); var statements = requestBlock(request); - block = new[] { request }.Concat(statements).Append(Return(This.Call(methodName)(request))).ToArray(); + block = new[] { request }.Concat(statements).Append(Return(This.Call(methodName)(request, finalParam))).ToArray(); } var method = Method(Public | Virtual, Ctx.Type(returnTyp), methodName)(parameters.Select(x => x.Parameter).Append(finalParam).ToArray()) .MaybeWithAttribute(MethodDetails.IsDeprecated || _sig.HasDeprecatedField, () => Ctx.Type())()