Skip to content

chore: Deprecate legacy ID-based team methods #3373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions github/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,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 @@ -232,6 +234,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 @@ -290,6 +294,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 @@ -320,6 +326,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 @@ -372,6 +380,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 @@ -432,6 +442,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 @@ -497,6 +509,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 @@ -531,6 +545,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 @@ -589,6 +605,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 @@ -640,6 +658,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 @@ -703,6 +723,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 @@ -746,6 +768,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 @@ -834,6 +858,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 @@ -880,6 +906,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
Loading