Commit 2ce86a2f authored by Greg Messner's avatar Greg Messner
Browse files

Fixed webhooks changes deserialization (#325, #331).

parent b8206c72
...@@ -2,44 +2,89 @@ package org.gitlab4j.api.webhook; ...@@ -2,44 +2,89 @@ package org.gitlab4j.api.webhook;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.models.Assignee;
import org.gitlab4j.api.utils.JacksonJson; import org.gitlab4j.api.utils.JacksonJson;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class EventChanges { public class EventChanges {
private List<Integer> updatedById; private ChangeContainer<Date> updatedAt;
private List<Date> updatedAt; private ChangeContainer<Integer> updatedById;
private Map<String, List<EventLabel>> labels; private ChangeContainer<Date> dueDate;
private ChangeContainer<Integer> milestoneId;
private ChangeContainer<List<EventLabel>> labels;
private ChangeContainer<List<Assignee>> assignees;
private ChangeContainer<Integer> totalTimeSpent;
private ChangeContainer<Boolean> confidential;
public List<Integer> getUpdatedById() { public ChangeContainer<Date> getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(ChangeContainer<Date> updatedAt) {
this.updatedAt = updatedAt;
}
public ChangeContainer<Integer> getUpdatedById() {
return updatedById; return updatedById;
} }
public void setUpdatedById(List<Integer> updatedById) { public void setUpdatedById(ChangeContainer<Integer> updatedById) {
this.updatedById = updatedById; this.updatedById = updatedById;
} }
public List<Date> getUpdatedAt() { public ChangeContainer<Date> getDueDate() {
return updatedAt; return dueDate;
} }
public void setUpdatedAt(List<Date> updatedAt) { public void setDueDate(ChangeContainer<Date> dueDate) {
this.updatedAt = updatedAt; this.dueDate = dueDate;
}
public ChangeContainer<Integer> getMilestoneId() {
return milestoneId;
}
public void setMilestoneId(ChangeContainer<Integer> milestoneId) {
this.milestoneId = milestoneId;
} }
public Map<String, List<EventLabel>> getLabels() { public ChangeContainer<List<EventLabel>> getLabels() {
return labels; return labels;
} }
public void setLabels(Map<String, List<EventLabel>> labels) { public void setLabels(ChangeContainer<List<EventLabel>> labels) {
this.labels = labels; this.labels = labels;
} }
public ChangeContainer<List<Assignee>> getAssignees() {
return assignees;
}
public void setAssignees(ChangeContainer<List<Assignee>> assignees) {
this.assignees = assignees;
}
public ChangeContainer<Integer> getTotalTimeSpent() {
return totalTimeSpent;
}
public void setTotalTimeSpent(ChangeContainer<Integer> totalTimeSpent) {
this.totalTimeSpent = totalTimeSpent;
}
public ChangeContainer<Boolean> getConfidential() {
return confidential;
}
public void setConfidential(ChangeContainer<Boolean> confidential) {
this.confidential = confidential;
}
@Override @Override
public String toString() { public String toString() {
return (JacksonJson.toJsonString(this)); return (JacksonJson.toJsonString(this));
......
...@@ -51,21 +51,28 @@ ...@@ -51,21 +51,28 @@
"username": "user1", "username": "user1",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon" "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon"
}, },
"labels": [{ "labels":[],
"id": 206,
"title": "API",
"color": "#ffffff",
"project_id": 14,
"created_at": "2013-12-03T17:15:43Z",
"updated_at": "2013-12-03T17:15:43Z",
"template": false,
"description": "API related issues",
"type": "ProjectLabel",
"group_id": 41
}],
"changes": { "changes": {
"updated_by_id": [null, 1], "due_date":{
"updated_at": ["2017-09-15T16:50:55Z", "2017-09-15T16:52:00Z"], "previous": "2020-06-01T08:00:00Z",
"current": "2020-02-04T08:00:00Z"
},
"updated_at": {
"previous":"2019-04-12T01:10:28Z",
"current":"2019-04-12T01:11:33Z"
},
"updated_by_id": {
"previous": 2,
"current": 6
},
"milestone_id": {
"previous":0,
"current":1
},
"confidential": {
"previous":true,
"current":false
},
"labels": { "labels": {
"previous": [{ "previous": [{
"id": 206, "id": 206,
......
...@@ -104,8 +104,14 @@ ...@@ -104,8 +104,14 @@
"group_id": 41 "group_id": 41
}], }],
"changes": { "changes": {
"updated_by_id": [null, 1], "updated_at": {
"updated_at": ["2017-09-15T16:50:55Z", "2017-09-15T16:52:00Z"], "previous":"2019-04-12T01:10:28Z",
"current":"2019-04-12T01:11:33Z"
},
"updated_by_id": {
"previous": 2,
"current": 6
},
"labels": { "labels": {
"previous": [{ "previous": [{
"id": 206, "id": 206,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment