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

Mods for GitLab 8 support.

parent 1d5d936c
package com.messners.gitlab.api.models; package com.messners.gitlab.api.models;
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 javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
...@@ -8,68 +10,122 @@ import javax.xml.bind.annotation.XmlRootElement; ...@@ -8,68 +10,122 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class ProjectHook { public class ProjectHook {
private String createdAt; private Boolean build_events;
private Integer id; private Date createdAt;
private Boolean issuesEvents; private Boolean enable_ssl_verification;
private Boolean mergeRequestsEvents; private Integer id;
private Integer projectId; private Boolean issuesEvents;
private Boolean pushEvents; private Boolean mergeRequestsEvents;
private String url; private Boolean note_events;
private Boolean pipeline_events;
public String getCreatedAt() { private Integer projectId;
return this.createdAt; private Boolean pushEvents;
} private Boolean tag_push_events;
private String url;
public void setCreatedAt(String createdAt) { private Boolean wiki_page_events;
this.createdAt = createdAt;
} public Boolean getBuild_events() {
return build_events;
public Integer getId() { }
return this.id;
} public void setBuild_events(Boolean build_events) {
this.build_events = build_events;
public void setId(Integer id) { }
this.id = id;
} public Date getCreatedAt() {
return createdAt;
public Boolean getIssuesEvents() { }
return this.issuesEvents;
} public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
public void setIssuesEvents(Boolean issuesEvents) { }
this.issuesEvents = issuesEvents;
} public Boolean getEnable_ssl_verification() {
return enable_ssl_verification;
public Boolean getMergeRequestsEvents() { }
return this.mergeRequestsEvents;
} public void setEnable_ssl_verification(Boolean enable_ssl_verification) {
this.enable_ssl_verification = enable_ssl_verification;
public void setMergeRequestsEvents(Boolean mergeRequestsEvents) { }
this.mergeRequestsEvents = mergeRequestsEvents;
} public Integer getId() {
return id;
public Integer getProjectId() { }
return this.projectId;
} public void setId(Integer id) {
this.id = id;
public void setProjectId(Integer projectId) { }
this.projectId = projectId;
} public Boolean getIssuesEvents() {
return issuesEvents;
public Boolean getPushEvents() { }
return this.pushEvents;
} public void setIssuesEvents(Boolean issuesEvents) {
this.issuesEvents = issuesEvents;
public void setPushEvents(Boolean pushEvents) { }
this.pushEvents = pushEvents;
} public Boolean getMergeRequestsEvents() {
return mergeRequestsEvents;
public String getUrl() { }
return this.url;
} public void setMergeRequestsEvents(Boolean mergeRequestsEvents) {
this.mergeRequestsEvents = mergeRequestsEvents;
public void setUrl(String url) { }
this.url = url;
} public Boolean getNote_events() {
} return note_events;
}
public void setNote_events(Boolean note_events) {
this.note_events = note_events;
}
public Boolean getPipeline_events() {
return pipeline_events;
}
public void setPipeline_events(Boolean pipeline_events) {
this.pipeline_events = pipeline_events;
}
public Integer getProjectId() {
return projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
public Boolean getPushEvents() {
return pushEvents;
}
public void setPushEvents(Boolean pushEvents) {
this.pushEvents = pushEvents;
}
public Boolean getTag_push_events() {
return tag_push_events;
}
public void setTag_push_events(Boolean tag_push_events) {
this.tag_push_events = tag_push_events;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Boolean getWiki_page_events() {
return wiki_page_events;
}
public void setWiki_page_events(Boolean wiki_page_events) {
this.wiki_page_events = wiki_page_events;
}
}
\ No newline at end of file
...@@ -10,67 +10,76 @@ import javax.xml.bind.annotation.XmlRootElement; ...@@ -10,67 +10,76 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class ProjectSnippet { public class ProjectSnippet {
private Author author; private Author author;
private Date createdAt; private Date createdAt;
private Date expiresAt; private Date expiresAt;
private String fileName; private String fileName;
private Integer id; private Integer id;
private String title; private String title;
private String updatedAt; private String updatedAt;
private String webUrl;
public Author getAuthor () {
return this.author; public Author getAuthor() {
} return this.author;
}
public void setAuthor (Author author) {
this.author = author; public void setAuthor(Author author) {
} this.author = author;
}
public Date getCreatedAt () {
return this.createdAt; public Date getCreatedAt() {
} return this.createdAt;
}
public void setCreatedAt (Date createdAt) {
this.createdAt = createdAt; public void setCreatedAt(Date createdAt) {
} this.createdAt = createdAt;
}
public Date getExpiresAt () {
return this.expiresAt; public Date getExpiresAt() {
} return this.expiresAt;
}
public void setExpiresAt (Date expiresAt) {
this.expiresAt = expiresAt; public void setExpiresAt(Date expiresAt) {
} this.expiresAt = expiresAt;
}
public String getFileName () {
return this.fileName; public String getFileName() {
} return this.fileName;
}
public void setFileName (String fileName) {
this.fileName = fileName; public void setFileName(String fileName) {
} this.fileName = fileName;
}
public Integer getId () {
return this.id; public Integer getId() {
} return this.id;
}
public void setId (Integer id) {
this.id = id; public void setId(Integer id) {
} this.id = id;
}
public String getTitle () {
return this.title; public String getTitle() {
} return this.title;
}
public void setTitle (String title) {
this.title = title; public void setTitle(String title) {
} this.title = title;
}
public String getUpdatedAt () {
return this.updatedAt; public String getUpdatedAt() {
} return this.updatedAt;
}
public void setUpdatedAt (String updatedAt) {
this.updatedAt = updatedAt; public void setUpdatedAt(String updatedAt) {
} this.updatedAt = updatedAt;
}
public String getWebUrl() {
return webUrl;
}
public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}
} }
...@@ -8,40 +8,40 @@ import javax.xml.bind.annotation.XmlRootElement; ...@@ -8,40 +8,40 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class Repository { public class Repository {
private String description; private String description;
private String homepage; private String homepage;
private String name; private String name;
private String url; private String url;
public String getDescription () { public String getDescription() {
return this.description; return this.description;
} }
public void setDescription (String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }
public String getHomepage () { public String getHomepage() {
return this.homepage; return this.homepage;
} }
public void setHomepage (String homepage) { public void setHomepage(String homepage) {
this.homepage = homepage; this.homepage = homepage;
} }
public String getName () { public String getName() {
return this.name; return this.name;
} }
public void setName (String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getUrl () { public String getUrl() {
return this.url; return this.url;
} }
public void setUrl (String url) { public void setUrl(String url) {
this.url = url; this.url = url;
} }
} }
package com.messners.gitlab.api.models; package com.messners.gitlab.api.models;
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 javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
...@@ -10,76 +9,85 @@ import javax.xml.bind.annotation.XmlRootElement; ...@@ -10,76 +9,85 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class RepositoryFile { public class RepositoryFile {
private String fileName; //file name only, Ex. lib/class.rb private String fileName; // file name only, Ex. class.rb
private String filePath; //full path to file. Ex. lib/class.rb private String filePath; // full path to file. Ex. lib/class.rb
private Integer size; private Integer size;
private String encoding; private String encoding;
private String content; private String content;
private String ref; private String ref;
private String blobId; private String blobId;
private String commitId; private String commitId;
private String lastCommitId;
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileName() { public String getFilePath() {
return fileName; return filePath;
} }
public void setFileName(String fileName) { public void setFilePath(String filePath) {
this.fileName = fileName; this.filePath = filePath;
} }
public String getFilePath() { public Integer getSize() {
return filePath; return size;
} }
public void setFilePath(String filePath) { public void setSize(Integer size) {
this.filePath = filePath; this.size = size;
} }
public Integer getSize() { public String getEncoding() {
return size; return encoding;
} }
public void setSize(Integer size) { public void setEncoding(String encoding) {
this.size = size; this.encoding = encoding;
} }
public String getEncoding() { public String getContent() {
return encoding; return content;
} }
public void setEncoding(String encoding) { public void setContent(String content) {
this.encoding = encoding; this.content = content;
} }
public String getContent() { public String getRef() {
return content; return ref;
} }
public void setContent(String content) { public void setRef(String ref) {
this.content = content; this.ref = ref;
} }
public String getRef() { public String getBlobId() {
return ref; return blobId;
} }
public void setRef(String ref) { public void setBlobId(String blobId) {
this.ref = ref; this.blobId = blobId;
} }
public String getBlobId() { public String getCommitId() {
return blobId; return commitId;
} }
public void setBlobId(String blobId) { public void setCommitId(String commitId) {
this.blobId = blobId; this.commitId = commitId;
} }
public String getCommitId() { public String getLastCommitId() {
return commitId; return lastCommitId;
} }
public void setCommitId(String commitId) { public void setLastCommitId(String lastCommitId) {
this.commitId = commitId; this.lastCommitId = lastCommitId;
} }
} }
package com.messners.gitlab.api.models; package com.messners.gitlab.api.models;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
...@@ -10,166 +11,211 @@ import javax.xml.bind.annotation.XmlRootElement; ...@@ -10,166 +11,211 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class Session { public class Session {
private String bio; private String avatarUrl;
private Boolean blocked; private String bio;
private Boolean canCreateGroup; private Boolean blocked;
private Boolean canCreateProject; private Boolean canCreateGroup;
private Boolean canCreateTeam; private Boolean canCreateProject;
private Date createdAt; private Integer colorSchemeId;
private Boolean darkScheme; private Date createdAt;
private String email; private Date currentSignInAt;
private Integer id; private Boolean darkScheme;
private Boolean isAdmin; private String email;
private String linkedin; private Integer id;
private String name; private List<Identity> identities;
private String privateToken; private Boolean isAdmin;
private String skype; private String linkedin;
private Integer themeId; private String name;
private String twitter; private String privateToken;
private String username; private Integer projectLimit;
private String websiteUrl; private String skype;
private Integer themeId;
public String getBio () { private String twitter;
return this.bio; private Boolean twoFactorEnabled;
} private String username;
private String websiteUrl;
public void setBio (String bio) {
this.bio = bio; public String getAvatarUrl() {
} return avatarUrl;
}
public Boolean getBlocked () {
return this.blocked; public void setAvatarUrl(String avatarUrl) {
} this.avatarUrl = avatarUrl;
}
public void setBlocked (Boolean blocked) {
this.blocked = blocked; public String getBio() {
} return bio;
}
public Boolean getCanCreateGroup () {
return this.canCreateGroup; public void setBio(String bio) {
} this.bio = bio;
}
public void setCanCreateGroup (Boolean canCreateGroup) {
this.canCreateGroup = canCreateGroup; public Boolean getBlocked() {
} return blocked;
}
public Boolean getCanCreateProject () {
return this.canCreateProject; public void setBlocked(Boolean blocked) {
} this.blocked = blocked;
}
public void setCanCreateProject (Boolean canCreateProject) {
this.canCreateProject = canCreateProject; public Boolean getCanCreateGroup() {
} return canCreateGroup;
}
public Boolean getCanCreateTeam () {
return this.canCreateTeam; public void setCanCreateGroup(Boolean canCreateGroup) {
} this.canCreateGroup = canCreateGroup;
}
public void setCanCreateTeam (Boolean canCreateTeam) {
this.canCreateTeam = canCreateTeam; public Boolean getCanCreateProject() {
} return canCreateProject;
}
public Date getCreatedAt () {
return this.createdAt; public void setCanCreateProject(Boolean canCreateProject) {
} this.canCreateProject = canCreateProject;
}
public void setCreatedAt (Date createdAt) {
this.createdAt = createdAt; public Integer getColorSchemeId() {
} return colorSchemeId;
}
public Boolean getDarkScheme () {
return this.darkScheme; public void setColorSchemeId(Integer colorSchemeId) {
} this.colorSchemeId = colorSchemeId;
}
public void setDarkScheme (Boolean darkScheme) {
this.darkScheme = darkScheme; public Date getCreatedAt() {
} return createdAt;
}
public String getEmail () {
return this.email; public void setCreatedAt(Date createdAt) {
} this.createdAt = createdAt;
}
public void setEmail (String email) {
this.email = email; public Date getCurrentSignInAt() {
} return currentSignInAt;
}
public Integer getId () {
return this.id; public void setCurrentSignInAt(Date currentSignInAt) {
} this.currentSignInAt = currentSignInAt;
}
public void setId (Integer id) {
this.id = id; public Boolean getDarkScheme() {
} return darkScheme;
}
public Boolean getIsAdmin () {
return this.isAdmin; public void setDarkScheme(Boolean darkScheme) {
} this.darkScheme = darkScheme;
}
public void setIsAdmin (Boolean isAdmin) {
this.isAdmin = isAdmin; public String getEmail() {
} return email;
}
public String getLinkedin () {
return this.linkedin; public void setEmail(String email) {
} this.email = email;
}
public void setLinkedin (String linkedin) {
this.linkedin = linkedin; public Integer getId() {
} return id;
}
public String getName () {
return this.name; public void setId(Integer id) {
} this.id = id;
}
public void setName (String name) {
this.name = name; public List<Identity> getIdentities() {
} return identities;
}
public String getPrivateToken () {
return this.privateToken; public void setIdentities(List<Identity> identities) {
} this.identities = identities;
}
public Boolean getIsAdmin() {
return isAdmin;
}
public void setPrivateToken (String privateToken) { public void setIsAdmin(Boolean isAdmin) {
this.privateToken = privateToken; this.isAdmin = isAdmin;
} }
public String getSkype () { public String getLinkedin() {
return this.skype; return linkedin;
} }
public void setSkype (String skype) { public void setLinkedin(String linkedin) {
this.skype = skype; this.linkedin = linkedin;
} }
public Integer getThemeId () { public String getName() {
return this.themeId; return name;
} }
public void setThemeId (Integer themeId) { public void setName(String name) {
this.themeId = themeId; this.name = name;
} }
public String getTwitter () { public String getPrivateToken() {
return this.twitter; return privateToken;
} }
public void setTwitter (String twitter) { public void setPrivateToken(String privateToken) {
this.twitter = twitter; this.privateToken = privateToken;
} }
public String getUsername () { public Integer getProjectLimit() {
return this.username; return projectLimit;
} }
public void setUsername (String username) { public void setProjectLimit(Integer projectLimit) {
this.username = username; this.projectLimit = projectLimit;
} }
public String getWebsiteUrl () { public String getSkype() {
return this.websiteUrl; return skype;
} }
public void setWebsiteUrl (String websiteUrl) { public void setSkype(String skype) {
this.websiteUrl = websiteUrl; this.skype = skype;
} }
public Integer getThemeId() {
return themeId;
}
public void setThemeId(Integer themeId) {
this.themeId = themeId;
}
public String getTwitter() {
return twitter;
}
public void setTwitter(String twitter) {
this.twitter = twitter;
}
public Boolean getTwoFactorEnabled() {
return twoFactorEnabled;
}
public void setTwoFactorEnabled(Boolean twoFactorEnabled) {
this.twoFactorEnabled = twoFactorEnabled;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getWebsiteUrl() {
return websiteUrl;
}
public void setWebsiteUrl(String websiteUrl) {
this.websiteUrl = websiteUrl;
}
} }
...@@ -8,58 +8,58 @@ import javax.xml.bind.annotation.XmlRootElement; ...@@ -8,58 +8,58 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class SystemHook { public class SystemHook {
private String eventName; private String eventName;
private String name; private String name;
private String ownerEmail; private String ownerEmail;
private String ownerName; private String ownerName;
private String path; private String path;
private Integer projectId; private Integer projectId;
public String getEventName () { public String getEventName() {
return this.eventName; return this.eventName;
} }
public void setEventName (String eventName) { public void setEventName(String eventName) {
this.eventName = eventName; this.eventName = eventName;
} }
public String getName () { public String getName() {
return this.name; return this.name;
} }
public void setName (String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getOwnerEmail () { public String getOwnerEmail() {
return this.ownerEmail; return this.ownerEmail;
} }
public void setOwnerEmail (String ownerEmail) { public void setOwnerEmail(String ownerEmail) {
this.ownerEmail = ownerEmail; this.ownerEmail = ownerEmail;
} }
public String getOwnerName () { public String getOwnerName() {
return this.ownerName; return this.ownerName;
} }
public void setOwnerName (String ownerName) { public void setOwnerName(String ownerName) {
this.ownerName = ownerName; this.ownerName = ownerName;
} }
public String getPath () { public String getPath() {
return this.path; return this.path;
} }
public void setPath (String path) { public void setPath(String path) {
this.path = path; this.path = path;
} }
public Integer getProjectId () { public Integer getProjectId() {
return this.projectId; return this.projectId;
} }
public void setProjectId (Integer projectId) { public void setProjectId(Integer projectId) {
this.projectId = projectId; this.projectId = projectId;
} }
} }
...@@ -8,31 +8,40 @@ import javax.xml.bind.annotation.XmlRootElement; ...@@ -8,31 +8,40 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class Tag { public class Tag {
private Commit commit; private Commit commit;
private String name; private String message;
private Boolean isProtected; private String name;
private Release release;
public Commit getCommit () {
return this.commit; public Commit getCommit() {
} return this.commit;
}
public void setCommit (Commit commit) {
this.commit = commit; public void setCommit(Commit commit) {
} this.commit = commit;
}
public String getName () {
return this.name; public String getMessage() {
} return message;
}
public void setName (String name) {
this.name = name; public void setMessage(String message) {
} this.message = message;
}
public Boolean getProtected () {
return this.isProtected; public String getName() {
} return this.name;
}
public void setProtected (Boolean isProtected) {
this.isProtected = isProtected; public void setName(String name) {
} this.name = name;
}
public Release getRelease() {
return release;
}
public void setRelease(Release release) {
this.release = release;
}
} }
...@@ -7,50 +7,58 @@ import javax.xml.bind.annotation.XmlRootElement; ...@@ -7,50 +7,58 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class TreeItem { public class TreeItem {
public enum Type { public enum Type {
TREE, TREE, BLOB;
BLOB;
public String toString() {
public String toString () { return (name().toLowerCase());
return (name().toLowerCase()); }
} }
}
private String id;
private String id; private String mode;
private String mode; private String name;
private String name; private String path;
private Type type; private Type type;
public String getId () { public String getId() {
return this.id; return this.id;
} }
public void setId (String id) { public void setId(String id) {
this.id = id; this.id = id;
} }
public String getMode () { public String getMode() {
return this.mode; return this.mode;
} }
public void setMode (String mode) { public void setMode(String mode) {
this.mode = mode; this.mode = mode;
} }
public String getName () { public String getName() {
return this.name; return this.name;
} }
public void setName (String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public Type getType () { public String getPath() {
return this.type; return this.path;
} }
public void setType (Type type) { public void setPath(String path) {
this.type = type; this.path = path;
} }
public Type getType() {
return this.type;
}
public void setType(Type type) {
this.type = type;
}
} }
package com.messners.gitlab.api.models; package com.messners.gitlab.api.models;
import java.util.Date;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) public class User extends AbstractUser {
public class User {
private String bio;
private Boolean canCreateGroup;
private Integer colorSchemeId;
private Date createdAt;
private String email;
private String externUid;
private Integer id;
private Boolean isAdmin;
private String linkedin;
private String name;
private String provider;
private String skype;
private String state;
private Integer themeId;
private String twitter;
private String username;
private String websiteUrl;
public String getBio () {
return this.bio;
}
public void setBio (String bio) {
this.bio = bio;
}
public boolean getCanCreateGroup () {
return this.canCreateGroup;
}
public void setCanCreateGroup (boolean canCreateGroup) {
this.canCreateGroup = canCreateGroup;
}
public Integer getColorSchemeId () {
return this.colorSchemeId;
}
public void setColorSchemeId (Integer colorSchemeId) {
this.colorSchemeId = colorSchemeId;
}
public Date getCreatedAt () {
return this.createdAt;
}
public void setCreatedAt (Date createdAt) {
this.createdAt = createdAt;
}
public String getEmail () {
return this.email;
}
public void setEmail (String email) {
this.email = email;
}
public String getExternUid () {
return this.externUid;
}
public void setExternUid (String externUid) {
this.externUid = externUid;
}
public Integer getId () {
return this.id;
}
public void setId (Integer id) {
this.id = id;
}
public boolean getIsAdmin () {
return this.isAdmin;
}
public void setIsAdmin (boolean isAdmin) {
this.isAdmin = isAdmin;
}
public String getLinkedin () {
return this.linkedin;
}
public void setLinkedin (String linkedin) {
this.linkedin = linkedin;
}
public String getName () {
return this.name;
}
public void setName (String name) {
this.name = name;
}
public String getProvider () {
return this.provider;
}
public void setProvider (String provider) {
this.provider = provider;
}
public String getSkype () {
return this.skype;
}
public void setSkype (String skype) {
this.skype = skype;
}
public String getState () {
return this.state;
}
public void setState (String state) {
this.state = state;
}
public Integer getThemeId () {
return this.themeId;
}
public void setThemeId (Integer themeId) {
this.themeId = themeId;
}
public String getTwitter () {
return this.twitter;
}
public void setTwitter (String twitter) {
this.twitter = twitter;
}
public String getUsername () {
return this.username;
}
public void setUsername (String username) {
this.username = username;
}
public String getWebsiteUrl () {
return this.websiteUrl;
}
public void setWebsiteUrl (String websiteUrl) {
this.websiteUrl = websiteUrl;
}
public static final boolean isValid (User user) {
return (user != null && user.getId() != null);
}
} }
package com.messners.gitlab.api.webhook; package com.messners.gitlab.api.webhook;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "objectKind",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = IssueEvent.class, name = IssueEvent.OBJECT_KIND),
@JsonSubTypes.Type(value = PushEvent.class, name = PushEvent.OBJECT_KIND),
@JsonSubTypes.Type(value = MergeRequestEvent.class, name = MergeRequestEvent.OBJECT_KIND)
})
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class EventObject { public class EventObject {
public enum ObjectKind { public static enum ObjectKind {
MERGE_REQUEST, ISSUE, MERGE_REQUEST, PUSH;
ISSUE;
@Override
public String toString () { public String toString() {
return (name().toLowerCase()); return (name().toLowerCase());
} }
} }
private EventObjectAttributes objectAttributes;
private ObjectKind objectKind;
public EventObjectAttributes getObjectAttributes () {
return this.objectAttributes;
}
public void setObjectAttributes (EventObjectAttributes objectAttributes) { private ObjectKind objectKind;
this.objectAttributes = objectAttributes;
}
public ObjectKind getObjectKind () { public ObjectKind getObjectKind() {
return this.objectKind; return this.objectKind;
} }
public void setObjectKind (ObjectKind objectKind) { public void setObjectKind(ObjectKind objectKind) {
this.objectKind = objectKind; this.objectKind = objectKind;
} }
} }
...@@ -5,26 +5,32 @@ import java.util.List; ...@@ -5,26 +5,32 @@ import java.util.List;
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 javax.xml.bind.annotation.XmlRootElement;
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.Commit;
import com.messners.gitlab.api.models.Project;
import com.messners.gitlab.api.models.Repository; import com.messners.gitlab.api.models.Repository;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class PushEvent { public class PushEvent extends EventObject {
public static final String OBJECT_KIND = "push";
private String after; private String after;
private String before; private String before;
private List<Commit> commits;
private Integer projectId;
private String ref; private String ref;
private Repository repository; private String checkoutSha;
private Integer totalCommitsCount;
private Integer userId; private Integer userId;
private String userName; private String userName;
private String userEmail;
private String userAvatar;
private Integer projectId;
private Project project;
private Repository repository;
private List<Commit> commits;
private Integer totalCommitsCount;
public String getAfter() { public String getAfter() {
return this.after; return this.after;
...@@ -41,13 +47,53 @@ public class PushEvent { ...@@ -41,13 +47,53 @@ public class PushEvent {
public void setBefore(String before) { public void setBefore(String before) {
this.before = before; this.before = before;
} }
public String getRef() {
return this.ref;
}
public List<Commit> getCommits() { public void setRef(String ref) {
return this.commits; this.ref = ref;
} }
public void setCommits(List<Commit> commits) { public String getCheckoutSha() {
this.commits = commits; return checkoutSha;
}
public void setCheckoutSha(String checkoutSha) {
this.checkoutSha = checkoutSha;
}
public Integer getUserId() {
return this.userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserEmail() {
return userEmail;
}
public void setUserEmail(String userEmail) {
this.userEmail = userEmail;
}
public String getUserAvatar() {
return userAvatar;
}
public void setUserAvatar(String userAvatar) {
this.userAvatar = userAvatar;
} }
public Integer getProjectId() { public Integer getProjectId() {
...@@ -58,12 +104,12 @@ public class PushEvent { ...@@ -58,12 +104,12 @@ public class PushEvent {
this.projectId = projectId; this.projectId = projectId;
} }
public String getRef() { public Project getProject() {
return this.ref; return project;
} }
public void setRef(String ref) { public void setProject(Project project) {
this.ref = ref; this.project = project;
} }
public Repository getRepository() { public Repository getRepository() {
...@@ -73,6 +119,14 @@ public class PushEvent { ...@@ -73,6 +119,14 @@ public class PushEvent {
public void setRepository(Repository repository) { public void setRepository(Repository repository) {
this.repository = repository; this.repository = repository;
} }
public List<Commit> getCommits() {
return this.commits;
}
public void setCommits(List<Commit> commits) {
this.commits = commits;
}
public Integer getTotalCommitsCount() { public Integer getTotalCommitsCount() {
return this.totalCommitsCount; return this.totalCommitsCount;
...@@ -82,22 +136,7 @@ public class PushEvent { ...@@ -82,22 +136,7 @@ public class PushEvent {
this.totalCommitsCount = totalCommitsCount; this.totalCommitsCount = totalCommitsCount;
} }
public Integer getUserId() {
return this.userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
/** /**
* Gets the branch name from the ref. Will return null if the ref does not start with "refs/heads/". * Gets the branch name from the ref. Will return null if the ref does not start with "refs/heads/".
* *
......
...@@ -14,8 +14,9 @@ import com.fasterxml.jackson.core.type.TypeReference; ...@@ -14,8 +14,9 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.messners.gitlab.api.models.Branch; import com.messners.gitlab.api.models.Branch;
import com.messners.gitlab.api.models.Commit;
import com.messners.gitlab.api.models.Diff; import com.messners.gitlab.api.models.Diff;
import com.messners.gitlab.api.models.Event; import com.messners.gitlab.api.models.Event;
import com.messners.gitlab.api.models.Group; import com.messners.gitlab.api.models.Group;
...@@ -23,7 +24,6 @@ import com.messners.gitlab.api.models.Issue; ...@@ -23,7 +24,6 @@ import com.messners.gitlab.api.models.Issue;
import com.messners.gitlab.api.models.Key; import com.messners.gitlab.api.models.Key;
import com.messners.gitlab.api.models.Member; import com.messners.gitlab.api.models.Member;
import com.messners.gitlab.api.models.MergeRequest; import com.messners.gitlab.api.models.MergeRequest;
import com.messners.gitlab.api.models.MergeRequestComment;
import com.messners.gitlab.api.models.Milestone; import com.messners.gitlab.api.models.Milestone;
import com.messners.gitlab.api.models.Note; import com.messners.gitlab.api.models.Note;
import com.messners.gitlab.api.models.Project; import com.messners.gitlab.api.models.Project;
...@@ -46,6 +46,7 @@ public class TestGitLabApiBeans { ...@@ -46,6 +46,7 @@ public class TestGitLabApiBeans {
@BeforeClass @BeforeClass
public static void setup() { public static void setup() {
jacksonJson = new JacksonJson(); jacksonJson = new JacksonJson();
jacksonJson.getObjectMapper().configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
} }
@Test @Test
...@@ -57,7 +58,17 @@ public class TestGitLabApiBeans { ...@@ -57,7 +58,17 @@ public class TestGitLabApiBeans {
branch = makeFakeApiCall(Branch.class, "bad-branch"); branch = makeFakeApiCall(Branch.class, "bad-branch");
assertTrue(!Branch.isValid(branch)); assertTrue(!Branch.isValid(branch));
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void testCommit() {
try {
Commit commit = makeFakeApiCall(Commit.class, "commit");
assertTrue(compareJson(commit, "commit"));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -139,7 +150,7 @@ public class TestGitLabApiBeans { ...@@ -139,7 +150,7 @@ public class TestGitLabApiBeans {
e.printStackTrace(); e.printStackTrace();
} }
} }
/*
@Test @Test
public void testMergeRequestComment() { public void testMergeRequestComment() {
...@@ -150,7 +161,7 @@ public class TestGitLabApiBeans { ...@@ -150,7 +161,7 @@ public class TestGitLabApiBeans {
e.printStackTrace(); e.printStackTrace();
} }
} }
*/
@Test @Test
public void testMergeRequest() { public void testMergeRequest() {
......
{ {
"name": "master", "name": "master",
"commit": { "merged": false,
"id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c", "protected": true,
"parents": [{ "id": "4ad91d3c1144c406e50c7b33bae684bd6837faf8" }], "developers_can_push": false,
"tree": "46e82de44b1061621357f24c05515327f2795a95", "developers_can_merge": false,
"message": "add projects API", "commit": {
"author": { "author_email": "john@example.com",
"name": "John Smith", "author_name": "John Smith",
"email": "john@example.com" "authored_date": "2012-06-27T05:51:39Z",
}, "committed_date": "2012-06-28T03:44:20Z",
"committer": { "committer_email": "john@example.com",
"name": "John Smith", "committer_name": "John Smith",
"email": "john@example.com" "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
}, "message": "add projects API",
"authored_date": "2012-06-27T12:51:39Z", "parent_ids": [
"committed_date": "2012-06-28T10:44:20Z" "4ad91d3c1144c406e50c7b33bae684bd6837faf8"
}, ]
"protected": true }
} }
...@@ -16,6 +16,6 @@ ...@@ -16,6 +16,6 @@
"state":"opened", "state":"opened",
"iid":23, "iid":23,
"merge_status":"unchecked", "merge_status":"unchecked",
"target_project_id":14, "target_project_id":14
} }
} }
...@@ -5,5 +5,11 @@ ...@@ -5,5 +5,11 @@
"push_events": true, "push_events": true,
"issues_events": true, "issues_events": true,
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true,
"note_events": true,
"build_events": true,
"pipeline_events": true,
"wiki_page_events": true,
"enable_ssl_verification": true,
"created_at": "2012-10-12T17:04:47Z" "created_at": "2012-10-12T17:04:47Z"
} }
\ No newline at end of file
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