Inherit ManagementApiClient to remove redundant initialization#936
Open
Inherit ManagementApiClient to remove redundant initialization#936
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v8 #936 +/- ##
==========================================
- Coverage 33.89% 33.82% -0.07%
==========================================
Files 1978 1979 +1
Lines 72861 72779 -82
Branches 4271 4269 -2
==========================================
- Hits 24694 24620 -74
+ Misses 46947 46939 -8
Partials 1220 1220
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
ManagementClientpreviously implementedIManagementApiClientdirectly, duplicating every client property assignment that already exists in the generatedManagementApiClient. This meant any new endpoint added by code generation would breakManagementClient(missing property, broken interface) and call for manual updates.What changed:
ManagementClientnow inherits fromManagementApiClientinstead of implementingIManagementApiClientdirectly. All endpoint properties (Actions,Users,Organizations, etc.) are inherited automatically — keepingManagementClientpermanently in sync with generated code without any manual intervention.ManagementApiClient.Internal.cs(partial class) with aninternal SetAuthorizationHeader(Func<Task<string>>)method. This is the minimal seam needed to wire theITokenProviderdynamic token supplier into theRawClientheaders post-construction, without modifying generated code.ManagementClientrefactored into two private static helpers (Validate,BuildClientOptions)References
N/A
Testing
Checklist