Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
718e7479
"src/test/resources/org/gitlab4j/api/snippet.json" did not exist on "e6dc786bb975ab26b0ff4f3aa254e9be0b8c875a"
Commit
718e7479
authored
Mar 02, 2021
by
Tom Taxon
Browse files
Fix comments and static field names
parent
86ab17d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ServicesApi.java
View file @
718e7479
...
@@ -496,12 +496,12 @@ public class ServicesApi extends AbstractApi {
...
@@ -496,12 +496,12 @@ public class ServicesApi extends AbstractApi {
}
}
/**
/**
* Get
the Custom Issue Tracker
service settings for a project.
* Get
Emails on push
service settings for a project.
*
*
* <pre><code>GitLab Endpoint: GET /projects/:id/services/
custom_issue_tracker
</code></pre>
* <pre><code>GitLab Endpoint: GET /projects/:id/services/
emails-on-push
</code></pre>
*
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @return a E
xternalWiki
Service instance holding the E
xternal Wiki service
settings
* @return a E
mailOnPush
Service instance holding the E
mail on push
settings
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
EmailOnPushService
getEmailOnPushService
(
Object
projectIdOrPath
)
throws
GitLabApiException
{
public
EmailOnPushService
getEmailOnPushService
(
Object
projectIdOrPath
)
throws
GitLabApiException
{
...
@@ -510,35 +510,37 @@ public class ServicesApi extends AbstractApi {
...
@@ -510,35 +510,37 @@ public class ServicesApi extends AbstractApi {
}
}
/**
/**
* Updates the
Custom Issue Tracker
service settings for a project.
* Updates the
EmailsOnPush
service settings for a project.
*
*
* <pre><code>GitLab Endpoint: PUT /projects/:id/services/
custom_issue_tracker
</code></pre>
* <pre><code>GitLab Endpoint: PUT /projects/:id/services/
emails-on-push
</code></pre>
*
*
* The following properties on the
CustomIssueTracker
Service instance are utilized in the update of the settings:
* The following properties on the
EmailOnPush
Service instance are utilized in the update of the settings:
* <p>
* <p>
* description (optional), description
* recipients (required), Emails separated by whitespace
* issuesUrl (required), issue url
* disable_diffs (optional), Disable code diffs
* newIssueUrl (required), new Issue url
* send_from_committer_email (optional), Send from committer
* projectUrl (required), project url
* push_events (optional), Enable notifications for push events
* pushEvents (optional) - Enable notifications for push events
* tag_push_events(optional), Enable notifications for tag push events
* title (optional), the title for the custom issue tracker
* branches_to_be_notified (optional), Branches to send notifications for. Valid options are "all", "default",
* "protected", and "default_and_protected". Notifications are always fired
* for tag pushes. The default value is "all"
* </p>
* </p>
*
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param
customIssueTracker the CustomIssueTracker
Service instance holding the settings
* @param
emailsOnPush the EmailOnPush
Service instance holding the settings
* @return a
CustomIssueTracker
Service instance holding the newly updated settings
* @return a
EmailOnPush
Service instance holding the newly updated settings
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
EmailOnPushService
updateEmailOnPushService
(
Object
projectIdOrPath
,
EmailOnPushService
customIssueTracker
)
throws
GitLabApiException
{
public
EmailOnPushService
updateEmailOnPushService
(
Object
projectIdOrPath
,
EmailOnPushService
emailsOnPush
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
customIssueTracker
.
servicePropertiesForm
();
GitLabApiForm
formData
=
emailsOnPush
.
servicePropertiesForm
();
Response
response
=
put
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"services"
,
"emails-on-push"
);
Response
response
=
put
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"services"
,
"emails-on-push"
);
return
(
response
.
readEntity
(
EmailOnPushService
.
class
));
return
(
response
.
readEntity
(
EmailOnPushService
.
class
));
}
}
/**
/**
* Deletes the
Custom Issue Tracker
service for a project.
* Deletes the
Emails on push
service for a project.
*
*
* <pre><code>GitLab Endpoint: DELETE /projects/:id/services/
custom_issue_tracker
</code></pre>
* <pre><code>GitLab Endpoint: DELETE /projects/:id/services/
emails-on-push
</code></pre>
*
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
...
...
src/main/java/org/gitlab4j/api/services/EmailOnPushService.java
View file @
718e7479
...
@@ -8,18 +8,18 @@ public class EmailOnPushService extends NotificationService {
...
@@ -8,18 +8,18 @@ public class EmailOnPushService extends NotificationService {
public
static
final
String
RECIPIENT_PROP
=
"recipients"
;
public
static
final
String
RECIPIENT_PROP
=
"recipients"
;
public
static
final
String
DISABLE_DIFFS_PROP
=
"disable_diffs"
;
public
static
final
String
DISABLE_DIFFS_PROP
=
"disable_diffs"
;
public
static
final
String
SEND_FROM_COMMITTER_EMAIL
=
"send_from_committer_email"
;
public
static
final
String
SEND_FROM_COMMITTER_EMAIL
_PROP
=
"send_from_committer_email"
;
public
static
final
String
BRANCHES_TO_BE_NOTIFIED
=
"branches_to_be_notified"
;
public
static
final
String
BRANCHES_TO_BE_NOTIFIED
_PROP
=
"branches_to_be_notified"
;
@Override
@Override
public
GitLabApiForm
servicePropertiesForm
()
{
public
GitLabApiForm
servicePropertiesForm
()
{
GitLabApiForm
formData
=
new
GitLabApiForm
()
GitLabApiForm
formData
=
new
GitLabApiForm
()
.
withParam
(
RECIPIENT_PROP
,
getRecipients
(),
true
)
.
withParam
(
RECIPIENT_PROP
,
getRecipients
(),
true
)
.
withParam
(
DISABLE_DIFFS_PROP
,
getDisableDiffs
())
.
withParam
(
DISABLE_DIFFS_PROP
,
getDisableDiffs
())
.
withParam
(
SEND_FROM_COMMITTER_EMAIL
,
getSendFromCommitterEmail
())
.
withParam
(
SEND_FROM_COMMITTER_EMAIL
_PROP
,
getSendFromCommitterEmail
())
.
withParam
(
PUSH_EVENTS_PROP
,
getPushEvents
())
.
withParam
(
PUSH_EVENTS_PROP
,
getPushEvents
())
.
withParam
(
"tag_push_events"
,
getTagPushEvents
())
.
withParam
(
"tag_push_events"
,
getTagPushEvents
())
.
withParam
(
BRANCHES_TO_BE_NOTIFIED
,
getBranchesToBeNotified
());
.
withParam
(
BRANCHES_TO_BE_NOTIFIED
_PROP
,
getBranchesToBeNotified
());
return
formData
;
return
formData
;
}
}
...
@@ -32,10 +32,10 @@ public class EmailOnPushService extends NotificationService {
...
@@ -32,10 +32,10 @@ public class EmailOnPushService extends NotificationService {
@JsonIgnore
@JsonIgnore
public
String
getRecipients
()
{
public
String
getRecipients
()
{
return
((
String
)
getProperty
(
RECIPIENT_PROP
));
return
((
String
)
getProperty
(
RECIPIENT_PROP
));
}
}
public
void
setRecipients
(
String
recipients
)
{
public
void
setRecipients
(
String
recipients
)
{
setProperty
(
RECIPIENT_PROP
,
recipients
);
setProperty
(
RECIPIENT_PROP
,
recipients
);
}
}
public
EmailOnPushService
withRecipients
(
String
recipients
)
{
public
EmailOnPushService
withRecipients
(
String
recipients
)
{
setRecipients
(
recipients
);
setRecipients
(
recipients
);
...
@@ -57,10 +57,10 @@ public class EmailOnPushService extends NotificationService {
...
@@ -57,10 +57,10 @@ public class EmailOnPushService extends NotificationService {
@JsonIgnore
@JsonIgnore
public
Boolean
getSendFromCommitterEmail
()
{
public
Boolean
getSendFromCommitterEmail
()
{
return
Boolean
.
valueOf
(
getProperty
(
SEND_FROM_COMMITTER_EMAIL
,
"false"
));
return
Boolean
.
valueOf
(
getProperty
(
SEND_FROM_COMMITTER_EMAIL
_PROP
,
"false"
));
}
}
public
void
setSendFromCommitterEmail
(
Boolean
sendFromCommitterEmail
)
{
public
void
setSendFromCommitterEmail
(
Boolean
sendFromCommitterEmail
)
{
setProperty
(
SEND_FROM_COMMITTER_EMAIL
,
sendFromCommitterEmail
);
setProperty
(
SEND_FROM_COMMITTER_EMAIL
_PROP
,
sendFromCommitterEmail
);
}
}
public
EmailOnPushService
withSendFromCommitterEmail
(
Boolean
sendFromCommitterEmail
)
{
public
EmailOnPushService
withSendFromCommitterEmail
(
Boolean
sendFromCommitterEmail
)
{
setSendFromCommitterEmail
(
sendFromCommitterEmail
);
setSendFromCommitterEmail
(
sendFromCommitterEmail
);
...
@@ -69,10 +69,10 @@ public class EmailOnPushService extends NotificationService {
...
@@ -69,10 +69,10 @@ public class EmailOnPushService extends NotificationService {
@JsonIgnore
@JsonIgnore
public
String
getBranchesToBeNotified
()
{
public
String
getBranchesToBeNotified
()
{
return
((
String
)
getProperty
(
BRANCHES_TO_BE_NOTIFIED
));
return
((
String
)
getProperty
(
BRANCHES_TO_BE_NOTIFIED
_PROP
));
}
}
public
void
setBranchesToBeNotified
(
String
branchesToBeNotified
)
{
public
void
setBranchesToBeNotified
(
String
branchesToBeNotified
)
{
setProperty
(
BRANCHES_TO_BE_NOTIFIED
,
branchesToBeNotified
);
setProperty
(
BRANCHES_TO_BE_NOTIFIED
_PROP
,
branchesToBeNotified
);
}
}
public
EmailOnPushService
withBranchesToBeNotified
(
String
branchesToBeNotified
)
{
public
EmailOnPushService
withBranchesToBeNotified
(
String
branchesToBeNotified
)
{
setBranchesToBeNotified
(
branchesToBeNotified
);
setBranchesToBeNotified
(
branchesToBeNotified
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment