-
Notifications
You must be signed in to change notification settings - Fork 486
Add support for release and deployment events in webhooks #704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
CodeDrivenMitch
wants to merge
2
commits into
gitlab4j:master
from
CodeDrivenMitch:deployment-releases-hook-support
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
src/main/java/org/gitlab4j/api/webhook/DeploymentEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| package org.gitlab4j.api.webhook; | ||
|
|
||
| import org.gitlab4j.api.models.User; | ||
| import org.gitlab4j.api.utils.JacksonJson; | ||
|
|
||
| public class DeploymentEvent extends AbstractEvent { | ||
|
|
||
| public static final String JOB_HOOK_X_GITLAB_EVENT = "Deployment Hook"; | ||
| public static final String OBJECT_KIND = "deployment"; | ||
|
|
||
| private String status; | ||
| private String statusChanged_at; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure the name is correct. Should be |
||
| private Integer deployableId; | ||
| private String deployableUrl; | ||
| private String environment; | ||
| private EventProject project; | ||
| private String shortSha; | ||
| private User user; | ||
| private String userUrl; | ||
| private String commitUrl; | ||
| private String commitTitle; | ||
|
|
||
| public String getObjectKind() { | ||
| return (OBJECT_KIND); | ||
| } | ||
|
|
||
| public void setObjectKind(String objectKind) { | ||
| if (!OBJECT_KIND.equals(objectKind)) | ||
| throw new RuntimeException("Invalid object_kind (" + objectKind + "), must be '" + OBJECT_KIND + "'"); | ||
| } | ||
|
|
||
| public String getStatus() { | ||
| return status; | ||
| } | ||
|
|
||
| public void setStatus(String status) { | ||
| this.status = status; | ||
| } | ||
|
|
||
| public String getStatusChanged_at() { | ||
| return statusChanged_at; | ||
| } | ||
|
|
||
| public void setStatusChanged_at(String statusChanged_at) { | ||
| this.statusChanged_at = statusChanged_at; | ||
| } | ||
|
Comment on lines
+40
to
+46
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't forget to update getter and setter here. |
||
|
|
||
| public Integer getDeployableId() { | ||
| return deployableId; | ||
| } | ||
|
|
||
| public void setDeployableId(Integer deployableId) { | ||
| this.deployableId = deployableId; | ||
| } | ||
|
|
||
| public String getDeployableUrl() { | ||
| return deployableUrl; | ||
| } | ||
|
|
||
| public void setDeployableUrl(String deployableUrl) { | ||
| this.deployableUrl = deployableUrl; | ||
| } | ||
|
|
||
| public String getEnvironment() { | ||
| return environment; | ||
| } | ||
|
|
||
| public void setEnvironment(String environment) { | ||
| this.environment = environment; | ||
| } | ||
|
|
||
| public EventProject getProject() { | ||
| return project; | ||
| } | ||
|
|
||
| public void setProject(EventProject project) { | ||
| this.project = project; | ||
| } | ||
|
|
||
| public String getShortSha() { | ||
| return shortSha; | ||
| } | ||
|
|
||
| public void setShortSha(String shortSha) { | ||
| this.shortSha = shortSha; | ||
| } | ||
|
|
||
| public User getUser() { | ||
| return user; | ||
| } | ||
|
|
||
| public void setUser(User user) { | ||
| this.user = user; | ||
| } | ||
|
|
||
| public String getUserUrl() { | ||
| return userUrl; | ||
| } | ||
|
|
||
| public void setUserUrl(String userUrl) { | ||
| this.userUrl = userUrl; | ||
| } | ||
|
|
||
| public String getCommitUrl() { | ||
| return commitUrl; | ||
| } | ||
|
|
||
| public void setCommitUrl(String commitUrl) { | ||
| this.commitUrl = commitUrl; | ||
| } | ||
|
|
||
| public String getCommitTitle() { | ||
| return commitTitle; | ||
| } | ||
|
|
||
| public void setCommitTitle(String commitTitle) { | ||
| this.commitTitle = commitTitle; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return (JacksonJson.toJsonString(this)); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/org/gitlab4j/api/webhook/EventReleaseAssets.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package org.gitlab4j.api.webhook; | ||
|
|
||
| import org.gitlab4j.api.utils.JacksonJson; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class EventReleaseAssets { | ||
|
|
||
| private Integer count; | ||
| private List<EventReleaseLink> links; | ||
| private List<EventReleaseSource> sources; | ||
|
|
||
| public Integer getCount() { | ||
| return count; | ||
| } | ||
|
|
||
| public void setCount(Integer count) { | ||
| this.count = count; | ||
| } | ||
|
|
||
| public List<EventReleaseLink> getLinks() { | ||
| return links; | ||
| } | ||
|
|
||
| public void setLinks(List<EventReleaseLink> links) { | ||
| this.links = links; | ||
| } | ||
|
|
||
| public List<EventReleaseSource> getSources() { | ||
| return sources; | ||
| } | ||
|
|
||
| public void setSources(List<EventReleaseSource> sources) { | ||
| this.sources = sources; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return (JacksonJson.toJsonString(this)); | ||
| } | ||
| } |
56 changes: 56 additions & 0 deletions
56
src/main/java/org/gitlab4j/api/webhook/EventReleaseLink.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| package org.gitlab4j.api.webhook; | ||
|
|
||
| import org.gitlab4j.api.utils.JacksonJson; | ||
|
|
||
| public class EventReleaseLink { | ||
| private Integer id; | ||
| private Boolean external; | ||
| private String linkType; | ||
| private String name; | ||
| private String url; | ||
|
|
||
| public Integer getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public void setId(final Integer id) { | ||
| this.id = id; | ||
| } | ||
|
|
||
| public Boolean getExternal() { | ||
| return external; | ||
| } | ||
|
|
||
| public void setExternal(final Boolean external) { | ||
| this.external = external; | ||
| } | ||
|
|
||
| public String getLinkType() { | ||
| return linkType; | ||
| } | ||
|
|
||
| public void setLinkType(final String linkType) { | ||
| this.linkType = linkType; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public void setName(final String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public String getUrl() { | ||
| return url; | ||
| } | ||
|
|
||
| public void setUrl(final String url) { | ||
| this.url = url; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return (JacksonJson.toJsonString(this)); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the formatting change here?