Skip to content

Commit a71c43b

Browse files
committed
chore: Validate metadata
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
1 parent 7584692 commit a71c43b

7 files changed

Lines changed: 162 additions & 44 deletions

File tree

github/apps.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@ func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id i
426426

427427
// CreateAttachment creates a new attachment on user comment containing a url.
428428
//
429+
// Deprecated: This endpoint has been deprecated by GitHub.
430+
//
429431
// GitHub API docs: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment
430432
//
431433
//meta:operation POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments

github/reactions.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, tea
429429

430430
// DeleteTeamDiscussionReaction deletes the reaction to a team discussion.
431431
//
432+
// Deprecated: This endpoint has been deprecated by GitHub.
433+
//
432434
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#delete-team-discussion-reaction
433435
//
434436
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}
@@ -440,6 +442,8 @@ func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org
440442

441443
// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID.
442444
//
445+
// Deprecated: This endpoint has been deprecated by GitHub.
446+
//
443447
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion
444448
//
445449
//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
@@ -508,6 +512,8 @@ func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Conte
508512

509513
// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment.
510514
//
515+
// Deprecated: This endpoint has been deprecated by GitHub.
516+
//
511517
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#delete-team-discussion-comment-reaction
512518
//
513519
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}
@@ -519,6 +525,8 @@ func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Conte
519525

520526
// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID.
521527
//
528+
// Deprecated: This endpoint has been deprecated by GitHub.
529+
//
522530
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment
523531
//
524532
//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions

github/teams.go

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,9 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti
123123

124124
// GetTeamByID fetches a team, given a specified organization ID, by ID.
125125
//
126-
// Deprecated: Use GetTeamBySlug instead.
127-
//
128126
// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#get-a-team-by-name
129127
//
130-
//meta:operation GET /orgs/{org}/teams/{team_slug}
128+
//meta:operation GET /organizations/{organization_id}/team/{team_id}
131129
func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*Team, *Response, error) {
132130
u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID)
133131
req, err := s.client.NewRequest(ctx, "GET", u, nil)
@@ -251,11 +249,9 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent {
251249

252250
// EditTeamByID edits a team, given an organization ID, selected by ID.
253251
//
254-
// Deprecated: Use EditTeamBySlug instead.
255-
//
256252
// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#update-a-team
257253
//
258-
//meta:operation PATCH /orgs/{org}/teams/{team_slug}
254+
//meta:operation PATCH /organizations/{organization_id}/team/{team_id}
259255
func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, body NewTeam, removeParent bool) (*Team, *Response, error) {
260256
u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID)
261257

@@ -311,11 +307,9 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, bod
311307

312308
// DeleteTeamByID deletes a team referenced by ID.
313309
//
314-
// Deprecated: Use DeleteTeamBySlug instead.
315-
//
316310
// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#delete-a-team
317311
//
318-
//meta:operation DELETE /orgs/{org}/teams/{team_slug}
312+
//meta:operation DELETE /organizations/{organization_id}/team/{team_id}
319313
func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) (*Response, error) {
320314
u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID)
321315
req, err := s.client.NewRequest(ctx, "DELETE", u, nil)
@@ -343,11 +337,9 @@ func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) (
343337

344338
// ListChildTeamsByParentID lists child teams for a parent team given parent ID.
345339
//
346-
// Deprecated: Use ListChildTeamsByParentSlug instead.
347-
//
348340
// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-child-teams
349341
//
350-
//meta:operation GET /orgs/{org}/teams/{team_slug}/teams
342+
//meta:operation GET /organizations/{organization_id}/team/{team_id}/teams
351343
func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Team, *Response, error) {
352344
u := fmt.Sprintf("organizations/%v/team/%v/teams", orgID, teamID)
353345
u, err := addOptions(u, opts)
@@ -397,11 +389,9 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug
397389

398390
// ListTeamReposByID lists the repositories given a team ID that the specified team has access to.
399391
//
400-
// Deprecated: Use ListTeamReposBySlug instead.
401-
//
402392
// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-team-repositories
403393
//
404-
//meta:operation GET /orgs/{org}/teams/{team_slug}/repos
394+
//meta:operation GET /organizations/{organization_id}/team/{team_id}/repos
405395
func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Repository, *Response, error) {
406396
u := fmt.Sprintf("organizations/%v/team/%v/repos", orgID, teamID)
407397
u, err := addOptions(u, opts)
@@ -457,11 +447,9 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string
457447
// repository is managed by team, a Repository is returned which includes the
458448
// permissions team has for that repo.
459449
//
460-
// Deprecated: Use IsTeamRepoBySlug instead.
461-
//
462450
// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#check-team-permissions-for-a-repository
463451
//
464-
//meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
452+
//meta:operation GET /organizations/{organization_id}/team/{team_id}/repos/{owner}/{repo}
465453
func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Repository, *Response, error) {
466454
u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo)
467455
req, err := s.client.NewRequest(ctx, "GET", u, nil)
@@ -524,11 +512,9 @@ type TeamAddTeamRepoOptions struct {
524512
// The specified repository must be owned by the organization to which the team
525513
// belongs, or a direct fork of a repository owned by the organization.
526514
//
527-
// Deprecated: Use AddTeamRepoBySlug instead.
528-
//
529515
// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#add-or-update-team-repository-permissions
530516
//
531-
//meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
517+
//meta:operation PUT /organizations/{organization_id}/team/{team_id}/repos/{owner}/{repo}
532518
func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, body *TeamAddTeamRepoOptions) (*Response, error) {
533519
u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo)
534520
req, err := s.client.NewRequest(ctx, "PUT", u, body)
@@ -560,11 +546,9 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner,
560546
// team given the team ID. Note that this does not delete the repository, it
561547
// just removes it from the team.
562548
//
563-
// Deprecated: Use RemoveTeamRepoBySlug instead.
564-
//
565549
// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#remove-a-repository-from-a-team
566550
//
567-
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
551+
//meta:operation DELETE /organizations/{organization_id}/team/{team_id}/repos/{owner}/{repo}
568552
func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Response, error) {
569553
u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo)
570554
req, err := s.client.NewRequest(ctx, "DELETE", u, nil)
@@ -620,11 +604,11 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]
620604

621605
// ListTeamProjectsByID lists the organization projects for a team given the team ID.
622606
//
623-
// Deprecated: Use ListTeamProjectsBySlug instead.
607+
// Deprecated: This endpoint has been deprecated by GitHub.
624608
//
625609
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#list-team-projects
626610
//
627-
//meta:operation GET /orgs/{org}/teams/{team_slug}/projects
611+
//meta:operation GET /organizations/{organization_id}/team/{team_id}/projects
628612
func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*ProjectV2, *Response, error) {
629613
u := fmt.Sprintf("organizations/%v/team/%v/projects", orgID, teamID)
630614

@@ -673,11 +657,11 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str
673657
// ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin
674658
// permissions for an organization project.
675659
//
676-
// Deprecated: Use ReviewTeamProjectsBySlug instead.
660+
// Deprecated: This endpoint has been deprecated by GitHub.
677661
//
678662
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#check-team-permissions-for-a-project
679663
//
680-
//meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id}
664+
//meta:operation GET /organizations/{organization_id}/team/{team_id}/projects/{project_id}
681665
func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*ProjectV2, *Response, error) {
682666
u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID)
683667
req, err := s.client.NewRequest(ctx, "GET", u, nil)
@@ -738,11 +722,11 @@ type TeamProjectOptions struct {
738722
// To add a project to a team or update the team's permission on a project, the
739723
// authenticated user must have admin permissions for the project.
740724
//
741-
// Deprecated: Use AddTeamProjectBySlug instead.
725+
// Deprecated: This endpoint has been deprecated by GitHub.
742726
//
743727
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#add-or-update-team-project-permissions
744728
//
745-
//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}
729+
//meta:operation PUT /organizations/{organization_id}/team/{team_id}/projects/{project_id}
746730
func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64, body *TeamProjectOptions) (*Response, error) {
747731
u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID)
748732
req, err := s.client.NewRequest(ctx, "PUT", u, body)
@@ -783,11 +767,11 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin
783767
// or project.
784768
// Note: This endpoint removes the project from the team, but does not delete it.
785769
//
786-
// Deprecated: Use RemoveTeamProjectBySlug instead.
770+
// Deprecated: This endpoint has been deprecated by GitHub.
787771
//
788772
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#remove-a-project-from-a-team
789773
//
790-
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}
774+
//meta:operation DELETE /organizations/{organization_id}/team/{team_id}/projects/{project_id}
791775
func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64) (*Response, error) {
792776
u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID)
793777
req, err := s.client.NewRequest(ctx, "DELETE", u, nil)
@@ -873,11 +857,9 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri
873857
// ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub
874858
// given organization and team IDs.
875859
//
876-
// Deprecated: Use ListIDPGroupsForTeamBySlug instead.
877-
//
878860
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#list-idp-groups-for-a-team
879861
//
880-
//meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings
862+
//meta:operation GET /organizations/{organization_id}/team/{team_id}/team-sync/group-mappings
881863
func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) {
882864
u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID)
883865

@@ -921,11 +903,9 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug
921903
// CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection
922904
// between a team and an IDP group given organization and team IDs.
923905
//
924-
// Deprecated: Use CreateOrUpdateIDPGroupConnectionsBySlug instead.
925-
//
926906
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#create-or-update-idp-group-connections
927907
//
928-
//meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings
908+
//meta:operation PATCH /organizations/{organization_id}/team/{team_id}/team-sync/group-mappings
929909
func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, body IDPGroupList) (*IDPGroupList, *Response, error) {
930910
u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID)
931911

github/teams_discussion_comments.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ type DiscussionCommentListOptions struct {
4343
// ListCommentsByID lists all comments on a team discussion by team ID.
4444
// Authenticated user must grant read:discussion scope.
4545
//
46+
// Deprecated: This endpoint has been deprecated by GitHub.
47+
//
4648
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#list-discussion-comments
4749
//
4850
//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments
@@ -70,6 +72,8 @@ func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64
7072
// ListCommentsBySlug lists all comments on a team discussion by team slug.
7173
// Authenticated user must grant read:discussion scope.
7274
//
75+
// Deprecated: This endpoint has been deprecated by GitHub.
76+
//
7377
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#list-discussion-comments
7478
//
7579
//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments
@@ -97,6 +101,8 @@ func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string,
97101
// GetCommentByID gets a specific comment on a team discussion by team ID.
98102
// Authenticated user must grant read:discussion scope.
99103
//
104+
// Deprecated: This endpoint has been deprecated by GitHub.
105+
//
100106
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#get-a-discussion-comment
101107
//
102108
//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}
@@ -119,6 +125,8 @@ func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64,
119125
// GetCommentBySlug gets a specific comment on a team discussion by team slug.
120126
// Authenticated user must grant read:discussion scope.
121127
//
128+
// Deprecated: This endpoint has been deprecated by GitHub.
129+
//
122130
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#get-a-discussion-comment
123131
//
124132
//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}
@@ -142,6 +150,8 @@ func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, d
142150
// CreateCommentByID creates a new comment on a team discussion by team ID.
143151
// Authenticated user must grant write:discussion scope.
144152
//
153+
// Deprecated: This endpoint has been deprecated by GitHub.
154+
//
145155
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#create-a-discussion-comment
146156
//
147157
//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments
@@ -164,6 +174,8 @@ func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int6
164174
// CreateCommentBySlug creates a new comment on a team discussion by team slug.
165175
// Authenticated user must grant write:discussion scope.
166176
//
177+
// Deprecated: This endpoint has been deprecated by GitHub.
178+
//
167179
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#create-a-discussion-comment
168180
//
169181
//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments
@@ -187,6 +199,8 @@ func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string
187199
// Authenticated user must grant write:discussion scope.
188200
// User is allowed to edit body of a comment only.
189201
//
202+
// Deprecated: This endpoint has been deprecated by GitHub.
203+
//
190204
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#update-a-discussion-comment
191205
//
192206
//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}
@@ -210,6 +224,8 @@ func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64,
210224
// Authenticated user must grant write:discussion scope.
211225
// User is allowed to edit body of a comment only.
212226
//
227+
// Deprecated: This endpoint has been deprecated by GitHub.
228+
//
213229
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#update-a-discussion-comment
214230
//
215231
//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}
@@ -232,6 +248,8 @@ func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string,
232248
// DeleteCommentByID deletes a comment on a team discussion by team ID.
233249
// Authenticated user must grant write:discussion scope.
234250
//
251+
// Deprecated: This endpoint has been deprecated by GitHub.
252+
//
235253
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#delete-a-discussion-comment
236254
//
237255
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}
@@ -248,6 +266,8 @@ func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int6
248266
// DeleteCommentBySlug deletes a comment on a team discussion by team slug.
249267
// Authenticated user must grant write:discussion scope.
250268
//
269+
// Deprecated: This endpoint has been deprecated by GitHub.
270+
//
251271
// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#delete-a-discussion-comment
252272
//
253273
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}

0 commit comments

Comments
 (0)