Skip to content

Commit 90075ee

Browse files
chore: Mark removed billing endpoints as deprecated (#4362)
1 parent 1cb3999 commit 90075ee

3 files changed

Lines changed: 39 additions & 18 deletions

File tree

github/billing.go

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ type PremiumRequestUsageReport struct {
173173

174174
// GetOrganizationPackagesBilling returns the free and paid storage used for GitHub Packages in gigabytes for an Org.
175175
//
176-
// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.
177-
// See https://github.com/google/go-github/issues/3894 for details.
176+
// Deprecated: This endpoint has been deprecated by GitHub.
177+
//
178+
// GitHub API docs: https://docs.github.com/rest/billing/billing?apiVersion=2022-11-28#get-github-packages-billing-for-an-organization
179+
//
180+
//meta:operation GET /orgs/{org}/settings/billing/packages
178181
func (s *BillingService) GetOrganizationPackagesBilling(ctx context.Context, org string) (*PackagesBilling, *Response, error) {
179182
u := fmt.Sprintf("orgs/%v/settings/billing/packages", org)
180183
req, err := s.client.NewRequest(ctx, "GET", u, nil)
@@ -194,8 +197,11 @@ func (s *BillingService) GetOrganizationPackagesBilling(ctx context.Context, org
194197
// GetOrganizationStorageBilling returns the estimated paid and estimated total storage used for GitHub Actions
195198
// and GitHub Packages in gigabytes for an Org.
196199
//
197-
// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.
198-
// See https://github.com/google/go-github/issues/3894 for details.
200+
// Deprecated: This endpoint has been deprecated by GitHub.
201+
//
202+
// GitHub API docs: https://docs.github.com/rest/billing/billing?apiVersion=2022-11-28#get-shared-storage-billing-for-an-organization
203+
//
204+
//meta:operation GET /orgs/{org}/settings/billing/shared-storage
199205
func (s *BillingService) GetOrganizationStorageBilling(ctx context.Context, org string) (*StorageBilling, *Response, error) {
200206
u := fmt.Sprintf("orgs/%v/settings/billing/shared-storage", org)
201207
req, err := s.client.NewRequest(ctx, "GET", u, nil)
@@ -240,8 +246,11 @@ func (s *BillingService) GetOrganizationAdvancedSecurityActiveCommitters(ctx con
240246

241247
// GetPackagesBilling returns the free and paid storage used for GitHub Packages in gigabytes for a user.
242248
//
243-
// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.
244-
// See https://github.com/google/go-github/issues/3894 for details.
249+
// Deprecated: This endpoint has been deprecated by GitHub.
250+
//
251+
// GitHub API docs: https://docs.github.com/rest/billing/billing?apiVersion=2022-11-28#get-github-packages-billing-for-a-user
252+
//
253+
//meta:operation GET /users/{username}/settings/billing/packages
245254
func (s *BillingService) GetPackagesBilling(ctx context.Context, user string) (*PackagesBilling, *Response, error) {
246255
u := fmt.Sprintf("users/%v/settings/billing/packages", user)
247256
req, err := s.client.NewRequest(ctx, "GET", u, nil)
@@ -261,8 +270,11 @@ func (s *BillingService) GetPackagesBilling(ctx context.Context, user string) (*
261270
// GetStorageBilling returns the estimated paid and estimated total storage used for GitHub Actions
262271
// and GitHub Packages in gigabytes for a user.
263272
//
264-
// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.
265-
// See https://github.com/google/go-github/issues/3894 for details.
273+
// Deprecated: This endpoint has been deprecated by GitHub.
274+
//
275+
// GitHub API docs: https://docs.github.com/rest/billing/billing?apiVersion=2022-11-28#get-shared-storage-billing-for-a-user
276+
//
277+
//meta:operation GET /users/{username}/settings/billing/shared-storage
266278
func (s *BillingService) GetStorageBilling(ctx context.Context, user string) (*StorageBilling, *Response, error) {
267279
u := fmt.Sprintf("users/%v/settings/billing/shared-storage", user)
268280
req, err := s.client.NewRequest(ctx, "GET", u, nil)

openapi_operations.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ operations:
5353
- name: GET /orgs/{org}/copilot/metrics
5454
documentation_url: https://docs.github.com/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-organization
5555
deprecated: true
56+
- name: GET /orgs/{org}/settings/billing/packages
57+
documentation_url: https://docs.github.com/rest/billing/billing?apiVersion=2022-11-28#get-github-packages-billing-for-an-organization
58+
deprecated: true
59+
- name: GET /orgs/{org}/settings/billing/shared-storage
60+
documentation_url: https://docs.github.com/rest/billing/billing?apiVersion=2022-11-28#get-shared-storage-billing-for-an-organization
61+
deprecated: true
5662
- name: GET /orgs/{org}/team/{team_slug}/copilot/metrics
5763
documentation_url: https://docs.github.com/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-a-team
5864
deprecated: true
@@ -64,6 +70,12 @@ operations:
6470
documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request
6571
- name: GET /repositories/{repository_id}
6672
- name: GET /repositories/{repository_id}/installation
73+
- name: GET /users/{username}/settings/billing/packages
74+
documentation_url: https://docs.github.com/rest/billing/billing?apiVersion=2022-11-28#get-github-packages-billing-for-a-user
75+
deprecated: true
76+
- name: GET /users/{username}/settings/billing/shared-storage
77+
documentation_url: https://docs.github.com/rest/billing/billing?apiVersion=2022-11-28#get-shared-storage-billing-for-a-user
78+
deprecated: true
6779
operation_overrides:
6880
- name: GET /meta
6981
documentation_url: https://docs.github.com/rest/meta/meta#get-github-meta-information

tools/metadata/metadata.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -563,15 +563,12 @@ func nodeServiceMethod(fn *ast.FuncDecl) string {
563563
return serviceMethod
564564
}
565565

566-
// See: https://github.com/google/go-github/issues/3894
566+
// skipServiceMethod lists helper methods that download from URLs returned by
567+
// other endpoints and therefore have no REST API operation of their own.
567568
var skipServiceMethod = map[string]bool{
568-
"BillingService.GetOrganizationPackagesBilling": true,
569-
"BillingService.GetOrganizationStorageBilling": true,
570-
"BillingService.GetPackagesBilling": true,
571-
"BillingService.GetStorageBilling": true,
572-
"CopilotService.DownloadCopilotMetrics": true,
573-
"CopilotService.DownloadDailyMetrics": true,
574-
"CopilotService.DownloadPeriodicMetrics": true,
575-
"CopilotService.DownloadUserDailyMetrics": true,
576-
"CopilotService.DownloadUserPeriodicMetrics": true,
569+
"CopilotService.DownloadCopilotMetrics": true,
570+
"CopilotService.DownloadDailyMetrics": true,
571+
"CopilotService.DownloadPeriodicMetrics": true,
572+
"CopilotService.DownloadUserDailyMetrics": true,
573+
"CopilotService.DownloadUserPeriodicMetrics": true,
577574
}

0 commit comments

Comments
 (0)