diff --git a/github/github-accessors.go b/github/github-accessors.go index 98985def895..5a69f27f8cf 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20094,6 +20094,14 @@ func (r *RepositoryPermissionLevel) GetPermission() string { return *r.Permission } +// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise. +func (r *RepositoryPermissionLevel) GetRoleName() string { + if r == nil || r.RoleName == nil { + return "" + } + return *r.RoleName +} + // GetUser returns the User field. func (r *RepositoryPermissionLevel) GetUser() *User { if r == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index f123be8f8c4..bfe3c61e0f9 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -23327,6 +23327,16 @@ func TestRepositoryPermissionLevel_GetPermission(tt *testing.T) { r.GetPermission() } +func TestRepositoryPermissionLevel_GetRoleName(tt *testing.T) { + var zeroValue string + r := &RepositoryPermissionLevel{RoleName: &zeroValue} + r.GetRoleName() + r = &RepositoryPermissionLevel{} + r.GetRoleName() + r = nil + r.GetRoleName() +} + func TestRepositoryPermissionLevel_GetUser(tt *testing.T) { r := &RepositoryPermissionLevel{} r.GetUser() diff --git a/github/repos_collaborators.go b/github/repos_collaborators.go index 15a4e77a2f1..d6c985359aa 100644 --- a/github/repos_collaborators.go +++ b/github/repos_collaborators.go @@ -99,6 +99,8 @@ type RepositoryPermissionLevel struct { Permission *string `json:"permission,omitempty"` User *User `json:"user,omitempty"` + + RoleName *string `json:"role_name,omitempty"` } // GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository.