Skip to content

Commit

Permalink
chore: Deprecate legacy ID-based team methods (#3373)
Browse files Browse the repository at this point in the history
Fixes: #3368.
  • Loading branch information
stevehipwell authored Dec 9, 2024
1 parent e659f23 commit 0162c9d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions github/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti

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

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

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

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

// ListTeamReposByID lists the repositories given a team ID that the specified team has access to.
//
// Deprecated: Use ListTeamReposBySlug instead.
//
// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories
//
//meta:operation GET /orgs/{org}/teams/{team_slug}/repos
Expand Down Expand Up @@ -437,6 +447,8 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string
// repository is managed by team, a Repository is returned which includes the
// permissions team has for that repo.
//
// Deprecated: Use IsTeamRepoBySlug instead.
//
// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository
//
//meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
Expand Down Expand Up @@ -502,6 +514,8 @@ type TeamAddTeamRepoOptions struct {
// The specified repository must be owned by the organization to which the team
// belongs, or a direct fork of a repository owned by the organization.
//
// Deprecated: Use AddTeamRepoBySlug instead.
//
// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions
//
//meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
Expand Down Expand Up @@ -536,6 +550,8 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner,
// team given the team ID. Note that this does not delete the repository, it
// just removes it from the team.
//
// Deprecated: Use RemoveTeamRepoBySlug instead.
//
// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team
//
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
Expand Down Expand Up @@ -594,6 +610,8 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]

// ListTeamProjectsByID lists the organization projects for a team given the team ID.
//
// Deprecated: Use ListTeamProjectsBySlug instead.
//
// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects
//
//meta:operation GET /orgs/{org}/teams/{team_slug}/projects
Expand Down Expand Up @@ -645,6 +663,8 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str
// ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin
// permissions for an organization project.
//
// Deprecated: Use ReviewTeamProjectsBySlug instead.
//
// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project
//
//meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id}
Expand Down Expand Up @@ -708,6 +728,8 @@ type TeamProjectOptions struct {
// To add a project to a team or update the team's permission on a project, the
// authenticated user must have admin permissions for the project.
//
// Deprecated: Use AddTeamProjectBySlug instead.
//
// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions
//
//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}
Expand Down Expand Up @@ -751,6 +773,8 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin
// or project.
// Note: This endpoint removes the project from the team, but does not delete it.
//
// Deprecated: Use RemoveTeamProjectBySlug instead.
//
// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team
//
//meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}
Expand Down Expand Up @@ -839,6 +863,8 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri
// ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub
// given organization and team IDs.
//
// Deprecated: Use ListIDPGroupsForTeamBySlug instead.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team
//
//meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings
Expand Down Expand Up @@ -885,6 +911,8 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug
// CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection
// between a team and an IDP group given organization and team IDs.
//
// Deprecated: Use CreateOrUpdateIDPGroupConnectionsBySlug instead.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections
//
//meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings
Expand Down

0 comments on commit 0162c9d

Please sign in to comment.