-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Universe domain support for discovery based libraries. #746
feat: Universe domain support for discovery based libraries. #746
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there's a slight memory footprint increase here with more fields rather than calculated properties, but I very much doubt that it'll be significant.
.WithBlockBody(resourceProperties.Zip(Resources).Select(pair => pair.First.Assign(New(ctx.Type(pair.Second.Typ))(This))).ToArray()) | ||
.WithBlockBody( | ||
resourceProperties.Zip(Resources).Select(pair => pair.First.Assign(New(ctx.Type(pair.Second.Typ))(This))) | ||
.Append(baseUriProperty.Assign(Call("GetEffectiveUri")(IdentifierName("BaseUriOverride"), baseUriValue))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: indent these three lines more? (So they're indented relative to resourceProperties.Zip
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- The universe domain may be specified through the client service initializer. - A helper method to calculate effective URIs that takes into account the universe domain. This method is to be used by generated code, see googleapis/gapic-generator-csharp#746. - The universe domain is passed as a request option for the credential to validate against when intercepting and before setting the token.
- The universe domain may be specified through the client service initializer. - A helper method to calculate effective URIs that takes into account the universe domain. This method is to be used by generated code, see googleapis/gapic-generator-csharp#746. - The universe domain is passed as a request option for the credential to validate against when intercepting and before setting the token.
d25cb64
to
f537a7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there's a slight memory footprint increase here with more fields rather than calculated properties, but I very much doubt that it'll be significant.
Yes, I did choose this actively. Calculating the properties now implies replacing "googleapis.com" with the custom domain, if there is one. And that happens for every service call, so I figured having the fields was slightly better. Happy to reconsider. Ultimately I think neither is going to make much of a difference though.
.WithBlockBody(resourceProperties.Zip(Resources).Select(pair => pair.First.Assign(New(ctx.Type(pair.Second.Typ))(This))).ToArray()) | ||
.WithBlockBody( | ||
resourceProperties.Zip(Resources).Select(pair => pair.First.Assign(New(ctx.Type(pair.Second.Typ))(This))) | ||
.Append(baseUriProperty.Assign(Call("GetEffectiveUri")(IdentifierName("BaseUriOverride"), baseUriValue))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Once we have released the generator and updated Discovery based generation to use the new version of the generator, we'll be able to update the Google.Apis.Discovery.v1 (1.66.0 -> 1.67.0) dependency in Google.Api.Generator.Rest instead. See b/326453788
Note that this is not an extension on another syntax element, we have plenty of those, nor a this-qualified method call. This generates a method call to an instance method without the this qualifier.
Generate code that calculates URIs taking the universe domain into account.
f537a7a
to
31904ad
Compare
I've updated to latest GAX and Google.Apis (tests only) latests. I'll merge on green. |
This has a dependency on googleapis/google-api-dotnet-client#2675 because generated code uses the methods defined there. This PR's presubmits won't be green until we have merged and released googleapis/google-api-dotnet-client#2675.