Skip to content

Commit 05d4eb9

Browse files
Add "user_update_for_group" and "user_update_for_team" events to SystemHookEvent (#1279)
1 parent 4557a2b commit 05d4eb9

File tree

6 files changed

+57
-0
lines changed

6 files changed

+57
-0
lines changed

gitlab4j-models/src/main/java/org/gitlab4j/api/systemhooks/GroupMemberSystemHookEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class GroupMemberSystemHookEvent extends AbstractSystemHookEvent {
99

1010
public static final String NEW_GROUP_MEMBER_EVENT = "user_add_to_group";
1111
public static final String GROUP_MEMBER_REMOVED_EVENT = "user_remove_from_group";
12+
public static final String GROUP_MEMBER_UPDATE_EVENT = "user_update_for_group";
1213

1314
private Date createdAt;
1415
private Date updatedAt;

gitlab4j-models/src/main/java/org/gitlab4j/api/systemhooks/SystemHookEvent.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
@JsonSubTypes.Type(
2424
value = RemoveTeamMemberSystemHookEvent.class,
2525
name = TeamMemberSystemHookEvent.TEAM_MEMBER_REMOVED_EVENT),
26+
@JsonSubTypes.Type(
27+
value = UpdateTeamMemberSystemHookEvent.class,
28+
name = TeamMemberSystemHookEvent.TEAM_MEMBER_UPDATED_EVENT),
2629
@JsonSubTypes.Type(value = CreateUserSystemHookEvent.class, name = UserSystemHookEvent.USER_CREATE_EVENT),
2730
@JsonSubTypes.Type(value = DestroyUserSystemHookEvent.class, name = UserSystemHookEvent.USER_DESTROY_EVENT),
2831
@JsonSubTypes.Type(
@@ -40,6 +43,9 @@
4043
@JsonSubTypes.Type(
4144
value = RemoveGroupMemberSystemHookEvent.class,
4245
name = GroupMemberSystemHookEvent.GROUP_MEMBER_REMOVED_EVENT),
46+
@JsonSubTypes.Type(
47+
value = UpdateGroupMemberSystemHookEvent.class,
48+
name = GroupMemberSystemHookEvent.GROUP_MEMBER_UPDATE_EVENT),
4349
@JsonSubTypes.Type(value = PushSystemHookEvent.class, name = PushSystemHookEvent.PUSH_EVENT),
4450
@JsonSubTypes.Type(value = TagPushSystemHookEvent.class, name = TagPushSystemHookEvent.TAG_PUSH_EVENT),
4551
@JsonSubTypes.Type(
@@ -99,6 +105,10 @@ class RemoveTeamMemberSystemHookEvent extends TeamMemberSystemHookEvent {
99105
private static final long serialVersionUID = 1L;
100106
}
101107

108+
class UpdateTeamMemberSystemHookEvent extends TeamMemberSystemHookEvent {
109+
private static final long serialVersionUID = 1L;
110+
}
111+
102112
class CreateUserSystemHookEvent extends UserSystemHookEvent {
103113
private static final long serialVersionUID = 1L;
104114
}
@@ -142,3 +152,7 @@ class NewGroupMemberSystemHookEvent extends GroupMemberSystemHookEvent {
142152
class RemoveGroupMemberSystemHookEvent extends GroupMemberSystemHookEvent {
143153
private static final long serialVersionUID = 1L;
144154
}
155+
156+
class UpdateGroupMemberSystemHookEvent extends GroupMemberSystemHookEvent {
157+
private static final long serialVersionUID = 1L;
158+
}

gitlab4j-models/src/main/java/org/gitlab4j/api/systemhooks/TeamMemberSystemHookEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class TeamMemberSystemHookEvent extends AbstractSystemHookEvent {
1010

1111
public static final String NEW_TEAM_MEMBER_EVENT = "user_add_to_team";
1212
public static final String TEAM_MEMBER_REMOVED_EVENT = "user_remove_from_team";
13+
public static final String TEAM_MEMBER_UPDATED_EVENT = "user_update_for_team";
1314

1415
private Date createdAt;
1516
private Date updatedAt;

gitlab4j-models/src/test/java/org/gitlab4j/models/TestGitLabApiEvents.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,13 @@ public void testTeamMemberSystemHookEvent() throws Exception {
240240
assertTrue(compareJson(event, "team-member-system-hook-event.json"));
241241
}
242242

243+
@Test
244+
public void testTeamMemberUpdateSystemHookEvent() throws Exception {
245+
TeamMemberSystemHookEvent event =
246+
unmarshalResource(TeamMemberSystemHookEvent.class, "team-member-update-system-hook-event.json");
247+
assertTrue(compareJson(event, "team-member-update-system-hook-event.json"));
248+
}
249+
243250
@Test
244251
public void testPushSystemHookEvent() throws Exception {
245252
PushSystemHookEvent event = unmarshalResource(PushSystemHookEvent.class, "push-system-hook-event.json");
@@ -271,6 +278,12 @@ public void testGroupMemberSystemHookEvent() throws Exception {
271278
assertTrue(compareJson(event, "group-member-system-hook-event.json"));
272279
}
273280

281+
@Test
282+
public void testGroupMemberUpdateSystemHookEvent() throws Exception {
283+
SystemHookEvent event = unmarshalResource(SystemHookEvent.class, "group-member-update-system-hook-event.json");
284+
assertTrue(compareJson(event, "group-member-update-system-hook-event.json"));
285+
}
286+
274287
@Test
275288
public void testTagPushSystemHookEvent() throws Exception {
276289
SystemHookEvent event = unmarshalResource(SystemHookEvent.class, "tag-push-system-hook-event.json");
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"created_at": "2025-07-09T09:09:27Z",
3+
"updated_at": "2025-09-06T07:12:24Z",
4+
"group_name": "StoreCloud",
5+
"group_path": "storecloud",
6+
"group_id": 17995,
7+
"user_username": "john-doe",
8+
"user_name": "John Doe",
9+
"user_email": "[email protected]",
10+
"user_id": 12218,
11+
"group_access": "Maintainer",
12+
"event_name": "user_update_for_group"
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"created_at": "2012-07-21T07:30:56Z",
3+
"updated_at": "2012-07-21T07:38:22Z",
4+
"event_name": "user_update_for_team",
5+
"access_level": "Maintainer",
6+
"project_id": 74,
7+
"project_name": "StoreCloud",
8+
"project_path": "storecloud",
9+
"project_path_with_namespace": "jsmith/storecloud",
10+
"user_email": "[email protected]",
11+
"user_name": "John Smith",
12+
"user_username": "johnsmith",
13+
"user_id": 41,
14+
"project_visibility": "private"
15+
}

0 commit comments

Comments
 (0)