Skip to content

Commit b4818cf

Browse files
docs: update Copilot API documentation links and deprecation notices
1 parent 6282c33 commit b4818cf

1 file changed

Lines changed: 34 additions & 32 deletions

File tree

github/copilot.go

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
// CopilotService provides access to the Copilot-related functions
1818
// in the GitHub API.
1919
//
20-
// GitHub API docs: https://docs.github.com/en/rest/copilot/
20+
// GitHub API docs: https://docs.github.com/rest/copilot?apiVersion=2022-11-28
2121
type CopilotService service
2222

2323
// CopilotOrganizationDetails represents the details of an organization's Copilot for Business subscription.
@@ -225,7 +225,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error {
225225
switch v := seatDetail.Assignee.(type) {
226226
case nil:
227227
// Assignee can be null according to GitHub API specification.
228-
// See: https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization
228+
// See: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization
229229
// Note: Copilot API is in public preview and subject to change.
230230
cp.Assignee = nil
231231
case map[string]any:
@@ -280,7 +280,7 @@ func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) {
280280

281281
// GetCopilotBilling gets Copilot for Business billing information and settings for an organization.
282282
//
283-
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-information-and-settings-for-an-organization
283+
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#get-copilot-seat-information-and-settings-for-an-organization
284284
//
285285
//meta:operation GET /orgs/{org}/copilot/billing
286286
func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*CopilotOrganizationDetails, *Response, error) {
@@ -304,7 +304,7 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Co
304304
//
305305
// To paginate through all seats, populate 'Page' with the number of the last page.
306306
//
307-
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization
307+
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization
308308
//
309309
//meta:operation GET /orgs/{org}/copilot/billing/seats
310310
func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) {
@@ -332,7 +332,7 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts
332332
//
333333
// To paginate through all seats, populate 'Page' with the number of the last page.
334334
//
335-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise
335+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-enterprise
336336
//
337337
//meta:operation GET /enterprises/{enterprise}/copilot/billing/seats
338338
func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterprise string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) {
@@ -358,7 +358,7 @@ func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterpr
358358

359359
// AddCopilotTeams adds teams to the Copilot for Business subscription for an organization.
360360
//
361-
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization
361+
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#add-teams-to-the-copilot-subscription-for-an-organization
362362
//
363363
//meta:operation POST /orgs/{org}/copilot/billing/selected_teams
364364
func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) {
@@ -386,7 +386,7 @@ func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNa
386386

387387
// RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization.
388388
//
389-
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization
389+
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#remove-teams-from-the-copilot-subscription-for-an-organization
390390
//
391391
//meta:operation DELETE /orgs/{org}/copilot/billing/selected_teams
392392
func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) {
@@ -414,7 +414,7 @@ func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, tea
414414

415415
// AddCopilotUsers adds users to the Copilot for Business subscription for an organization
416416
//
417-
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization
417+
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#add-users-to-the-copilot-subscription-for-an-organization
418418
//
419419
//meta:operation POST /orgs/{org}/copilot/billing/selected_users
420420
func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users []string) (*SeatAssignments, *Response, error) {
@@ -442,7 +442,7 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users
442442

443443
// RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization.
444444
//
445-
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization
445+
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#remove-users-from-the-copilot-subscription-for-an-organization
446446
//
447447
//meta:operation DELETE /orgs/{org}/copilot/billing/selected_users
448448
func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users []string) (*SeatCancellations, *Response, error) {
@@ -470,7 +470,7 @@ func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, use
470470

471471
// GetSeatDetails gets Copilot for Business seat assignment details for a user.
472472
//
473-
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-assignment-details-for-a-user
473+
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#get-copilot-seat-assignment-details-for-a-user
474474
//
475475
//meta:operation GET /orgs/{org}/members/{username}/copilot
476476
func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) (*CopilotSeatDetails, *Response, error) {
@@ -492,11 +492,11 @@ func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) (
492492

493493
// GetEnterpriseMetrics gets Copilot usage metrics for an enterprise.
494494
//
495-
// Deprecated: Focus has shifted to the new Download Copilot Usage Metrics APIs.
496-
// These endpoints are kept around for GitHub Enterprise Server users, but are no longer supported on the Public GitHub service.
497-
// Use GetEnterpriseDailyMetricsReport or GetEnterpriseMetricsReport instead.
495+
// Deprecated: This endpoint was closed down on April 2, 2026 for github.com.
496+
// It may still be available for GitHub Enterprise Server. Use GetEnterpriseDailyMetricsReport
497+
// or GetEnterpriseMetricsReport instead.
498498
//
499-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise
499+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-enterprise
500500
//
501501
//meta:operation GET /enterprises/{enterprise}/copilot/metrics
502502
func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) {
@@ -522,10 +522,11 @@ func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise st
522522

523523
// GetEnterpriseTeamMetrics gets Copilot usage metrics for an enterprise team.
524524
//
525-
// Deprecated: Focus has shifted to the new Download Copilot Usage Metrics APIs.
526-
// These endpoints are kept around for GitHub Enterprise Server users, but are no longer supported on the Public GitHub service.
525+
// Deprecated: This endpoint was closed down on April 2, 2026 for github.com.
526+
// It may still be available for GitHub Enterprise Server. Use GetEnterpriseDailyMetricsReport
527+
// or GetEnterpriseMetricsReport instead.
527528
//
528-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team
529+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-enterprise-team
529530
//
530531
//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics
531532
func (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterprise, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) {
@@ -551,11 +552,11 @@ func (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterpris
551552

552553
// GetOrganizationMetrics gets Copilot usage metrics for an organization.
553554
//
554-
// Deprecated: Focus has shifted to the new Download Copilot Usage Metrics APIs.
555-
// These endpoints are kept around for GitHub Enterprise Server users, but are no longer supported on the Public GitHub service.
556-
// Use GetOrganizationDailyMetricsReport or GetOrganizationMetricsReport instead.
555+
// Deprecated: This endpoint was closed down on April 2, 2026 for github.com.
556+
// It may still be available for GitHub Enterprise Server. Use GetOrganizationDailyMetricsReport
557+
// or GetOrganizationMetricsReport instead.
557558
//
558-
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization
559+
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-organization
559560
//
560561
//meta:operation GET /orgs/{org}/copilot/metrics
561562
func (s *CopilotService) GetOrganizationMetrics(ctx context.Context, org string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) {
@@ -581,10 +582,11 @@ func (s *CopilotService) GetOrganizationMetrics(ctx context.Context, org string,
581582

582583
// GetOrganizationTeamMetrics gets Copilot usage metrics for an organization team.
583584
//
584-
// Deprecated: Focus has shifted to the new Download Copilot Usage Metrics APIs.
585-
// These endpoints are kept around for GitHub Enterprise Server users, but are no longer supported on the Public GitHub service.
585+
// Deprecated: This endpoint was closed down on April 2, 2026 for github.com.
586+
// It may still be available for GitHub Enterprise Server. Use GetOrganizationDailyMetricsReport
587+
// or GetOrganizationMetricsReport instead.
586588
//
587-
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team
589+
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-a-team
588590
//
589591
//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/metrics
590592
func (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) {
@@ -610,7 +612,7 @@ func (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, te
610612

611613
// GetEnterpriseDailyMetricsReport gets a report containing Copilot metrics for a single day for an enterprise.
612614
//
613-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics-for-a-specific-day
615+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-enterprise-usage-metrics-for-a-specific-day
614616
//
615617
//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day
616618
func (s *CopilotService) GetEnterpriseDailyMetricsReport(ctx context.Context, enterprise string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) {
@@ -636,7 +638,7 @@ func (s *CopilotService) GetEnterpriseDailyMetricsReport(ctx context.Context, en
636638

637639
// GetEnterpriseMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an enterprise.
638640
//
639-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics
641+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-enterprise-usage-metrics
640642
//
641643
//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest
642644
func (s *CopilotService) GetEnterpriseMetricsReport(ctx context.Context, enterprise string) (*CopilotMetricsReport, *Response, error) {
@@ -658,7 +660,7 @@ func (s *CopilotService) GetEnterpriseMetricsReport(ctx context.Context, enterpr
658660

659661
// GetEnterpriseUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an enterprise.
660662
//
661-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics-for-a-specific-day
663+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-users-usage-metrics-for-a-specific-day
662664
//
663665
//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day
664666
func (s *CopilotService) GetEnterpriseUsersDailyMetricsReport(ctx context.Context, enterprise string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) {
@@ -684,7 +686,7 @@ func (s *CopilotService) GetEnterpriseUsersDailyMetricsReport(ctx context.Contex
684686

685687
// GetEnterpriseUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an enterprise.
686688
//
687-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics
689+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-users-usage-metrics
688690
//
689691
//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest
690692
func (s *CopilotService) GetEnterpriseUsersMetricsReport(ctx context.Context, enterprise string) (*CopilotMetricsReport, *Response, error) {
@@ -706,7 +708,7 @@ func (s *CopilotService) GetEnterpriseUsersMetricsReport(ctx context.Context, en
706708

707709
// GetOrganizationDailyMetricsReport gets a report containing Copilot metrics for a single day for an organization.
708710
//
709-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics-for-a-specific-day
711+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-usage-metrics-for-a-specific-day
710712
//
711713
//meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-1-day
712714
func (s *CopilotService) GetOrganizationDailyMetricsReport(ctx context.Context, org string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) {
@@ -732,7 +734,7 @@ func (s *CopilotService) GetOrganizationDailyMetricsReport(ctx context.Context,
732734

733735
// GetOrganizationMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an organization.
734736
//
735-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics
737+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-usage-metrics
736738
//
737739
//meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest
738740
func (s *CopilotService) GetOrganizationMetricsReport(ctx context.Context, org string) (*CopilotMetricsReport, *Response, error) {
@@ -754,7 +756,7 @@ func (s *CopilotService) GetOrganizationMetricsReport(ctx context.Context, org s
754756

755757
// GetOrganizationUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an organization.
756758
//
757-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics-for-a-specific-day
759+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-users-usage-metrics-for-a-specific-day
758760
//
759761
//meta:operation GET /orgs/{org}/copilot/metrics/reports/users-1-day
760762
func (s *CopilotService) GetOrganizationUsersDailyMetricsReport(ctx context.Context, org string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) {
@@ -780,7 +782,7 @@ func (s *CopilotService) GetOrganizationUsersDailyMetricsReport(ctx context.Cont
780782

781783
// GetOrganizationUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an organization.
782784
//
783-
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics
785+
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-users-usage-metrics
784786
//
785787
//meta:operation GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest
786788
func (s *CopilotService) GetOrganizationUsersMetricsReport(ctx context.Context, org string) (*CopilotMetricsReport, *Response, error) {

0 commit comments

Comments
 (0)