Skip to content

Commit b37ba50

Browse files
committed
feat: Add user team membership fields
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
1 parent 9ba19be commit b37ba50

4 files changed

Lines changed: 62 additions & 4 deletions

File tree

github/github-accessors.go

Lines changed: 16 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: 22 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: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/users.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ type User struct {
6969
// See: search.go and https://docs.github.com/rest/search?apiVersion=2022-11-28#text-match-metadata
7070
TextMatches []*TextMatch `json:"text_matches,omitempty"`
7171

72-
// Permissions and RoleName identify the permissions and role that a user has on a given
73-
// repository. These are only populated when calling Repositories.ListCollaborators.
72+
// Permissions identify the permissions that a user has on a given
73+
// repository.
74+
// This is only populated when calling [RepositoriesService.ListCollaborators].
7475
Permissions *RepositoryPermissions `json:"permissions,omitempty"`
75-
RoleName *string `json:"role_name,omitempty"`
76+
77+
// RoleName identifies the role that a user has on a given repository.
78+
// This is only populated when calling [RepositoriesService.ListCollaborators].
79+
RoleName *string `json:"role_name,omitempty"`
7680

7781
// Assignment identifies how a user was assigned to an organization role. Its
7882
// possible values are: "direct", "indirect", "mixed". This is only populated when
@@ -81,6 +85,20 @@ type User struct {
8185
// InheritedFrom identifies the team that a user inherited their organization role
8286
// from. This is only populated when calling the ListUsersAssignedToOrgRole method.
8387
InheritedFrom []*Team `json:"inherited_from,omitempty"`
88+
89+
// Role identifies the role that a user has on a given team.
90+
// Its possible values are: "member", "maintainer".
91+
// This is only populated when calling the
92+
// [TeamsService.ListTeamMembersBySlug] or [TeamsService.ListTeamMembersByID]
93+
// methods.
94+
Role *string `json:"role,omitempty"`
95+
96+
// Inherited identifies whether a user inherited their team role from a child
97+
// team.
98+
// This is only populated when calling the
99+
// [TeamsService.ListTeamMembersBySlug] or [TeamsService.ListTeamMembersByID]
100+
// methods.
101+
Inherited *bool `json:"inherited,omitempty"`
84102
}
85103

86104
func (u User) String() string {

0 commit comments

Comments
 (0)