From d29e8e91db495609fcb84c5f2a5b8f990f571b75 Mon Sep 17 00:00:00 2001 From: maishivamhoo123 Date: Mon, 16 Mar 2026 13:37:53 +0530 Subject: [PATCH] Remove deprecated permission property from NewTeam struct --- github/github-accessors.go | 8 -------- github/github-accessors_test.go | 11 ----------- github/github-stringify_test.go | 3 +-- github/teams.go | 7 ------- github/teams_test.go | 2 -- 5 files changed, 1 insertion(+), 30 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index b529e5e4675..0b89fe4c920 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -16686,14 +16686,6 @@ func (n *NewTeam) GetParentTeamID() int64 { return *n.ParentTeamID } -// GetPermission returns the Permission field if it's non-nil, zero value otherwise. -func (n *NewTeam) GetPermission() string { - if n == nil || n.Permission == nil { - return "" - } - return *n.Permission -} - // GetPrivacy returns the Privacy field if it's non-nil, zero value otherwise. func (n *NewTeam) GetPrivacy() string { if n == nil || n.Privacy == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 84aa1a4190e..a3ceb921618 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -21697,17 +21697,6 @@ func TestNewTeam_GetParentTeamID(tt *testing.T) { n.GetParentTeamID() } -func TestNewTeam_GetPermission(tt *testing.T) { - tt.Parallel() - var zeroValue string - n := &NewTeam{Permission: &zeroValue} - n.GetPermission() - n = &NewTeam{} - n.GetPermission() - n = nil - n.GetPermission() -} - func TestNewTeam_GetPrivacy(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 98cdbbf9d0c..c69a897626c 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1167,11 +1167,10 @@ func TestNewTeam_String(t *testing.T) { RepoNames: []string{""}, ParentTeamID: Ptr(int64(0)), NotificationSetting: Ptr(""), - Permission: Ptr(""), Privacy: Ptr(""), LDAPDN: Ptr(""), } - want := `github.NewTeam{Name:"", Description:"", Maintainers:[""], RepoNames:[""], ParentTeamID:0, NotificationSetting:"", Permission:"", Privacy:"", LDAPDN:""}` + want := `github.NewTeam{Name:"", Description:"", Maintainers:[""], RepoNames:[""], ParentTeamID:0, NotificationSetting:"", Privacy:"", LDAPDN:""}` if got := v.String(); got != want { t.Errorf("NewTeam.String = %v, want %v", got, want) } diff --git a/github/teams.go b/github/teams.go index cf9a616d3fd..4265612ae6d 100644 --- a/github/teams.go +++ b/github/teams.go @@ -171,13 +171,6 @@ type NewTeam struct { // NotificationSetting can be one of: "notifications_enabled", "notifications_disabled". NotificationSetting *string `json:"notification_setting,omitempty"` - // Deprecated: Permission is deprecated when creating or editing a team in an org - // using the new GitHub permission model. It no longer identifies the - // permission a team has on its repos, but only specifies the default - // permission a repo is initially added with. Avoid confusion by - // specifying a permission value when calling AddTeamRepo. - Permission *string `json:"permission,omitempty"` - // Privacy identifies the level of privacy this team should have. // Possible values are: // secret - only visible to organization owners and members of this team diff --git a/github/teams_test.go b/github/teams_test.go index 2efc1cd4f9a..46d1a117085 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -1588,7 +1588,6 @@ func TestNewTeam_Marshal(t *testing.T) { RepoNames: []string{"repo1", "repo2"}, NotificationSetting: Ptr("notifications_enabled"), ParentTeamID: Ptr(int64(1)), - Permission: Ptr("perm"), Privacy: Ptr("p"), LDAPDN: Ptr("l"), } @@ -1600,7 +1599,6 @@ func TestNewTeam_Marshal(t *testing.T) { "repo_names": ["repo1", "repo2"], "parent_team_id": 1, "notification_setting": "notifications_enabled", - "permission": "perm", "privacy": "p", "ldap_dn": "l" }`