Skip to content

Commit 3d87926

Browse files
committed
Initial commit (#404).
1 parent 69cf1ab commit 3d87926

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package org.gitlab4j.api.services;
2+
3+
import org.gitlab4j.api.GitLabApiForm;
4+
5+
public class BugzillaService extends NotificationService {
6+
7+
/**
8+
* Get the form data for this service based on it's properties.
9+
*
10+
* @return the form data for this service based on it's properties
11+
*/
12+
@Override
13+
public GitLabApiForm servicePropertiesForm() {
14+
GitLabApiForm formData = new GitLabApiForm()
15+
.withParam(DESCRIPTION_PROP, getDescription())
16+
.withParam(ISSUES_URL_PROP, getIssuesUrl(), true)
17+
.withParam(NEW_ISSUE_URL_PROP, getNewIssueUrl(), true)
18+
.withParam(PROJECT_URL_PROP, getProjectUrl(), true)
19+
.withParam(PUSH_EVENTS_PROP, getPushEvents())
20+
.withParam(TITLE_PROP, getTitle());
21+
return formData;
22+
}
23+
24+
public String getNewIssueUrl() {
25+
return this.getProperty(NEW_ISSUE_URL_PROP);
26+
}
27+
28+
public void setNewIssueUrl(String endpoint) {
29+
this.setProperty(NEW_ISSUE_URL_PROP, endpoint);
30+
}
31+
32+
public BugzillaService withNewIssueUrl(String endpoint) {
33+
setNewIssueUrl(endpoint);
34+
return this;
35+
}
36+
37+
public String getIssuesUrl() {
38+
return this.getProperty(ISSUES_URL_PROP);
39+
}
40+
41+
public void setIssuesUrl(String endpoint) {
42+
this.setProperty(ISSUES_URL_PROP, endpoint);
43+
}
44+
45+
public BugzillaService withIssuesUrl(String endpoint) {
46+
setIssuesUrl(endpoint);
47+
return this;
48+
}
49+
50+
public String getProjectUrl() {
51+
return this.getProperty(PROJECT_URL_PROP);
52+
}
53+
54+
public void setProjectUrl(String endpoint) {
55+
this.setProperty(PROJECT_URL_PROP, endpoint);
56+
}
57+
58+
public BugzillaService withProjectUrl(String endpoint) {
59+
setProjectUrl(endpoint);
60+
return this;
61+
}
62+
63+
public String getDescription() {
64+
return this.getProperty(DESCRIPTION_PROP);
65+
}
66+
67+
public void setDescription(String description) {
68+
this.setProperty(DESCRIPTION_PROP, description);
69+
}
70+
71+
public BugzillaService withDescription(String description) {
72+
setDescription(description);
73+
return this;
74+
}
75+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package org.gitlab4j.api.services;
2+
3+
import org.gitlab4j.api.GitLabApiForm;
4+
5+
public class CustomIssueTrackerService extends NotificationService {
6+
7+
/**
8+
* Get the form data for this service based on it's properties.
9+
*
10+
* @return the form data for this service based on it's properties
11+
*/
12+
@Override
13+
public GitLabApiForm servicePropertiesForm() {
14+
GitLabApiForm formData = new GitLabApiForm()
15+
.withParam(DESCRIPTION_PROP, getDescription())
16+
.withParam(ISSUES_URL_PROP, getIssuesUrl(), true)
17+
.withParam(NEW_ISSUE_URL_PROP, getNewIssueUrl(), true)
18+
.withParam(PROJECT_URL_PROP, getProjectUrl(), true)
19+
.withParam(PUSH_EVENTS_PROP, getPushEvents())
20+
.withParam(TITLE_PROP, getTitle());
21+
return formData;
22+
}
23+
24+
public String getNewIssueUrl() {
25+
return this.getProperty(NEW_ISSUE_URL_PROP);
26+
}
27+
28+
public void setNewIssueUrl(String endpoint) {
29+
this.setProperty(NEW_ISSUE_URL_PROP, endpoint);
30+
}
31+
32+
public CustomIssueTrackerService withNewIssueUrl(String endpoint) {
33+
setNewIssueUrl(endpoint);
34+
return this;
35+
}
36+
37+
public String getIssuesUrl() {
38+
return this.getProperty(ISSUES_URL_PROP);
39+
}
40+
41+
public void setIssuesUrl(String endpoint) {
42+
this.setProperty(ISSUES_URL_PROP, endpoint);
43+
}
44+
45+
public CustomIssueTrackerService withIssuesUrl(String endpoint) {
46+
setIssuesUrl(endpoint);
47+
return this;
48+
}
49+
50+
public String getProjectUrl() {
51+
return this.getProperty(PROJECT_URL_PROP);
52+
}
53+
54+
public void setProjectUrl(String endpoint) {
55+
this.setProperty(PROJECT_URL_PROP, endpoint);
56+
}
57+
58+
public CustomIssueTrackerService withProjectUrl(String endpoint) {
59+
setProjectUrl(endpoint);
60+
return this;
61+
}
62+
63+
public String getDescription() {
64+
return this.getProperty(DESCRIPTION_PROP);
65+
}
66+
67+
public void setDescription(String description) {
68+
this.setProperty(DESCRIPTION_PROP, description);
69+
}
70+
71+
public CustomIssueTrackerService withDescription(String description) {
72+
setDescription(description);
73+
return this;
74+
}
75+
}

0 commit comments

Comments
 (0)