Skip to content
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

improve ProjectHook setting #1132

Merged
merged 2 commits into from
Aug 6, 2024
Merged
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
@@ -2233,6 +2233,7 @@ public ProjectHook addHook(Object projectIdOrPath, String url, ProjectHook enabl
.withParam("deployment_events", enabledHooks.getDeploymentEvents(), false)
.withParam("releases_events", enabledHooks.getReleasesEvents(), false)
.withParam("deployment_events", enabledHooks.getDeploymentEvents(), false)
.withParam("description", enabledHooks.getDescription(), false)
.withParam("token", secretToken, false);
Response response = post(Response.Status.CREATED, formData, "projects", getProjectIdOrPath(projectIdOrPath), "hooks");
return (response.readEntity(ProjectHook.class));
@@ -2336,6 +2337,7 @@ public ProjectHook modifyHook(ProjectHook hook) throws GitLabApiException {
.withParam("repository_update_events", hook.getRepositoryUpdateEvents(), false)
.withParam("releases_events", hook.getReleasesEvents(), false)
.withParam("deployment_events", hook.getDeploymentEvents(), false)
.withParam("description", hook.getDescription(), false)
.withParam("token", hook.getToken(), false);

Response response = put(Response.Status.OK, formData.asMap(), "projects", hook.getProjectId(), "hooks", hook.getId());
10 changes: 10 additions & 0 deletions src/main/java/org/gitlab4j/api/models/ProjectHook.java
Original file line number Diff line number Diff line change
@@ -33,6 +33,8 @@ public class ProjectHook implements Serializable {
private Boolean deploymentEvents;
private Boolean releasesEvents;

private String description;

public Boolean getBuildEvents() {
return buildEvents;
}
@@ -177,6 +179,14 @@ public void setReleasesEvents(Boolean releasesEvents) {
this.releasesEvents = releasesEvents;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public Boolean getConfidentialIssuesEvents() {
return confidentialIssuesEvents;
}
3 changes: 2 additions & 1 deletion src/test/resources/org/gitlab4j/api/hook.json
Original file line number Diff line number Diff line change
@@ -15,5 +15,6 @@
"pipeline_events": true,
"wiki_page_events": true,
"enable_ssl_verification": true,
"created_at": "2012-10-12T17:04:47Z"
"created_at": "2012-10-12T17:04:47Z",
"description": "hook description"
}