Skip to content

feat: Add enterprise billing usage endpoints and response types#4288

Open
maishivamhoo123 wants to merge 6 commits into
google:masterfrom
maishivamhoo123:refactor/enterprise-billing-merge-structs
Open

feat: Add enterprise billing usage endpoints and response types#4288
maishivamhoo123 wants to merge 6 commits into
google:masterfrom
maishivamhoo123:refactor/enterprise-billing-merge-structs

Conversation

@maishivamhoo123

@maishivamhoo123 maishivamhoo123 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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 .

// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/usage?apiVersion=2022-11-28#get-billing-usage-report-for-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/settings/billing/usage
func (s *BillingService) GetEnterpriseUsageReport(ctx context.Context, enterprise string, opts *EnterpriseUsageReportOptions) (*EnterpriseUsageReport, *Response, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (s *BillingService) GetEnterpriseUsageReport(ctx context.Context, enterprise string, opts *EnterpriseUsageReportOptions) (*EnterpriseUsageReport, *Response, error) {
func (s *EnterpriseService) GetUsageReport(ctx context.Context, enterprise string, opts *EnterpriseUsageReportOptions) (*EnterpriseUsageReport, *Response, error) {

@gmlewis gmlewis changed the title Add enterprise billing usage endpoints and response types feat: Add enterprise billing usage endpoints and response types Jun 8, 2026
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.69231% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.38%. Comparing base (946bd71) to head (2aa7ca2).

Files with missing lines Patch % Lines
github/enterprise_billing.go 57.69% 11 Missing and 11 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4288      +/-   ##
==========================================
- Coverage   97.49%   97.38%   -0.11%     
==========================================
  Files         192      193       +1     
  Lines       19256    19308      +52     
==========================================
+ Hits        18774    18804      +30     
- Misses        267      278      +11     
- Partials      215      226      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants