Skip to content

Commit 9378b78

Browse files
titilamioubingpeng
and
oubingpeng
authored
add description to ProjectHook (#1132)
--------- Co-authored-by: oubingpeng <[email protected]>
1 parent e8a261a commit 9378b78

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/main/java/org/gitlab4j/api/ProjectApi.java

+2
Original file line numberDiff line numberDiff line change
@@ -2233,6 +2233,7 @@ public ProjectHook addHook(Object projectIdOrPath, String url, ProjectHook enabl
22332233
.withParam("deployment_events", enabledHooks.getDeploymentEvents(), false)
22342234
.withParam("releases_events", enabledHooks.getReleasesEvents(), false)
22352235
.withParam("deployment_events", enabledHooks.getDeploymentEvents(), false)
2236+
.withParam("description", enabledHooks.getDescription(), false)
22362237
.withParam("token", secretToken, false);
22372238
Response response = post(Response.Status.CREATED, formData, "projects", getProjectIdOrPath(projectIdOrPath), "hooks");
22382239
return (response.readEntity(ProjectHook.class));
@@ -2336,6 +2337,7 @@ public ProjectHook modifyHook(ProjectHook hook) throws GitLabApiException {
23362337
.withParam("repository_update_events", hook.getRepositoryUpdateEvents(), false)
23372338
.withParam("releases_events", hook.getReleasesEvents(), false)
23382339
.withParam("deployment_events", hook.getDeploymentEvents(), false)
2340+
.withParam("description", hook.getDescription(), false)
23392341
.withParam("token", hook.getToken(), false);
23402342

23412343
Response response = put(Response.Status.OK, formData.asMap(), "projects", hook.getProjectId(), "hooks", hook.getId());

src/main/java/org/gitlab4j/api/models/ProjectHook.java

+10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public class ProjectHook implements Serializable {
3333
private Boolean deploymentEvents;
3434
private Boolean releasesEvents;
3535

36+
private String description;
37+
3638
public Boolean getBuildEvents() {
3739
return buildEvents;
3840
}
@@ -177,6 +179,14 @@ public void setReleasesEvents(Boolean releasesEvents) {
177179
this.releasesEvents = releasesEvents;
178180
}
179181

182+
public String getDescription() {
183+
return description;
184+
}
185+
186+
public void setDescription(String description) {
187+
this.description = description;
188+
}
189+
180190
public Boolean getConfidentialIssuesEvents() {
181191
return confidentialIssuesEvents;
182192
}

src/test/resources/org/gitlab4j/api/hook.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
"pipeline_events": true,
1616
"wiki_page_events": true,
1717
"enable_ssl_verification": true,
18-
"created_at": "2012-10-12T17:04:47Z"
18+
"created_at": "2012-10-12T17:04:47Z",
19+
"description": "hook description"
1920
}

0 commit comments

Comments
 (0)