Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/org/gitlab4j/api/ProjectApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -2073,6 +2073,8 @@ public ProjectHook addHook(Object projectIdOrPath, String url, ProjectHook enabl
.withParam("wiki_page_events", enabledHooks.getWikiPageEvents(), false)
.withParam("enable_ssl_verification", enableSslVerification, false)
.withParam("repository_update_events", enabledHooks.getRepositoryUpdateEvents(), false)
.withParam("deployment_events", enabledHooks.getDeploymentEvents(), false)
.withParam("releases_events", enabledHooks.getReleasesEvents(), false)
.withParam("token", secretToken, false);
Response response = post(Response.Status.CREATED, formData, "projects", getProjectIdOrPath(projectIdOrPath), "hooks");
return (response.readEntity(ProjectHook.class));
Expand Down
39 changes: 34 additions & 5 deletions src/main/java/org/gitlab4j/api/models/ProjectHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public class ProjectHook {
private Boolean confidentialNoteEvents;
private String pushEventsBranchFilter;

private Boolean deploymentEvents;
private Boolean releasesEvents;

public Boolean getBuildEvents() {
return buildEvents;
}
Expand Down Expand Up @@ -83,7 +86,7 @@ public Boolean getNoteEvents() {
public void setNoteEvents(Boolean noteEvents) {
this.noteEvents = noteEvents;
}

public Boolean getJobEvents() {
return jobEvents;
}
Expand Down Expand Up @@ -123,7 +126,7 @@ public Boolean getTagPushEvents() {
public void setTagPushEvents(Boolean tagPushEvents) {
this.tagPushEvents = tagPushEvents;
}

public String getToken() {
return token;
}
Expand Down Expand Up @@ -156,6 +159,22 @@ public void setRepositoryUpdateEvents(Boolean repositoryUpdateEvents) {
this.repositoryUpdateEvents = repositoryUpdateEvents;
}

public Boolean getDeploymentEvents() {
return deploymentEvents;
}

public void setDeploymentEvents(Boolean releasesEvents) {
this.deploymentEvents = releasesEvents;
}

public Boolean getReleasesEvents() {
return releasesEvents;
}

public void setReleasesEvents(Boolean releasesEvents) {
this.releasesEvents = releasesEvents;
}

public Boolean getConfidentialIssuesEvents() {
return confidentialIssuesEvents;
}
Expand All @@ -179,7 +198,7 @@ public String getPushEventsBranchFilter() {
public void setPushEventsBranchFilter(String pushEventsBranchFilter) {
this.pushEventsBranchFilter = pushEventsBranchFilter;
}

public ProjectHook withIssuesEvents(Boolean issuesEvents) {
this.issuesEvents = issuesEvents;
return (this);
Expand All @@ -194,7 +213,7 @@ public ProjectHook withNoteEvents(Boolean noteEvents) {
this.noteEvents = noteEvents;
return (this);
}

public ProjectHook withJobEvents(Boolean jobEvents) {
this.jobEvents = jobEvents;
return (this);
Expand Down Expand Up @@ -240,8 +259,18 @@ public ProjectHook withPushEventsBranchFilter(String pushEventsBranchFilter) {
return (this);
}

public ProjectHook withDeploymentEvents(Boolean deploymentEvents) {
this.deploymentEvents = deploymentEvents;
return (this);
}

public ProjectHook withReleasesEvents(Boolean releasesEvents) {
this.releasesEvents = releasesEvents;
return (this);
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
}
4 changes: 3 additions & 1 deletion src/test/resources/org/gitlab4j/api/hook.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"push_events_branch_filter": "",
"issues_events": true,
"confidential_issues_events": true,
"deployment_events": true,
"releases_events": true,
"merge_requests_events": true,
"tag_push_events": true,
"note_events": true,
Expand All @@ -14,4 +16,4 @@
"wiki_page_events": true,
"enable_ssl_verification": true,
"created_at": "2012-10-12T17:04:47Z"
}
}