Skip to content

Commit 8bec011

Browse files
authored
Add NotificationSetting to NewTeam (#3111)
Fixes: #3107.
1 parent b3e96fd commit 8bec011

File tree

5 files changed

+42
-18
lines changed

5 files changed

+42
-18
lines changed

github/github-accessors.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-stringify_test.go

Lines changed: 11 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/teams.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ type NewTeam struct {
155155
RepoNames []string `json:"repo_names,omitempty"`
156156
ParentTeamID *int64 `json:"parent_team_id,omitempty"`
157157

158+
// NotificationSetting can be one of: "notifications_enabled", "notifications_disabled".
159+
NotificationSetting *string `json:"notification_setting,omitempty"`
160+
158161
// Deprecated: Permission is deprecated when creating or editing a team in an org
159162
// using the new GitHub permission model. It no longer identifies the
160163
// permission a team has on its repos, but only specifies the default

github/teams_test.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,14 +1590,15 @@ func TestNewTeam_Marshal(t *testing.T) {
15901590
testJSONMarshal(t, &NewTeam{}, "{}")
15911591

15921592
u := &NewTeam{
1593-
Name: "n",
1594-
Description: String("d"),
1595-
Maintainers: []string{"m1", "m2"},
1596-
RepoNames: []string{"repo1", "repo2"},
1597-
ParentTeamID: Int64(1),
1598-
Permission: String("perm"),
1599-
Privacy: String("p"),
1600-
LDAPDN: String("l"),
1593+
Name: "n",
1594+
Description: String("d"),
1595+
Maintainers: []string{"m1", "m2"},
1596+
RepoNames: []string{"repo1", "repo2"},
1597+
NotificationSetting: String("notifications_enabled"),
1598+
ParentTeamID: Int64(1),
1599+
Permission: String("perm"),
1600+
Privacy: String("p"),
1601+
LDAPDN: String("l"),
16011602
}
16021603

16031604
want := `{
@@ -1606,6 +1607,7 @@ func TestNewTeam_Marshal(t *testing.T) {
16061607
"maintainers": ["m1", "m2"],
16071608
"repo_names": ["repo1", "repo2"],
16081609
"parent_team_id": 1,
1610+
"notification_setting": "notifications_enabled",
16091611
"permission": "perm",
16101612
"privacy": "p",
16111613
"ldap_dn": "l"

0 commit comments

Comments
 (0)