-
Notifications
You must be signed in to change notification settings - Fork 475
Add all parameters to get project of group api #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gmessner
merged 8 commits into
gitlab4j:master
from
knowis:add-all-parameters-to-get-project-of-group-api
Nov 8, 2018
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7feed39
Merge pull request #1 from gmessner/master
mdeknowis 0b7ebd0
Add all parameters listed by
mdeknowis e6c29d5
Remove redudant enum
mdeknowis 495358c
Merge pull request #2 from gmessner/master
mdeknowis 02f0834
Merge remote-tracking branch 'origin/master' into add-all-parameters-…
mdeknowis 8c41be2
Use filter pattern for wide APIs
mdeknowis 6fbedf7
Adjust javadoc to API
mdeknowis 25644d4
Use groupIdOrPath approach instead of primitive int value
mdeknowis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 167 additions & 0 deletions
167
src/main/java/org/gitlab4j/api/models/ProjectOfGroupFilter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
package org.gitlab4j.api.models; | ||
|
||
import org.gitlab4j.api.Constants.ProjectOrderBy; | ||
import org.gitlab4j.api.Constants.SortOrder; | ||
import org.gitlab4j.api.Constants; | ||
import org.gitlab4j.api.GitLabApiForm; | ||
|
||
/** | ||
* This class is used to filter Projects when getting lists of projects for a specified group. | ||
*/ | ||
public class ProjectOfGroupFilter { | ||
|
||
private Boolean archived; | ||
private Visibility visibility; | ||
private ProjectOrderBy orderBy; | ||
private SortOrder sort; | ||
private String search; | ||
private Boolean simple; | ||
private Boolean owned; | ||
private Boolean starred; | ||
private Boolean withCustomAttributes; | ||
private Boolean withIssuesEnabled; | ||
private Boolean withMergeRequestsEnabled; | ||
|
||
/** | ||
* Limit by archived status. | ||
* | ||
* @param archived if true will only return archived projects | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withArchived(Boolean archived) { | ||
this.archived = archived; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Limit by visibility public, internal, or private. | ||
* | ||
* @param visibility the visibility to match | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withVisibility(Visibility visibility) { | ||
this.visibility = visibility; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields. Default is created_at. | ||
* | ||
* @param orderBy specifies what field to order by | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withOrderBy(ProjectOrderBy orderBy) { | ||
this.orderBy = orderBy; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Return projects sorted in asc or desc order. Default is desc. | ||
* | ||
* @param sort sort direction, ASC or DESC | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withSortOder(SortOrder sort) { | ||
this.sort = sort; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Return list of projects matching the search criteria. | ||
* | ||
* @param search the search criteria | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withSearch(String search) { | ||
this.search = search; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Return only limited fields for each project. This is a no-op without | ||
* authentication as then only simple fields are returned. | ||
* | ||
* @param simple if true, return only limited fields for each project | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withSimple(Boolean simple) { | ||
this.simple = simple; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Limit by projects explicitly owned by the current user | ||
* | ||
* @param owned if true, limit to projects explicitly owned by the current user | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withOwned(Boolean owned) { | ||
this.owned = owned; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Limit by projects starred by the current user. | ||
* | ||
* @param starred if true, limit by projects starred by the current user | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withStarred(Boolean starred) { | ||
this.starred = starred; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Include custom attributes in response (admins only). | ||
* | ||
* @param withCustomAttributes if true, include custom attributes in the repsonse | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withCustomAttributes(Boolean withCustomAttributes) { | ||
this.withCustomAttributes = withCustomAttributes; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Limit by enabled issues feature | ||
* | ||
* @param withIssuesEnabled if true, limit by enabled issues feature | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withIssuesEnabled(Boolean withIssuesEnabled) { | ||
this.withIssuesEnabled = withIssuesEnabled; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Limit by enabled merge requests feature | ||
* | ||
* @param withMergeRequestsEnabled if true, imit by enabled merge requests feature | ||
* @return the reference to this ProjectFilter instance | ||
*/ | ||
public ProjectOfGroupFilter withMergeRequestsEnabled(Boolean withMergeRequestsEnabled) { | ||
this.withMergeRequestsEnabled = withMergeRequestsEnabled; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Get the query params specified by this filter. | ||
* | ||
* @return a GitLabApiForm instance holding the query parameters for this ProjectFilter instance | ||
*/ | ||
public GitLabApiForm getQueryParams() { | ||
return (new GitLabApiForm() | ||
.withParam("archived", archived) | ||
.withParam("visibility", visibility) | ||
.withParam("order_by", orderBy) | ||
.withParam("sort", sort) | ||
.withParam("search", search) | ||
.withParam("simple", simple) | ||
.withParam("owned", owned) | ||
.withParam("starred", starred) | ||
.withParam("with_custom_attributes", withCustomAttributes) | ||
.withParam("with_issues_enabled", withIssuesEnabled) | ||
.withParam("with_merge_requests_enabled ", withMergeRequestsEnabled) | ||
); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.