Skip to content

Commit a5508e0

Browse files
committed
add user_update_for_team event to SystemHookEvent
1 parent de7952d commit a5508e0

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

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

Lines changed: 7 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(
@@ -102,6 +105,10 @@ class RemoveTeamMemberSystemHookEvent extends TeamMemberSystemHookEvent {
102105
private static final long serialVersionUID = 1L;
103106
}
104107

108+
class UpdateTeamMemberSystemHookEvent extends TeamMemberSystemHookEvent {
109+
private static final long serialVersionUID = 1L;
110+
}
111+
105112
class CreateUserSystemHookEvent extends UserSystemHookEvent {
106113
private static final long serialVersionUID = 1L;
107114
}

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: 7 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");
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": "johnsmith@example.com",
11+
"user_name": "John Smith",
12+
"user_username": "johnsmith",
13+
"user_id": 41,
14+
"project_visibility": "private"
15+
}

0 commit comments

Comments
 (0)