Skip to content

Commit 718e747

Browse files
committed
Fix comments and static field names
1 parent 86ab17d commit 718e747

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed

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

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,12 @@ public void deleteCustomIssueTrackerService(Object projectIdOrPath) throws GitLa
496496
}
497497

498498
/**
499-
* Get the Custom Issue Tracker service settings for a project.
499+
* Get Emails on push service settings for a project.
500500
*
501-
* <pre><code>GitLab Endpoint: GET /projects/:id/services/custom_issue_tracker</code></pre>
501+
* <pre><code>GitLab Endpoint: GET /projects/:id/services/emails-on-push</code></pre>
502502
*
503503
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
504-
* @return a ExternalUncycloService instance holding the External Uncyclo service settings
504+
* @return a EmailOnPushService instance holding the Email on push settings
505505
* @throws GitLabApiException if any exception occurs
506506
*/
507507
public EmailOnPushService getEmailOnPushService(Object projectIdOrPath) throws GitLabApiException {
@@ -510,35 +510,37 @@ public EmailOnPushService getEmailOnPushService(Object projectIdOrPath) throws G
510510
}
511511

512512
/**
513-
* Updates the Custom Issue Tracker service settings for a project.
513+
* Updates the EmailsOnPush service settings for a project.
514514
*
515-
* <pre><code>GitLab Endpoint: PUT /projects/:id/services/custom_issue_tracker</code></pre>
515+
* <pre><code>GitLab Endpoint: PUT /projects/:id/services/emails-on-push</code></pre>
516516
*
517-
* The following properties on the CustomIssueTrackerService instance are utilized in the update of the settings:
517+
* The following properties on the EmailOnPushService instance are utilized in the update of the settings:
518518
* <p>
519-
* description (optional), description
520-
* issuesUrl (required), issue url
521-
* newIssueUrl (required), new Issue url
522-
* projectUrl (required), project url
523-
* pushEvents (optional) - Enable notifications for push events
524-
* title (optional), the title for the custom issue tracker
519+
* recipients (required), Emails separated by whitespace
520+
* disable_diffs (optional), Disable code diffs
521+
* send_from_committer_email (optional), Send from committer
522+
* push_events (optional), Enable notifications for push events
523+
* tag_push_events(optional), Enable notifications for tag push events
524+
* branches_to_be_notified (optional), Branches to send notifications for. Valid options are "all", "default",
525+
* "protected", and "default_and_protected". Notifications are always fired
526+
* for tag pushes. The default value is "all"
525527
* </p>
526528
*
527529
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
528-
* @param customIssueTracker the CustomIssueTrackerService instance holding the settings
529-
* @return a CustomIssueTrackerService instance holding the newly updated settings
530+
* @param emailsOnPush the EmailOnPushService instance holding the settings
531+
* @return a EmailOnPushService instance holding the newly updated settings
530532
* @throws GitLabApiException if any exception occurs
531533
*/
532-
public EmailOnPushService updateEmailOnPushService(Object projectIdOrPath, EmailOnPushService customIssueTracker) throws GitLabApiException {
533-
GitLabApiForm formData = customIssueTracker.servicePropertiesForm();
534+
public EmailOnPushService updateEmailOnPushService(Object projectIdOrPath, EmailOnPushService emailsOnPush) throws GitLabApiException {
535+
GitLabApiForm formData = emailsOnPush.servicePropertiesForm();
534536
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "emails-on-push");
535537
return (response.readEntity(EmailOnPushService.class));
536538
}
537539

538540
/**
539-
* Deletes the Custom Issue Tracker service for a project.
541+
* Deletes the Emails on push service for a project.
540542
*
541-
* <pre><code>GitLab Endpoint: DELETE /projects/:id/services/custom_issue_tracker</code></pre>
543+
* <pre><code>GitLab Endpoint: DELETE /projects/:id/services/emails-on-push</code></pre>
542544
*
543545
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
544546
* @throws GitLabApiException if any exception occurs

src/main/java/org/gitlab4j/api/services/EmailOnPushService.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ public class EmailOnPushService extends NotificationService {
88

99
public static final String RECIPIENT_PROP = "recipients";
1010
public static final String DISABLE_DIFFS_PROP = "disable_diffs";
11-
public static final String SEND_FROM_COMMITTER_EMAIL = "send_from_committer_email";
12-
public static final String BRANCHES_TO_BE_NOTIFIED = "branches_to_be_notified";
11+
public static final String SEND_FROM_COMMITTER_EMAIL_PROP = "send_from_committer_email";
12+
public static final String BRANCHES_TO_BE_NOTIFIED_PROP = "branches_to_be_notified";
1313

1414
@Override
1515
public GitLabApiForm servicePropertiesForm() {
1616
GitLabApiForm formData = new GitLabApiForm()
1717
.withParam(RECIPIENT_PROP, getRecipients(), true)
1818
.withParam(DISABLE_DIFFS_PROP, getDisableDiffs())
19-
.withParam(SEND_FROM_COMMITTER_EMAIL, getSendFromCommitterEmail())
19+
.withParam(SEND_FROM_COMMITTER_EMAIL_PROP, getSendFromCommitterEmail())
2020
.withParam(PUSH_EVENTS_PROP, getPushEvents())
2121
.withParam("tag_push_events", getTagPushEvents())
22-
.withParam(BRANCHES_TO_BE_NOTIFIED, getBranchesToBeNotified());
22+
.withParam(BRANCHES_TO_BE_NOTIFIED_PROP, getBranchesToBeNotified());
2323
return formData;
2424
}
2525

@@ -32,10 +32,10 @@ public EmailOnPushService withTagPushEvents(Boolean pushEvents) {
3232

3333
@JsonIgnore
3434
public String getRecipients() {
35-
return ((String)getProperty(RECIPIENT_PROP));
35+
return ((String)getProperty(RECIPIENT_PROP));
3636
}
3737
public void setRecipients(String recipients) {
38-
setProperty(RECIPIENT_PROP, recipients);
38+
setProperty(RECIPIENT_PROP, recipients);
3939
}
4040
public EmailOnPushService withRecipients(String recipients) {
4141
setRecipients(recipients);
@@ -57,10 +57,10 @@ public EmailOnPushService withDisableDiffs(Boolean disableDiffs) {
5757

5858
@JsonIgnore
5959
public Boolean getSendFromCommitterEmail() {
60-
return Boolean.valueOf(getProperty(SEND_FROM_COMMITTER_EMAIL,"false"));
60+
return Boolean.valueOf(getProperty(SEND_FROM_COMMITTER_EMAIL_PROP,"false"));
6161
}
6262
public void setSendFromCommitterEmail(Boolean sendFromCommitterEmail) {
63-
setProperty(SEND_FROM_COMMITTER_EMAIL, sendFromCommitterEmail);
63+
setProperty(SEND_FROM_COMMITTER_EMAIL_PROP, sendFromCommitterEmail);
6464
}
6565
public EmailOnPushService withSendFromCommitterEmail(Boolean sendFromCommitterEmail) {
6666
setSendFromCommitterEmail(sendFromCommitterEmail);
@@ -69,10 +69,10 @@ public EmailOnPushService withSendFromCommitterEmail(Boolean sendFromCommitterEm
6969

7070
@JsonIgnore
7171
public String getBranchesToBeNotified() {
72-
return ((String)getProperty(BRANCHES_TO_BE_NOTIFIED));
72+
return ((String)getProperty(BRANCHES_TO_BE_NOTIFIED_PROP));
7373
}
7474
public void setBranchesToBeNotified(String branchesToBeNotified) {
75-
setProperty(BRANCHES_TO_BE_NOTIFIED, branchesToBeNotified);
75+
setProperty(BRANCHES_TO_BE_NOTIFIED_PROP, branchesToBeNotified);
7676
}
7777
public EmailOnPushService withBranchesToBeNotified(String branchesToBeNotified) {
7878
setBranchesToBeNotified(branchesToBeNotified);

0 commit comments

Comments
 (0)