Commit e602c343 authored by Greg Messner's avatar Greg Messner
Browse files

More mods to support GitLab 8

parent c2af9a23
...@@ -138,7 +138,6 @@ public class JacksonJson extends JacksonJaxbJsonProvider implements ContextResol ...@@ -138,7 +138,6 @@ public class JacksonJson extends JacksonJaxbJsonProvider implements ContextResol
} }
} }
/** /**
* JsonSerializer for serializing AccessLevel values. * JsonSerializer for serializing AccessLevel values.
*/ */
......
...@@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; ...@@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
public enum AccessLevel { public enum AccessLevel {
GUEST(10), REPORTER(20), DEVELOPER(30), MASTER(40), OWNER(50); NONE(0), GUEST(10), REPORTER(20), DEVELOPER(30), MASTER(40), OWNER(50);
public final int value; public final int value;
...@@ -16,7 +16,7 @@ public enum AccessLevel { ...@@ -16,7 +16,7 @@ public enum AccessLevel {
this.value = value; this.value = value;
} }
private static Map<Integer, AccessLevel> valuesMap = new HashMap<Integer, AccessLevel>(5); private static Map<Integer, AccessLevel> valuesMap = new HashMap<Integer, AccessLevel>(6);
static { static {
for (AccessLevel accessLevel : AccessLevel.values()) for (AccessLevel accessLevel : AccessLevel.values())
valuesMap.put(accessLevel.value, accessLevel); valuesMap.put(accessLevel.value, accessLevel);
......
...@@ -27,7 +27,8 @@ public class Session { ...@@ -27,7 +27,8 @@ public class Session {
private String linkedin; private String linkedin;
private String name; private String name;
private String privateToken; private String privateToken;
private Integer projectLimit; private Integer projectsLimit;
private String state;
private String skype; private String skype;
private Integer themeId; private Integer themeId;
private String twitter; private String twitter;
...@@ -163,12 +164,20 @@ public class Session { ...@@ -163,12 +164,20 @@ public class Session {
this.privateToken = privateToken; this.privateToken = privateToken;
} }
public Integer getProjectLimit() { public Integer getProjectsLimit() {
return projectLimit; return projectsLimit;
} }
public void setProjectLimit(Integer projectLimit) { public void setProjectsLimit(Integer projectsLimit) {
this.projectLimit = projectLimit; this.projectsLimit = projectsLimit;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
} }
public String getSkype() { public String getSkype() {
......
...@@ -11,7 +11,7 @@ import javax.xml.bind.annotation.XmlRootElement; ...@@ -11,7 +11,7 @@ import javax.xml.bind.annotation.XmlRootElement;
@JsonTypeInfo( @JsonTypeInfo(
use = JsonTypeInfo.Id.NAME, use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY, include = JsonTypeInfo.As.PROPERTY,
property = "objectKind", property = "object_kind",
visible = true visible = true
) )
@JsonSubTypes({ @JsonSubTypes({
......
package com.messners.gitlab.api.webhook; package com.messners.gitlab.api.webhook;
import java.util.Date;
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 com.messners.gitlab.api.models.Assignee;
import com.messners.gitlab.api.models.User;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class IssueEvent extends EventObject { public class IssueEvent extends EventObject {
public static final String OBJECT_KIND = "issue"; public static final String OBJECT_KIND = "issue";
private EventObjectAttributes objectAttributes; private User user;
private EventProject project;
private EventRepository repository;
private ObjectAttributes objectAttributes;
private Assignee assignee;
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public EventProject getProject() {
return project;
}
public void setProject(EventProject project) {
this.project = project;
}
public EventRepository getRepository() {
return repository;
}
public void setRepository(EventRepository repository) {
this.repository = repository;
}
public Assignee getAssignee() {
return assignee;
}
public EventObjectAttributes getObjectAttributes() { public void setAssignee(Assignee assignee) {
this.assignee = assignee;
}
public ObjectAttributes getObjectAttributes() {
return this.objectAttributes; return this.objectAttributes;
} }
public void setObjectAttributes(EventObjectAttributes objectAttributes) { public void setObjectAttributes(ObjectAttributes objectAttributes) {
this.objectAttributes = objectAttributes; this.objectAttributes = objectAttributes;
} }
@XmlAccessorType(XmlAccessType.FIELD)
public static class ObjectAttributes {
private Integer assigneeId;
private Integer authorId;
private String branchName;
private Date createdAt;
private String description;
private Integer id;
private Integer iid;
private String milestoneId;
private Integer position;
private Integer projectId;
private String state;
private String title;
private Date updatedAt;
private String url;
private String action;
public Integer getAssigneeId() {
return this.assigneeId;
}
public void setAssigneeId(Integer assigneeId) {
this.assigneeId = assigneeId;
}
public Integer getAuthorId() {
return this.authorId;
}
public void setAuthorId(Integer authorId) {
this.authorId = authorId;
}
public String getBranchName() {
return this.branchName;
}
public void setBranchName(String branchName) {
this.branchName = branchName;
}
public Date getCreatedAt() {
return this.createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getIid() {
return this.iid;
}
public void setIid(Integer iid) {
this.iid = iid;
}
public String getMilestoneId() {
return this.milestoneId;
}
public void setMilestoneId(String milestoneId) {
this.milestoneId = milestoneId;
}
public Integer getPosition() {
return this.position;
}
public void setPosition(Integer position) {
this.position = position;
}
public Integer getProjectId() {
return this.projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
public String getState() {
return this.state;
}
public void setState(String state) {
this.state = state;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public Date getUpdatedAt() {
return this.updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
}
} }
package com.messners.gitlab.api.webhook; package com.messners.gitlab.api.webhook;
import java.util.Date;
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 com.messners.gitlab.api.models.Assignee;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class MergeRequestEvent extends EventObject { public class MergeRequestEvent extends EventObject {
public static final String OBJECT_KIND = "merge_request"; public static final String OBJECT_KIND = "merge_request";
private EventObjectAttributes objectAttributes; private ObjectAttributes objectAttributes;
public EventObjectAttributes getObjectAttributes() { public ObjectAttributes getObjectAttributes() {
return this.objectAttributes; return this.objectAttributes;
} }
public void setObjectAttributes(EventObjectAttributes objectAttributes) { public void setObjectAttributes(ObjectAttributes objectAttributes) {
this.objectAttributes = objectAttributes; this.objectAttributes = objectAttributes;
} }
@XmlAccessorType(XmlAccessType.FIELD)
public static class ObjectAttributes {
private Integer assigneeId;
private Integer authorId;
private String branchName;
private Date createdAt;
private String description;
private Integer id;
private Integer iid;
private String mergeStatus;
private String milestoneId;
private Integer position;
private Integer projectId;
private String sourceBranch;
private Integer sourceProjectId;
private String stCommits;
private String stDiffs;
private String state;
private String targetBranch;
private Integer targetProjectId;
private String title;
private Date updatedAt;
private EventProject source;
private EventProject target;
private EventCommit lastCommit;
private Boolean workInProgress;
private String url;
private String action;
private Assignee assigneee;
public Integer getAssigneeId() {
return this.assigneeId;
}
public void setAssigneeId(Integer assigneeId) {
this.assigneeId = assigneeId;
}
public Integer getAuthorId() {
return this.authorId;
}
public void setAuthorId(Integer authorId) {
this.authorId = authorId;
}
public String getBranchName() {
return this.branchName;
}
public void setBranchName(String branchName) {
this.branchName = branchName;
}
public Date getCreatedAt() {
return this.createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getIid() {
return this.iid;
}
public void setIid(Integer iid) {
this.iid = iid;
}
public String getMergeStatus() {
return this.mergeStatus;
}
public void setMergeStatus(String mergeStatus) {
this.mergeStatus = mergeStatus;
}
public String getMilestoneId() {
return this.milestoneId;
}
public void setMilestoneId(String milestoneId) {
this.milestoneId = milestoneId;
}
public Integer getPosition() {
return this.position;
}
public void setPosition(Integer position) {
this.position = position;
}
public Integer getProjectId() {
return this.projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
public String getSourceBranch() {
return this.sourceBranch;
}
public void setSourceBranch(String sourceBranch) {
this.sourceBranch = sourceBranch;
}
public Integer getSourceProjectId() {
return this.sourceProjectId;
}
public void setSourceProjectId(Integer sourceProjectId) {
this.sourceProjectId = sourceProjectId;
}
public String getStCommits() {
return this.stCommits;
}
public void setStCommits(String stCommits) {
this.stCommits = stCommits;
}
public String getStDiffs() {
return this.stDiffs;
}
public void setStDiffs(String stDiffs) {
this.stDiffs = stDiffs;
}
public String getState() {
return this.state;
}
public void setState(String state) {
this.state = state;
}
public String getTargetBranch() {
return this.targetBranch;
}
public void setTargetBranch(String targetBranch) {
this.targetBranch = targetBranch;
}
public Integer getTargetProjectId() {
return this.targetProjectId;
}
public void setTargetProjectId(Integer targetProjectId) {
this.targetProjectId = targetProjectId;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public Date getUpdatedAt() {
return this.updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public EventProject getSource() {
return source;
}
public void setSource(EventProject source) {
this.source = source;
}
public EventProject getTarget() {
return target;
}
public void setTarget(EventProject target) {
this.target = target;
}
public EventCommit getLastCommit() {
return lastCommit;
}
public void setLastCommit(EventCommit lastCommit) {
this.lastCommit = lastCommit;
}
public Boolean getWorkInProgress() {
return workInProgress;
}
public void setWorkInProgress(Boolean workInProgress) {
this.workInProgress = workInProgress;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public Assignee getAssigneee() {
return assigneee;
}
public void setAssigneee(Assignee assigneee) {
this.assigneee = assigneee;
}
}
} }
...@@ -7,9 +7,6 @@ import javax.xml.bind.annotation.XmlAccessType; ...@@ -7,9 +7,6 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.messners.gitlab.api.models.Commit;
import com.messners.gitlab.api.models.Project;
import com.messners.gitlab.api.models.Repository;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class PushEvent extends EventObject { public class PushEvent extends EventObject {
...@@ -27,9 +24,9 @@ public class PushEvent extends EventObject { ...@@ -27,9 +24,9 @@ public class PushEvent extends EventObject {
private String userAvatar; private String userAvatar;
private Integer projectId; private Integer projectId;
private Project project; private EventProject project;
private Repository repository; private EventRepository repository;
private List<Commit> commits; private List<EventCommit> commits;
private Integer totalCommitsCount; private Integer totalCommitsCount;
public String getAfter() { public String getAfter() {
...@@ -104,27 +101,27 @@ public class PushEvent extends EventObject { ...@@ -104,27 +101,27 @@ public class PushEvent extends EventObject {
this.projectId = projectId; this.projectId = projectId;
} }
public Project getProject() { public EventProject getProject() {
return project; return project;
} }
public void setProject(Project project) { public void setProject(EventProject project) {
this.project = project; this.project = project;
} }
public Repository getRepository() { public EventRepository getRepository() {
return this.repository; return this.repository;
} }
public void setRepository(Repository repository) { public void setRepository(EventRepository repository) {
this.repository = repository; this.repository = repository;
} }
public List<Commit> getCommits() { public List<EventCommit> getCommits() {
return this.commits; return this.commits;
} }
public void setCommits(List<Commit> commits) { public void setCommits(List<EventCommit> commits) {
this.commits = commits; this.commits = commits;
} }
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
"name":"Diaspora", "name":"Diaspora",
"description":"", "description":"",
"web_url":"http://example.com/mike/diaspora", "web_url":"http://example.com/mike/diaspora",
"avatar_url":null,
"git_ssh_url":"git@example.com:mike/diaspora.git", "git_ssh_url":"git@example.com:mike/diaspora.git",
"git_http_url":"http://example.com/mike/diaspora.git", "git_http_url":"http://example.com/mike/diaspora.git",
"namespace":"Mike", "namespace":"Mike",
...@@ -25,33 +24,42 @@ ...@@ -25,33 +24,42 @@
"ssh_url":"git@example.com:mike/diaspora.git", "ssh_url":"git@example.com:mike/diaspora.git",
"http_url":"http://example.com/mike/diaspora.git" "http_url":"http://example.com/mike/diaspora.git"
}, },
"repository": { "repository":{
"name": "Diaspora", "name": "Diaspora",
"url": "git@localhost:diaspora.git", "url": "git@example.com:mike/diaspora.git",
"description": "", "description": "",
"homepage": "http://localhost/diaspora" "homepage": "http://example.com/mike/diaspora",
"git_http_url":"http://example.com/mike/diaspora.git",
"git_ssh_url":"git@example.com:mike/diaspora.git",
"visibility_level":0
}, },
"commits": [ "commits": [
{ {
"id": "b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327", "id": "b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327",
"message": "Update Catalan translation to e38cb41.", "message": "Update Catalan translation to e38cb41.",
"timestamp": "2011-12-12T12:27:31Z", "timestamp": "2011-12-12T14:27:31Z",
"url": "http://localhost/diaspora/commits/b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327", "url": "http://example.com/mike/diaspora/commit/b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327",
"author": { "author": {
"name": "Jordi Mallach", "name": "Jordi Mallach",
"email": "jordi@softcatala.org" "email": "jordi@softcatala.org"
} },
"added": ["CHANGELOG"],
"modified": ["app/controller/application.rb"],
"removed": []
}, },
{ {
"id": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", "id": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"message": "fixed readme", "message": "fixed readme",
"timestamp": "2012-01-03T21:36:29Z", "timestamp": "2012-01-03T23:36:29Z",
"url": "http://localhost/diaspora/commits/da1560886d4f094c3e6c9ef40349f7d38b5d27d7", "url": "http://example.com/mike/diaspora/commit/da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"author": { "author": {
"name": "GitLab dev user", "name": "GitLab dev user",
"email": "gitlabdev@dv6700.(none)" "email": "gitlabdev@dv6700.(none)"
} },
"added": ["CHANGELOG"],
"modified": ["app/controller/application.rb"],
"removed": []
} }
], ],
"total_commits_count": 2 "total_commits_count": 4
} }
\ No newline at end of file
...@@ -3,10 +3,8 @@ ...@@ -3,10 +3,8 @@
"username": "john_smith", "username": "john_smith",
"id": 32, "id": 32,
"state": "active", "state": "active",
"avatar_url": null,
"created_at": "2015-01-29T21:07:19.440Z", "created_at": "2015-01-29T21:07:19.440Z",
"is_admin": true, "is_admin": true,
"bio": null,
"skype": "", "skype": "",
"linkedin": "", "linkedin": "",
"twitter": "", "twitter": "",
......
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