diff --git a/Google.Api.Generator/Generation/ServiceImplClientClassGenerator.cs b/Google.Api.Generator/Generation/ServiceImplClientClassGenerator.cs index b6348253..99d4a1af 100644 --- a/Google.Api.Generator/Generation/ServiceImplClientClassGenerator.cs +++ b/Google.Api.Generator/Generation/ServiceImplClientClassGenerator.cs @@ -110,7 +110,7 @@ private MemberDeclarationSyntax CtorGrpcClient(PropertyDeclarationSyntax grpcCli .WithBody( grpcClientProperty.Assign(grpcClient), effectiveSettings.WithInitializer(settings.NullCoalesce(_ctx.Type(_svc.SettingsTyp).Call("GetDefault")())), - clientHelper.WithInitializer(New(_ctx.Type())(effectiveSettings, logger)), + clientHelper.WithInitializer(ClientHelperInitializer()), _svc.Methods.OfType().Select(m => StandardLroClient(m, logger)), _svc.Methods.OfType().Select(m => NonStandardLroClient(m, logger)), _svc.Mixins.Select(m => MixinClient(m, logger)), @@ -124,6 +124,16 @@ private MemberDeclarationSyntax CtorGrpcClient(PropertyDeclarationSyntax grpcCli XmlDoc.Param(logger, "Optional ", logger.Type, " to use within this client.") ); + object ClientHelperInitializer() + { + var assignments = new List + { + new(nameof(ClientHelper.Options.Settings), effectiveSettings), + new(nameof(ClientHelper.Options.Logger), logger) + }; + return New(_ctx.Type())(New(_ctx.Type())().WithInitializer(assignments.ToArray())); + } + SyntaxNode StandardLroClient(MethodDetails.StandardLro lro, ParameterSyntax logger) { var lroOperationsClientProperty = Property(Public, _ctx.Type(), lro.LroClientName);