Skip to content

Commit 58a0703

Browse files
committed
Fix "created_after" and "created_before" parameters in GroupApi#getAuditEvents()
And fix the parameter names to use camelCase everywhere Fixes #1262
1 parent 955e5a4 commit 58a0703

File tree

3 files changed

+36
-36
lines changed

3 files changed

+36
-36
lines changed

gitlab4j-api/src/main/java/org/gitlab4j/api/AuditEventApi.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ public AuditEventApi(GitLabApi gitLabApi) {
2525
*
2626
* <pre><code>GET /audit_events/</code></pre>
2727
*
28-
* @param created_after Return group audit events created on or after the given time.
29-
* @param created_before Return group audit events created on or before the given time.
28+
* @param createdAfter Return group audit events created on or after the given time.
29+
* @param createdBefore Return group audit events created on or before the given time.
3030
* @param entityType Return audit events for the given entity type. Valid values are: User, Group, or Project.
3131
* @param entityId Return audit events for the given entity ID. Requires entityType attribute to be present.
3232
* @return a List of group Audit events
3333
* @throws GitLabApiException if any exception occurs
3434
*/
35-
public List<AuditEvent> getAuditEvents(Date created_after, Date created_before, String entityType, Long entityId)
35+
public List<AuditEvent> getAuditEvents(Date createdAfter, Date createdBefore, String entityType, Long entityId)
3636
throws GitLabApiException {
37-
return (getAuditEvents(created_after, created_before, entityType, entityId, getDefaultPerPage())
37+
return (getAuditEvents(createdAfter, createdBefore, entityType, entityId, getDefaultPerPage())
3838
.all());
3939
}
4040

@@ -43,20 +43,20 @@ public List<AuditEvent> getAuditEvents(Date created_after, Date created_before,
4343
*
4444
* <pre><code>GET /audit_events</code></pre>
4545
*
46-
* @param created_after Return group audit events created on or after the given time.
47-
* @param created_before Return group audit events created on or before the given time.
46+
* @param createdAfter Return group audit events created on or after the given time.
47+
* @param createdBefore Return group audit events created on or before the given time.
4848
* @param entityType Return audit events for the given entity type. Valid values are: User, Group, or Project.
4949
* @param entityId Return audit events for the given entity ID. Requires entityType attribute to be present.
5050
* @param itemsPerPage the number of Audit Event instances that will be fetched per page
5151
* @return a Pager of group Audit events
5252
* @throws GitLabApiException if any exception occurs
5353
*/
5454
public Pager<AuditEvent> getAuditEvents(
55-
Date created_after, Date created_before, String entityType, Long entityId, int itemsPerPage)
55+
Date createdAfter, Date createdBefore, String entityType, Long entityId, int itemsPerPage)
5656
throws GitLabApiException {
5757
Form form = new GitLabApiForm()
58-
.withParam("created_before", ISO8601.toString(created_before, false))
59-
.withParam("created_after", ISO8601.toString(created_after, false))
58+
.withParam("created_after", ISO8601.toString(createdAfter, false))
59+
.withParam("created_before", ISO8601.toString(createdBefore, false))
6060
.withParam("entity_type", entityType)
6161
.withParam("entity_id", entityId);
6262
return (new Pager<AuditEvent>(this, AuditEvent.class, itemsPerPage, form.asMap(), "audit_events"));

gitlab4j-api/src/main/java/org/gitlab4j/api/GroupApi.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,14 +1768,14 @@ public Project transferProject(Object groupIdOrPath, Object projectIdOrPath) thr
17681768
* <pre><code>GET /groups/:id/audit_events</code></pre>
17691769
*
17701770
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
1771-
* @param created_after Group audit events created on or after the given time.
1772-
* @param created_before Group audit events created on or before the given time.
1771+
* @param createdAfter Group audit events created on or after the given time.
1772+
* @param createdBefore Group audit events created on or before the given time.
17731773
* @return a List of group Audit events
17741774
* @throws GitLabApiException if any exception occurs
17751775
*/
1776-
public List<AuditEvent> getAuditEvents(Object groupIdOrPath, Date created_after, Date created_before)
1776+
public List<AuditEvent> getAuditEvents(Object groupIdOrPath, Date createdAfter, Date createdBefore)
17771777
throws GitLabApiException {
1778-
return (getAuditEvents(groupIdOrPath, created_after, created_before, getDefaultPerPage())
1778+
return (getAuditEvents(groupIdOrPath, createdAfter, createdBefore, getDefaultPerPage())
17791779
.all());
17801780
}
17811781

@@ -1785,17 +1785,18 @@ public List<AuditEvent> getAuditEvents(Object groupIdOrPath, Date created_after,
17851785
* <pre><code>GET /groups/:id/audit_events</code></pre>
17861786
*
17871787
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
1788-
* @param created_after Group audit events created on or after the given time.
1789-
* @param created_before Group audit events created on or before the given time.
1788+
* @param createdAfter Group audit events created on or after the given time.
1789+
* @param createdBefore Group audit events created on or before the given time.
17901790
* @param itemsPerPage the number of Audit Event instances that will be fetched per page
17911791
* @return a Pager of group Audit events
17921792
* @throws GitLabApiException if any exception occurs
17931793
*/
17941794
public Pager<AuditEvent> getAuditEvents(
1795-
Object groupIdOrPath, Date created_after, Date created_before, int itemsPerPage) throws GitLabApiException {
1795+
Object groupIdOrPath, Date createdAfter, Date createdBefore, int itemsPerPage) throws GitLabApiException {
17961796
Form form = new GitLabApiForm()
1797-
.withParam("created_before", ISO8601.toString(created_after, false))
1798-
.withParam("created_after", ISO8601.toString(created_before, false));
1797+
.withParam("created_after", ISO8601.toString(createdAfter, false))
1798+
.withParam("created_before", ISO8601.toString(createdBefore, false));
1799+
17991800
return (new Pager<AuditEvent>(
18001801
this,
18011802
AuditEvent.class,
@@ -1812,14 +1813,14 @@ public Pager<AuditEvent> getAuditEvents(
18121813
* <pre><code>GET /groups/:id/audit_events</code></pre>
18131814
*
18141815
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
1815-
* @param created_after Group audit events created on or after the given time.
1816-
* @param created_before Group audit events created on or before the given time.
1816+
* @param createdAfter Group audit events created on or after the given time.
1817+
* @param createdBefore Group audit events created on or before the given time.
18171818
* @return a Stream of group Audit events
18181819
* @throws GitLabApiException if any exception occurs
18191820
*/
1820-
public Stream<AuditEvent> getAuditEventsStream(Object groupIdOrPath, Date created_after, Date created_before)
1821+
public Stream<AuditEvent> getAuditEventsStream(Object groupIdOrPath, Date createdAfter, Date createdBefore)
18211822
throws GitLabApiException {
1822-
return (getAuditEvents(groupIdOrPath, created_after, created_before, getDefaultPerPage()).stream());
1823+
return (getAuditEvents(groupIdOrPath, createdAfter, createdBefore, getDefaultPerPage()).stream());
18231824
}
18241825

18251826
/**

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

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,14 +3424,14 @@ public Project setProjectAvatar(Object projectIdOrPath, File avatarFile) throws
34243424
* <pre><code>GET /projects/:id/audit_events</code></pre>
34253425
*
34263426
* @param projectIdOrPath the project ID, path of the project, or a project instance holding the project ID or path
3427-
* @param created_after Project audit events created on or after the given time.
3428-
* @param created_before Project audit events created on or before the given time.
3427+
* @param createdAfter Project audit events created on or after the given time.
3428+
* @param createdBefore Project audit events created on or before the given time.
34293429
* @return a List of project Audit events
34303430
* @throws GitLabApiException if any exception occurs
34313431
*/
3432-
public List<AuditEvent> getAuditEvents(Object projectIdOrPath, Date created_after, Date created_before)
3432+
public List<AuditEvent> getAuditEvents(Object projectIdOrPath, Date createdAfter, Date createdBefore)
34333433
throws GitLabApiException {
3434-
return (getAuditEvents(projectIdOrPath, created_after, created_before, getDefaultPerPage())
3434+
return (getAuditEvents(projectIdOrPath, createdAfter, createdBefore, getDefaultPerPage())
34353435
.all());
34363436
}
34373437

@@ -3441,18 +3441,17 @@ public List<AuditEvent> getAuditEvents(Object projectIdOrPath, Date created_afte
34413441
* <pre><code>GET /projects/:id/audit_events</code></pre>
34423442
*
34433443
* @param projectIdOrPath the project ID, path of the project, or a Project instance holding the project ID or path
3444-
* @param created_after Project audit events created on or after the given time.
3445-
* @param created_before Project audit events created on or before the given time.
3444+
* @param createdAfter Project audit events created on or after the given time.
3445+
* @param createdBefore Project audit events created on or before the given time.
34463446
* @param itemsPerPage the number of Audit Event instances that will be fetched per page
34473447
* @return a Pager of project Audit events
34483448
* @throws GitLabApiException if any exception occurs
34493449
*/
34503450
public Pager<AuditEvent> getAuditEvents(
3451-
Object projectIdOrPath, Date created_after, Date created_before, int itemsPerPage)
3452-
throws GitLabApiException {
3451+
Object projectIdOrPath, Date createdAfter, Date createdBefore, int itemsPerPage) throws GitLabApiException {
34533452
Form form = new GitLabApiForm()
3454-
.withParam("created_before", ISO8601.toString(created_before, false))
3455-
.withParam("created_after", ISO8601.toString(created_after, false));
3453+
.withParam("created_after", ISO8601.toString(createdAfter, false))
3454+
.withParam("created_before", ISO8601.toString(createdBefore, false));
34563455
return (new Pager<AuditEvent>(
34573456
this,
34583457
AuditEvent.class,
@@ -3469,14 +3468,14 @@ public Pager<AuditEvent> getAuditEvents(
34693468
* <pre><code>GET /projects/:id/audit_events</code></pre>
34703469
*
34713470
* @param projectIdOrPath the project ID, path of the project, or a Project instance holding the project ID or path
3472-
* @param created_after Project audit events created on or after the given time.
3473-
* @param created_before Project audit events created on or before the given time.
3471+
* @param createdAfter Project audit events created on or after the given time.
3472+
* @param createdBefore Project audit events created on or before the given time.
34743473
* @return a Stream of project Audit events
34753474
* @throws GitLabApiException if any exception occurs
34763475
*/
3477-
public Stream<AuditEvent> getAuditEventsStream(Object projectIdOrPath, Date created_after, Date created_before)
3476+
public Stream<AuditEvent> getAuditEventsStream(Object projectIdOrPath, Date createdAfter, Date createdBefore)
34783477
throws GitLabApiException {
3479-
return (getAuditEvents(projectIdOrPath, created_after, created_before, getDefaultPerPage()).stream());
3478+
return (getAuditEvents(projectIdOrPath, createdAfter, createdBefore, getDefaultPerPage()).stream());
34803479
}
34813480

34823481
/**

0 commit comments

Comments
 (0)