1
1
package org .gitlab4j .api .models ;
2
2
3
+ import java .util .Date ;
4
+
5
+ import org .gitlab4j .api .Constants ;
3
6
import org .gitlab4j .api .Constants .ProjectOrderBy ;
4
7
import org .gitlab4j .api .Constants .SortOrder ;
5
- import org .gitlab4j .api .Constants ;
6
8
import org .gitlab4j .api .GitLabApiForm ;
7
9
8
10
/**
@@ -15,6 +17,7 @@ public class ProjectFilter {
15
17
private ProjectOrderBy orderBy ;
16
18
private SortOrder sort ;
17
19
private String search ;
20
+ private Boolean searchNamespaces ;
18
21
private Boolean simple ;
19
22
private Boolean owned ;
20
23
private Boolean membership ;
@@ -27,6 +30,11 @@ public class ProjectFilter {
27
30
private Boolean wikiChecksumFailed ;
28
31
private Boolean repositoryChecksumFailed ;
29
32
private AccessLevel minAccessLevel ;
33
+ private Integer idAfter ;
34
+ private Integer idBefore ;
35
+ private Date lastActivityAfter ;
36
+ private Date lastActivityBefore ;
37
+ private String repositoryStorage ;
30
38
31
39
/**
32
40
* Limit by archived status.
@@ -83,6 +91,17 @@ public ProjectFilter withSearch(String search) {
83
91
return (this );
84
92
}
85
93
94
+ /**
95
+ * Include ancestor namespaces when matching search criteria. Default is false.
96
+ *
97
+ * @param searchNamespaces if true, include ancestor namespaces when matching search criteria
98
+ * @return the reference to this ProjectFilter instance
99
+ */
100
+ public ProjectFilter withSearchNamespaces (Boolean searchNamespaces ) {
101
+ this .searchNamespaces = searchNamespaces ;
102
+ return (this );
103
+ }
104
+
86
105
/**
87
106
* Return only limited fields for each project. This is a no-op without
88
107
* authentication as then only simple fields are returned.
@@ -220,7 +239,7 @@ public ProjectFilter minAccessLevel(AccessLevel minAccessLevel) {
220
239
}
221
240
222
241
/**
223
- * Limit by current user minimal access level
242
+ * Limit by current user minimal access level.
224
243
*
225
244
* @param minAccessLevel limit by current user minimal access level
226
245
* @return the reference to this ProjectFilter instance
@@ -230,6 +249,61 @@ public ProjectFilter withMinAccessLevel(AccessLevel minAccessLevel) {
230
249
return (this );
231
250
}
232
251
252
+ /**
253
+ * Limit results to projects with IDs greater than the specified projectID.
254
+ *
255
+ * @param idAfter limit results to projects with IDs greater than the specified project ID
256
+ * @return the reference to this ProjectFilter instance
257
+ */
258
+ public ProjectFilter withIdAfter (Integer idAfter ) {
259
+ this .idAfter = idAfter ;
260
+ return (this );
261
+ }
262
+
263
+ /**
264
+ * Limit results to projects with IDs less than the specified project ID.
265
+ *
266
+ * @param idBefore limit results to projects with IDs less than the specified project ID
267
+ * @return the reference to this ProjectFilter instance
268
+ */
269
+ public ProjectFilter withIdBefore (Integer idBefore ) {
270
+ this .idBefore = idBefore ;
271
+ return (this );
272
+ }
273
+
274
+ /**
275
+ * Limit results to projects with last_activity after specified time.
276
+ *
277
+ * @param lastActivityAfter limit results to projects with last_activity after specified time
278
+ * @return the reference to this ProjectFilter instance
279
+ */
280
+ public ProjectFilter withLastActivityAfter (Date lastActivityAfter ) {
281
+ this .lastActivityAfter = lastActivityAfter ;
282
+ return (this );
283
+ }
284
+
285
+ /**
286
+ * Limit results to projects with last_activity before specified time.
287
+ *
288
+ * @param lastActivityBefore limit results to projects with last_activity before specified time
289
+ * @return the reference to this ProjectFilter instance
290
+ */
291
+ public ProjectFilter withLastActivityBefore (Date lastActivityBefore ) {
292
+ this .lastActivityBefore = lastActivityBefore ;
293
+ return (this );
294
+ }
295
+
296
+ /**
297
+ * Limit results to projects stored on the specified repository_storage. Available for admins only.
298
+ *
299
+ * @param repositoryStorage limit results to projects stored on repository_storage
300
+ * @return the reference to this ProjectFilter instance
301
+ */
302
+ public ProjectFilter withRepositoryStorage (String repositoryStorage ) {
303
+ this .repositoryStorage = repositoryStorage ;
304
+ return (this );
305
+ }
306
+
233
307
/**
234
308
* Get the query params specified by this filter.
235
309
*
@@ -255,18 +329,24 @@ public GitLabApiForm getQueryParams() {
255
329
.withParam ("order_by" , orderBy )
256
330
.withParam ("sort" , sort )
257
331
.withParam ("search" , search )
332
+ .withParam ("search_namespaces" , searchNamespaces )
258
333
.withParam ("simple" , simple )
259
334
.withParam ("owned" , owned )
260
335
.withParam ("membership" , membership )
261
336
.withParam ("starred" , starred )
262
337
.withParam ("statistics" , statistics )
263
338
.withParam ("with_custom_attributes" , withCustomAttributes )
264
339
.withParam ("with_issues_enabled" , withIssuesEnabled )
265
- .withParam ("with_merge_requests_enabled " , withMergeRequestsEnabled ) )
340
+ .withParam ("with_merge_requests_enabled" , withMergeRequestsEnabled )
266
341
.withParam ("with_programming_language" , withProgrammingLanguage )
267
342
.withParam ("wiki_checksum_failed" , wikiChecksumFailed )
268
343
.withParam ("repository_checksum_failed" , repositoryChecksumFailed )
269
- .withParam ("min_access_level" , (minAccessLevel != null ? minAccessLevel .toValue () : null )
344
+ .withParam ("min_access_level" , (minAccessLevel != null ? minAccessLevel .toValue () : null ))
345
+ .withParam ("id_after" , idAfter )
346
+ .withParam ("id_before" , idBefore )
347
+ .withParam ("last_activity_after" , lastActivityAfter )
348
+ .withParam ("last_activity_before" , lastActivityBefore )
349
+ .withParam ("repository_storage" , repositoryStorage )
270
350
);
271
351
}
272
352
}
0 commit comments