feat: Add GetAICreditUsage endpoint for organization AI credits#4282
feat: Add GetAICreditUsage endpoint for organization AI credits#4282maishivamhoo123 wants to merge 3 commits into
GetAICreditUsage endpoint for organization AI credits#4282Conversation
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
|
@gmlewis I updated the code in billing.go as Recommended by @alexandear Ready for Review |
GetAICreditUsage endpoint for organization AI credits
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4282 +/- ##
=======================================
Coverage 97.49% 97.49%
=======================================
Files 192 192
Lines 19230 19243 +13
=======================================
+ Hits 18748 18761 +13
Misses 267 267
Partials 215 215 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@gmlewis @Not-Dhananjay-Mishra can you please review this? |
Are you interested in supporting the It seems to me like having a Thoughts? |
| // GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-ai-credit-usage-report-for-an-organization | ||
| // | ||
| //meta:operation GET /organizations/{org}/settings/billing/ai_credit/usage | ||
| func (s *BillingService) GetAICreditUsage(ctx context.Context, org string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) { |
There was a problem hiding this comment.
| func (s *BillingService) GetAICreditUsage(ctx context.Context, org string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) { | |
| func (s *BillingService) GetOrgAICreditUsage(ctx context.Context, org string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) { |
Closes #4262
Adds the
GetAICreditUsagemethod toBillingServiceto support theGET /organizations/{org}/settings/billing/ai_credit/usageendpoint.Changes:
PremiumRequestUsageReportOptionsandPremiumRequestUsageReportsince the request/response shapes are identical
org, and request/do failure
billing.goandbilling_test.gofilesper reviewer feedback from feat: Add
GetAICreditUsageendpoint for organization AI credits #4264