feat: Add enterprise billing usage endpoints and response types#4288
Open
maishivamhoo123 wants to merge 7 commits into
Open
feat: Add enterprise billing usage endpoints and response types#4288maishivamhoo123 wants to merge 7 commits into
maishivamhoo123 wants to merge 7 commits into
Conversation
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
alexandear
reviewed
Jun 8, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4288 +/- ##
==========================================
- Coverage 97.49% 97.47% -0.03%
==========================================
Files 192 193 +1
Lines 19256 19308 +52
==========================================
+ Hits 18774 18820 +46
- Misses 267 269 +2
- Partials 215 219 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
Contributor
Author
|
@alexandear @gmlewis @Not-Dhananjay-Mishra i made all the changes can you please review it ? |
alexandear
reviewed
Jun 9, 2026
Comment on lines
+14
to
+34
| type EnterpriseUsageReportOptions struct { | ||
| Year int `url:"year,omitempty"` | ||
| Month int `url:"month,omitempty"` | ||
| Day int `url:"day,omitempty"` | ||
| CostCenterID string `url:"cost_center_id,omitempty"` | ||
| } | ||
|
|
||
| // EnterprisePremiumRequestUsageReportOptions specifies optional parameters for the BillingService.GetEnterprisePremiumRequestUsageReport and BillingService.GetEnterpriseAICreditUsage methods. | ||
| type EnterprisePremiumRequestUsageReportOptions struct { | ||
| Year int `url:"year,omitempty"` | ||
| Month int `url:"month,omitempty"` | ||
| Day int `url:"day,omitempty"` | ||
| Organization string `url:"organization,omitempty"` | ||
| User string `url:"user,omitempty"` | ||
| Model string `url:"model,omitempty"` | ||
| Product string `url:"product,omitempty"` | ||
| CostCenterID string `url:"cost_center_id,omitempty"` | ||
| } | ||
|
|
||
| // EnterpriseUsageSummaryOptions specifies optional parameters for the BillingService.GetEnterpriseUsageSummary method. | ||
| type EnterpriseUsageSummaryOptions struct { |
Contributor
alexandear
reviewed
Jun 9, 2026
| } | ||
| } | ||
|
|
||
| func TestEnterpriseService_GetUsageSummary_WithRepository(t *testing.T) { |
Contributor
There was a problem hiding this comment.
Why do we need this test? It duplicates TestEnterpriseService_GetUsageSummary_WithAllFilters
alexandear
reviewed
Jun 9, 2026
Contributor
There was a problem hiding this comment.
Please review all tests and try not adding redundant tests that check the same functionality.
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.

Summary
Adds support for the GitHub Enterprise billing usage API endpoints.
#4262
New methods on BillingService
GetEnterpriseUsageReport
GetEnterpriseUsageSummary
GetEnterprisePremiumRequestUsageReport
GetEnterpriseAICreditUsage
And added test for all the new End points .