From c2af9a23627fee74749548a1656a510291d477c2 Mon Sep 17 00:00:00 2001 From: Greg Messner Date: Mon, 6 Feb 2017 00:22:47 -0800 Subject: [PATCH] More mods to support GitLab 8 --- .../gitlab/api/webhook/EventCommit.java | 82 ++++++++ .../api/webhook/EventObjectAttributes.java | 193 ------------------ .../gitlab/api/webhook/EventProject.java | 138 +++++++++++++ .../gitlab/api/webhook/EventRepository.java | 74 +++++++ 4 files changed, 294 insertions(+), 193 deletions(-) create mode 100644 src/main/java/com/messners/gitlab/api/webhook/EventCommit.java delete mode 100644 src/main/java/com/messners/gitlab/api/webhook/EventObjectAttributes.java create mode 100644 src/main/java/com/messners/gitlab/api/webhook/EventProject.java create mode 100644 src/main/java/com/messners/gitlab/api/webhook/EventRepository.java diff --git a/src/main/java/com/messners/gitlab/api/webhook/EventCommit.java b/src/main/java/com/messners/gitlab/api/webhook/EventCommit.java new file mode 100644 index 00000000..596f7f28 --- /dev/null +++ b/src/main/java/com/messners/gitlab/api/webhook/EventCommit.java @@ -0,0 +1,82 @@ +package com.messners.gitlab.api.webhook; + +import java.util.Date; +import java.util.List; + +import com.messners.gitlab.api.models.Author; + +public class EventCommit { + + private String id; + private String message; + private Date timestamp; + private String url; + private Author author; + private List added; + private List modified; + private List removed; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Author getAuthor() { + return author; + } + + public void setAuthor(Author author) { + this.author = author; + } + + public List getAdded() { + return added; + } + + public void setAdded(List added) { + this.added = added; + } + + public List getModified() { + return modified; + } + + public void setModified(List modified) { + this.modified = modified; + } + + public List getRemoved() { + return removed; + } + + public void setRemoved(List removed) { + this.removed = removed; + } +} diff --git a/src/main/java/com/messners/gitlab/api/webhook/EventObjectAttributes.java b/src/main/java/com/messners/gitlab/api/webhook/EventObjectAttributes.java deleted file mode 100644 index a68b81ad..00000000 --- a/src/main/java/com/messners/gitlab/api/webhook/EventObjectAttributes.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.messners.gitlab.api.webhook; - -import java.util.Date; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "object_attributes") -@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; - } - - public void setSourceProjectId(Integer sourceProjectId) { - this.sourceProjectId = sourceProjectId; - } - - public String getStCommits() { - return this.stCommits; - } - - public void setStCommits(String stCommits) { - this.stCommits = stCommits; - } - - public String getStDiffs() { - return this.stDiffs; - } - - public void setStDiffs(String stDiffs) { - this.stDiffs = stDiffs; - } - - public String getState() { - return this.state; - } - - public void setState(String state) { - this.state = state; - } - - public String getTargetBranch() { - return this.targetBranch; - } - - public void setTargetBranch(String targetBranch) { - this.targetBranch = targetBranch; - } - - public Integer getTargetProjectId() { - return this.targetProjectId; - } - - public void setTargetProjectId(Integer targetProjectId) { - this.targetProjectId = targetProjectId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public Date getUpdatedAt() { - return this.updatedAt; - } - - public void setUpdatedAt(Date updatedAt) { - this.updatedAt = updatedAt; - } -} diff --git a/src/main/java/com/messners/gitlab/api/webhook/EventProject.java b/src/main/java/com/messners/gitlab/api/webhook/EventProject.java new file mode 100644 index 00000000..915562a4 --- /dev/null +++ b/src/main/java/com/messners/gitlab/api/webhook/EventProject.java @@ -0,0 +1,138 @@ +package com.messners.gitlab.api.webhook; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; + +import com.messners.gitlab.api.models.AccessLevel; + +@XmlAccessorType(XmlAccessType.FIELD) +public class EventProject { + + private String name; + private String description; + private String webUrl; + private String avatarUrl; + private String gitSshUrl; + private String gitHttpUrl; + private String namespace; + private AccessLevel visibilityLevel; + private String pathWithNamespace; + private String defaultBranch; + private String homepage; + private String url; + private String sshUrl; + private String httpUrl; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getWebUrl() { + return webUrl; + } + + public void setWebUrl(String webUrl) { + this.webUrl = webUrl; + } + + public String getAvatarUrl() { + return avatarUrl; + } + + public void setAvatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl; + } + + public String getGitSshUrl() { + return gitSshUrl; + } + + public void setGitSshUrl(String gitSshUrl) { + this.gitSshUrl = gitSshUrl; + } + + public String getGitHttpUrl() { + return gitHttpUrl; + } + + public void setGitHttpUrl(String gitHttpUrl) { + this.gitHttpUrl = gitHttpUrl; + } + + public String getNamespace() { + return namespace; + } + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + public AccessLevel getVisibilityLevel() { + return visibilityLevel; + } + + public void setVisibilityLevel(AccessLevel visibilityLevel) { + this.visibilityLevel = visibilityLevel; + } + + public String getPathWithNamespace() { + return pathWithNamespace; + } + + public void setPathWithNamespace(String pathWithNamespace) { + this.pathWithNamespace = pathWithNamespace; + } + + public String getDefaultBranch() { + return defaultBranch; + } + + public void setDefaultBranch(String defaultBranch) { + this.defaultBranch = defaultBranch; + } + + public String getHomepage() { + return homepage; + } + + public void setHomepage(String homepage) { + this.homepage = homepage; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getSshUrl() { + return sshUrl; + } + + public void setSshUrl(String sshUrl) { + this.sshUrl = sshUrl; + } + + public String getHttpUrl() { + return httpUrl; + } + + public void setHttpUrl(String httpUrl) { + this.httpUrl = httpUrl; + } + +} diff --git a/src/main/java/com/messners/gitlab/api/webhook/EventRepository.java b/src/main/java/com/messners/gitlab/api/webhook/EventRepository.java new file mode 100644 index 00000000..e84ced13 --- /dev/null +++ b/src/main/java/com/messners/gitlab/api/webhook/EventRepository.java @@ -0,0 +1,74 @@ +package com.messners.gitlab.api.webhook; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; + +import com.messners.gitlab.api.models.AccessLevel; + +@XmlAccessorType(XmlAccessType.FIELD) +public class EventRepository { + + private String name; + private String url; + private String description; + private String homepage; + private String git_http_url; + private String git_ssh_url; + private AccessLevel visibility_level; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getHomepage() { + return homepage; + } + + public void setHomepage(String homepage) { + this.homepage = homepage; + } + + public String getGit_http_url() { + return git_http_url; + } + + public void setGit_http_url(String git_http_url) { + this.git_http_url = git_http_url; + } + + public String getGit_ssh_url() { + return git_ssh_url; + } + + public void setGit_ssh_url(String git_ssh_url) { + this.git_ssh_url = git_ssh_url; + } + + public AccessLevel getVisibility_level() { + return visibility_level; + } + + public void setVisibility_level(AccessLevel visibility_level) { + this.visibility_level = visibility_level; + } +} -- GitLab