Skip to content

Commit

Permalink
Add NotificationSetting to NewTeam (#3111)
Browse files Browse the repository at this point in the history
Fixes: #3107.
  • Loading branch information
gmlewis authored Mar 25, 2024
1 parent b3e96fd commit 8bec011
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 18 deletions.
8 changes: 8 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions github/github-stringify_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions github/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ type NewTeam struct {
RepoNames []string `json:"repo_names,omitempty"`
ParentTeamID *int64 `json:"parent_team_id,omitempty"`

// 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
Expand Down
18 changes: 10 additions & 8 deletions github/teams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1590,14 +1590,15 @@ func TestNewTeam_Marshal(t *testing.T) {
testJSONMarshal(t, &NewTeam{}, "{}")

u := &NewTeam{
Name: "n",
Description: String("d"),
Maintainers: []string{"m1", "m2"},
RepoNames: []string{"repo1", "repo2"},
ParentTeamID: Int64(1),
Permission: String("perm"),
Privacy: String("p"),
LDAPDN: String("l"),
Name: "n",
Description: String("d"),
Maintainers: []string{"m1", "m2"},
RepoNames: []string{"repo1", "repo2"},
NotificationSetting: String("notifications_enabled"),
ParentTeamID: Int64(1),
Permission: String("perm"),
Privacy: String("p"),
LDAPDN: String("l"),
}

want := `{
Expand All @@ -1606,6 +1607,7 @@ func TestNewTeam_Marshal(t *testing.T) {
"maintainers": ["m1", "m2"],
"repo_names": ["repo1", "repo2"],
"parent_team_id": 1,
"notification_setting": "notifications_enabled",
"permission": "perm",
"privacy": "p",
"ldap_dn": "l"
Expand Down

0 comments on commit 8bec011

Please sign in to comment.