Skip to content

Commit 946bd71

Browse files
authored
feat: Inject OpenAPI deprecations safely (#4286)
1 parent 8e869c8 commit 946bd71

8 files changed

Lines changed: 183 additions & 8 deletions

File tree

github/codespaces_orgs.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ func (s *CodespacesService) ListInOrg(ctx context.Context, org string, opts *Lis
4848

4949
// SetOrgAccessControl sets which users can access codespaces in an organization.
5050
//
51+
// Deprecated: This endpoint has been deprecated by GitHub.
52+
//
5153
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#manage-access-control-for-organization-codespaces
5254
//
5355
//meta:operation PUT /orgs/{org}/codespaces/access
@@ -68,6 +70,8 @@ func (s *CodespacesService) SetOrgAccessControl(ctx context.Context, org string,
6870

6971
// AddUsersToOrgAccess adds users to Codespaces access for an organization.
7072
//
73+
// Deprecated: This endpoint has been deprecated by GitHub.
74+
//
7175
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#add-users-to-codespaces-access-for-an-organization
7276
//
7377
//meta:operation POST /orgs/{org}/codespaces/access/selected_users
@@ -88,6 +92,8 @@ func (s *CodespacesService) AddUsersToOrgAccess(ctx context.Context, org string,
8892

8993
// RemoveUsersFromOrgAccess removes users from Codespaces access for an organization.
9094
//
95+
// Deprecated: This endpoint has been deprecated by GitHub.
96+
//
9197
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#remove-users-from-codespaces-access-for-an-organization
9298
//
9399
//meta:operation DELETE /orgs/{org}/codespaces/access/selected_users

github/enterprise_code_security_and_analysis.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ type EnterpriseSecurityAnalysisSettings struct {
2121

2222
// GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise.
2323
//
24+
// Deprecated: This endpoint has been deprecated by GitHub.
25+
//
2426
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#get-code-security-and-analysis-features-for-an-enterprise
2527
//
2628
//meta:operation GET /enterprises/{enterprise}/code_security_and_analysis
@@ -43,6 +45,8 @@ func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, ente
4345

4446
// UpdateCodeSecurityAndAnalysis updates code security and analysis features for new repositories in an enterprise.
4547
//
48+
// Deprecated: This endpoint has been deprecated by GitHub.
49+
//
4650
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#update-code-security-and-analysis-features-for-an-enterprise
4751
//
4852
//meta:operation PATCH /enterprises/{enterprise}/code_security_and_analysis
@@ -66,6 +70,8 @@ func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, e
6670
// Valid values for securityProduct: "advanced_security", "secret_scanning", "secret_scanning_push_protection".
6771
// Valid values for enablement: "enable_all", "disable_all".
6872
//
73+
// Deprecated: This endpoint has been deprecated by GitHub.
74+
//
6975
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#enable-or-disable-a-security-feature
7076
//
7177
//meta:operation POST /enterprises/{enterprise}/{security_product}/{enablement}

github/migrations_source_import.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ func (f LargeFile) String() string {
146146

147147
// StartImport initiates a repository import.
148148
//
149+
// Deprecated: This endpoint has been deprecated by GitHub.
150+
//
149151
// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#start-an-import
150152
//
151153
//meta:operation PUT /repos/{owner}/{repo}/import
@@ -167,6 +169,8 @@ func (s *MigrationService) StartImport(ctx context.Context, owner, repo string,
167169

168170
// ImportProgress queries for the status and progress of an ongoing repository import.
169171
//
172+
// Deprecated: This endpoint has been deprecated by GitHub.
173+
//
170174
// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-an-import-status
171175
//
172176
//meta:operation GET /repos/{owner}/{repo}/import
@@ -188,6 +192,8 @@ func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo strin
188192

189193
// UpdateImport initiates a repository import.
190194
//
195+
// Deprecated: This endpoint has been deprecated by GitHub.
196+
//
191197
// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#update-an-import
192198
//
193199
//meta:operation PATCH /repos/{owner}/{repo}/import
@@ -219,6 +225,8 @@ func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string,
219225
// This method and MapCommitAuthor allow you to provide correct Git author
220226
// information.
221227
//
228+
// Deprecated: This endpoint has been deprecated by GitHub.
229+
//
222230
// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-commit-authors
223231
//
224232
//meta:operation GET /repos/{owner}/{repo}/import/authors
@@ -242,6 +250,8 @@ func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string
242250
// application can continue updating authors any time before you push new
243251
// commits to the repository.
244252
//
253+
// Deprecated: This endpoint has been deprecated by GitHub.
254+
//
245255
// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#map-a-commit-author
246256
//
247257
//meta:operation PATCH /repos/{owner}/{repo}/import/authors/{author_id}
@@ -265,6 +275,8 @@ func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo stri
265275
// files larger than 100MB. Only the UseLFS field on the provided Import is
266276
// used.
267277
//
278+
// Deprecated: This endpoint has been deprecated by GitHub.
279+
//
268280
// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#update-git-lfs-preference
269281
//
270282
//meta:operation PATCH /repos/{owner}/{repo}/import/lfs
@@ -286,6 +298,8 @@ func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo str
286298

287299
// LargeFiles lists files larger than 100MB found during the import.
288300
//
301+
// Deprecated: This endpoint has been deprecated by GitHub.
302+
//
289303
// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-large-files
290304
//
291305
//meta:operation GET /repos/{owner}/{repo}/import/large_files
@@ -307,6 +321,8 @@ func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) (
307321

308322
// CancelImport stops an import for a repository.
309323
//
324+
// Deprecated: This endpoint has been deprecated by GitHub.
325+
//
310326
// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#cancel-an-import
311327
//
312328
//meta:operation DELETE /repos/{owner}/{repo}/import

github/reactions.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Cont
371371

372372
// ListTeamDiscussionReactions lists the reactions for a team discussion.
373373
//
374+
// Deprecated: This endpoint has been deprecated by GitHub.
375+
//
374376
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy
375377
//
376378
//meta:operation GET /teams/{team_id}/discussions/{discussion_number}/reactions
@@ -400,6 +402,8 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team
400402
// CreateTeamDiscussionReaction creates a reaction for a team discussion.
401403
// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes".
402404
//
405+
// Deprecated: This endpoint has been deprecated by GitHub.
406+
//
403407
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy
404408
//
405409
//meta:operation POST /teams/{team_id}/discussions/{discussion_number}/reactions
@@ -447,6 +451,8 @@ func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx cont
447451

448452
// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment.
449453
//
454+
// Deprecated: This endpoint has been deprecated by GitHub.
455+
//
450456
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy
451457
//
452458
//meta:operation GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
@@ -475,6 +481,8 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex
475481
// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment.
476482
// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes".
477483
//
484+
// Deprecated: This endpoint has been deprecated by GitHub.
485+
//
478486
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy
479487
//
480488
//meta:operation POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions

github/teams.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,8 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i
641641

642642
// ListTeamProjectsBySlug lists the organization projects for a team given the team slug.
643643
//
644+
// Deprecated: This endpoint has been deprecated by GitHub.
645+
//
644646
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#list-team-projects
645647
//
646648
//meta:operation GET /orgs/{org}/teams/{team_slug}/projects
@@ -692,6 +694,8 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID
692694
// ReviewTeamProjectsBySlug checks whether a team, given its slug, has read, write, or admin
693695
// permissions for an organization project.
694696
//
697+
// Deprecated: This endpoint has been deprecated by GitHub.
698+
//
695699
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#check-team-permissions-for-a-project
696700
//
697701
//meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id}
@@ -750,6 +754,8 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr
750754
// To add a project to a team or update the team's permission on a project, the
751755
// authenticated user must have admin permissions for the project.
752756
//
757+
// Deprecated: This endpoint has been deprecated by GitHub.
758+
//
753759
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#add-or-update-team-project-permissions
754760
//
755761
//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}
@@ -796,6 +802,8 @@ func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID,
796802
// or project.
797803
// Note: This endpoint removes the project from the team, but does not delete it.
798804
//
805+
// Deprecated: This endpoint has been deprecated by GitHub.
806+
//
799807
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#remove-a-project-from-a-team
800808
//
801809
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}

0 commit comments

Comments
 (0)