Skip to content

Commit

Permalink
add description to ProjectHook (#1132)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: oubingpeng <[email protected]>
  • Loading branch information
titilami and oubingpeng authored Aug 6, 2024
1 parent e8a261a commit 9378b78
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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 @@ -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));
Expand Down Expand Up @@ -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());
Expand Down
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
Expand Up @@ -33,6 +33,8 @@ public class ProjectHook implements Serializable {
private Boolean deploymentEvents;
private Boolean releasesEvents;

private String description;

public Boolean getBuildEvents() {
return buildEvents;
}
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/org/gitlab4j/api/hook.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 9378b78

Please sign in to comment.