Skip to content

Commit 0162c9d

Browse files
authored
chore: Deprecate legacy ID-based team methods (#3373)
Fixes: #3368.
1 parent e659f23 commit 0162c9d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

github/teams.go

+28
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti
111111

112112
// GetTeamByID fetches a team, given a specified organization ID, by ID.
113113
//
114+
// Deprecated: Use GetTeamBySlug instead.
115+
//
114116
// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name
115117
//
116118
//meta:operation GET /orgs/{org}/teams/{team_slug}
@@ -237,6 +239,8 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent {
237239

238240
// EditTeamByID edits a team, given an organization ID, selected by ID.
239241
//
242+
// Deprecated: Use EditTeamBySlug instead.
243+
//
240244
// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team
241245
//
242246
//meta:operation PATCH /orgs/{org}/teams/{team_slug}
@@ -295,6 +299,8 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea
295299

296300
// DeleteTeamByID deletes a team referenced by ID.
297301
//
302+
// Deprecated: Use DeleteTeamBySlug instead.
303+
//
298304
// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team
299305
//
300306
//meta:operation DELETE /orgs/{org}/teams/{team_slug}
@@ -325,6 +331,8 @@ func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) (
325331

326332
// ListChildTeamsByParentID lists child teams for a parent team given parent ID.
327333
//
334+
// Deprecated: Use ListChildTeamsByParentSlug instead.
335+
//
328336
// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams
329337
//
330338
//meta:operation GET /orgs/{org}/teams/{team_slug}/teams
@@ -377,6 +385,8 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug
377385

378386
// ListTeamReposByID lists the repositories given a team ID that the specified team has access to.
379387
//
388+
// Deprecated: Use ListTeamReposBySlug instead.
389+
//
380390
// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories
381391
//
382392
//meta:operation GET /orgs/{org}/teams/{team_slug}/repos
@@ -437,6 +447,8 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string
437447
// repository is managed by team, a Repository is returned which includes the
438448
// permissions team has for that repo.
439449
//
450+
// Deprecated: Use IsTeamRepoBySlug instead.
451+
//
440452
// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository
441453
//
442454
//meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
@@ -502,6 +514,8 @@ type TeamAddTeamRepoOptions struct {
502514
// The specified repository must be owned by the organization to which the team
503515
// belongs, or a direct fork of a repository owned by the organization.
504516
//
517+
// Deprecated: Use AddTeamRepoBySlug instead.
518+
//
505519
// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions
506520
//
507521
//meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
@@ -536,6 +550,8 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner,
536550
// team given the team ID. Note that this does not delete the repository, it
537551
// just removes it from the team.
538552
//
553+
// Deprecated: Use RemoveTeamRepoBySlug instead.
554+
//
539555
// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team
540556
//
541557
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
@@ -594,6 +610,8 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]
594610

595611
// ListTeamProjectsByID lists the organization projects for a team given the team ID.
596612
//
613+
// Deprecated: Use ListTeamProjectsBySlug instead.
614+
//
597615
// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects
598616
//
599617
//meta:operation GET /orgs/{org}/teams/{team_slug}/projects
@@ -645,6 +663,8 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str
645663
// ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin
646664
// permissions for an organization project.
647665
//
666+
// Deprecated: Use ReviewTeamProjectsBySlug instead.
667+
//
648668
// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project
649669
//
650670
//meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id}
@@ -708,6 +728,8 @@ type TeamProjectOptions struct {
708728
// To add a project to a team or update the team's permission on a project, the
709729
// authenticated user must have admin permissions for the project.
710730
//
731+
// Deprecated: Use AddTeamProjectBySlug instead.
732+
//
711733
// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions
712734
//
713735
//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}
@@ -751,6 +773,8 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin
751773
// or project.
752774
// Note: This endpoint removes the project from the team, but does not delete it.
753775
//
776+
// Deprecated: Use RemoveTeamProjectBySlug instead.
777+
//
754778
// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team
755779
//
756780
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}
@@ -839,6 +863,8 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri
839863
// ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub
840864
// given organization and team IDs.
841865
//
866+
// Deprecated: Use ListIDPGroupsForTeamBySlug instead.
867+
//
842868
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team
843869
//
844870
//meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings
@@ -885,6 +911,8 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug
885911
// CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection
886912
// between a team and an IDP group given organization and team IDs.
887913
//
914+
// Deprecated: Use CreateOrUpdateIDPGroupConnectionsBySlug instead.
915+
//
888916
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections
889917
//
890918
//meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings

0 commit comments

Comments
 (0)