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