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;
}
}
......@@ -7,187 +7,187 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "object_attributes")
@XmlAccessorType (XmlAccessType.FIELD)
@XmlAccessorType(XmlAccessType.FIELD)
public class EventObjectAttributes {
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;
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;
}
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;
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 void setSourceProjectId(Integer sourceProjectId) {
this.sourceProjectId = sourceProjectId;
}
public String getStCommits () {
return this.stCommits;
}
public String getStCommits() {
return this.stCommits;
}
public void setStCommits (String stCommits) {
this.stCommits = stCommits;
}
public void setStCommits(String stCommits) {
this.stCommits = stCommits;
}
public String getStDiffs () {
return this.stDiffs;
}
public String getStDiffs() {
return this.stDiffs;
}
public void setStDiffs (String stDiffs) {
this.stDiffs = stDiffs;
}
public void setStDiffs(String stDiffs) {
this.stDiffs = stDiffs;
}
public String getState () {
return this.state;
}
public String getState() {
return this.state;
}
public void setState (String state) {
this.state = state;
}
public void setState(String state) {
this.state = state;
}
public String getTargetBranch () {
return this.targetBranch;
}
public String getTargetBranch() {
return this.targetBranch;
}
public void setTargetBranch (String targetBranch) {
this.targetBranch = targetBranch;
}
public void setTargetBranch(String targetBranch) {
this.targetBranch = targetBranch;
}
public Integer getTargetProjectId () {
return this.targetProjectId;
}
public Integer getTargetProjectId() {
return this.targetProjectId;
}
public void setTargetProjectId (Integer targetProjectId) {
this.targetProjectId = targetProjectId;
}
public void setTargetProjectId(Integer targetProjectId) {
this.targetProjectId = targetProjectId;
}
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 Date getUpdatedAt () {
return this.updatedAt;
}
public Date getUpdatedAt() {
return this.updatedAt;
}
public void setUpdatedAt (Date updatedAt) {
this.updatedAt = updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
}
......@@ -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"
]
}
}
{
"id": "ed899a2f4b50b4370feeea94676502b42383c746",
"short_id": "ed899a2f4b5",
"title": "Replace sanitize with escape once",
"author_name": "Dmitriy Zaporozhets",
"author_email": "dzaporozhets@sphereconsultinginc.com",
"created_at": "2012-09-20T08:50:22Z"
"id": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
"short_id": "6104942438c",
"title": "Sanitize for network graph",
"author_name": "randx",
"author_email": "dmitriy.zaporozhets@gmail.com",
"committer_name": "Dmitriy",
"committer_email": "dmitriy.zaporozhets@gmail.com",
"created_at": "2012-09-20T06:06:12Z",
"message": "Sanitize for network graph",
"committed_date": "2012-09-20T06:06:12Z",
"authored_date": "2012-09-20T06:06:12Z",
"parent_ids": [
"ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba"
],
"stats": {
"additions": 15,
"deletions": 10,
"total": 25
},
"status": "running"
}
......@@ -16,6 +16,6 @@
"state":"opened",
"iid":23,
"merge_status":"unchecked",
"target_project_id":14,
"target_project_id":14
}
}
{
"project_id": 15,
"action_name": "opened",
"author_id": 1,
"data": {
"before": "50d4420237a9de7be1304607147aec22e4a14af7",
"after": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"ref": "refs/heads/master",
"user_id": 1,
"user_name": "Dmitriy Zaporozhets",
"repository": {
"name": "gitlabhq",
"url": "git@dev.gitlab.org:gitlab/gitlabhq.git",
"description": "GitLab: self hosted Git management software. \r\nDistributed under the MIT License.",
"homepage": "https://dev.gitlab.org/gitlab/gitlabhq"
"title": "this is a title",
"project_id": 15,
"action_name": "opened",
"target_id": 830,
"target_type": "Issue",
"author_id": 1,
"author": {
"name": "Dmitriy Zaporozhets",
"username": "root",
"id": 1,
"state": "active",
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
"web_url": "http://localhost:3000/root"
},
"commits": [{
"id": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"message": "Add simple search to projects in public area",
"timestamp": "2013-05-13T18:18:08Z",
"url": "https://dev.gitlab.org/gitlab/gitlabhq/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"author": {
"name": "Dmitriy Zaporozhets",
"email": "dmitriy.zaporozhets@gmail.com"
}
}],
"total_commits_count": 1
}
}
"author_username": "john",
"data": {
"before": "50d4420237a9de7be1304607147aec22e4a14af7",
"after": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"ref": "refs/heads/master",
"user_id": 1,
"user_name": "Dmitriy Zaporozhets",
"repository": {
"name": "gitlabhq",
"url": "git@dev.gitlab.org:gitlab/gitlabhq.git",
"description": "GitLab: self hosted Git management software. \r\nDistributed under the MIT License.",
"homepage": "https://dev.gitlab.org/gitlab/gitlabhq"
},
"commits": [
{
"id": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"message": "Add simple search to projects in public area",
"timestamp": "2013-05-13T18:18:08Z",
"url": "https://dev.gitlab.org/gitlab/gitlabhq/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"author": {
"name": "Dmitriy Zaporozhets",
"email": "dmitriy.zaporozhets@gmail.com"
}
}
],
"total_commits_count": 1
},
"target_title": "target title"
}
\ No newline at end of file
......@@ -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
{
"id": 42,
"iid": 4,
"project_id": 8,
"title": "Add user settings",
"description": "",
"labels": [
"feature"
],
"milestone": {
"id": 1,
"title": "v1.0",
"description": "",
"due_date": "2012-07-20T00:00:00Z",
"state": "reopenend",
"updated_at": "2012-07-04T13:42:48Z",
"created_at": "2012-07-04T13:42:48Z"
},
"assignee": {
"id": 2,
"username": "jack_smith",
"email": "jack@example.com",
"name": "Jack Smith",
"state": "active",
"created_at": "2012-05-23T08:01:01Z"
},
"author": {
"id": 1,
"username": "john_smith",
"email": "john@example.com",
"name": "John Smith",
"state": "active",
"created_at": "2012-05-23T08:00:58Z"
},
"state": "opened",
"updated_at": "2012-07-12T13:43:19Z",
"created_at": "2012-06-28T12:58:06Z"
}
"project_id" : 4,
"milestone" : {
"project_id" : 4,
"state" : "closed",
"description" : "Rerum est voluptatem provident consequuntur molestias similique ipsum dolor.",
"iid" : 3,
"id" : 11,
"title" : "v3.0",
"created_at" : "2016-01-04T15:31:39.788Z",
"updated_at" : "2016-01-04T15:31:39.788Z"
},
"author" : {
"state" : "active",
"web_url" : "https://gitlab.example.com/root",
"username" : "root",
"id" : 1,
"name" : "Administrator"
},
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"state" : "closed",
"iid" : 1,
"assignee" : {
"web_url" : "https://gitlab.example.com/lennie",
"state" : "active",
"username" : "lennie",
"id" : 9,
"name" : "Dr. Luella Kovacek"
},
"labels" : [],
"id" : 41,
"title" : "Ut commodi ullam eos dolores perferendis nihil sunt.",
"updated_at" : "2016-01-04T15:31:46.176Z",
"created_at" : "2016-01-04T15:31:46.176Z",
"subscribed": false,
"user_notes_count": 1,
"web_url": "http://example.com/example/example/issues/1",
"confidential": false
}
\ No newline at end of file
{
"id": 1,
"title" : "Public key",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
"created_at":"2013-10-02T11:12:29Z"
"id": 1,
"title": "Sample key 25",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt1256k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
"created_at": "2015-09-03T07:24:44.627Z",
"user": {
"name": "John Smith",
"username": "john_smith",
"id": 25,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/cfa35b8cd2ec278026357769582fa563?s=40\u0026d=identicon",
"web_url": "http://localhost:3000/john_smith",
"created_at": "2015-09-03T07:24:01.670Z",
"is_admin": false,
"skype": "",
"linkedin": "",
"twitter": "",
"email": "john@example.com",
"theme_id": 2,
"color_scheme_id": 1,
"projects_limit": 10,
"identities": [],
"can_create_group": true,
"can_create_project": true,
"two_factor_enabled": false
}
}
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