-
Notifications
You must be signed in to change notification settings - Fork 486
feat: added methods for Endpoint "/groups/:id/groups/shared" #1290
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
Open
ysemko
wants to merge
7
commits into
gitlab4j:main
Choose a base branch
from
ysemko:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
453a1ab
feat: added methods for Endpoint "/groups/:id/groups/shared"
ysemko c4c5777
fix: linitmh errors
ysemko ed101a7
fix: added missing Methods
abc862e
fix: wrong object
f8f81bb
fix: linting
ysemko e7d0fc1
fix: fixed wrong JavaDoc
ysemko e022d41
Merge branch 'gitlab4j:main' into main
ysemko 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
122 changes: 122 additions & 0 deletions
122
gitlab4j-models/src/main/java/org/gitlab4j/api/models/SharedGroupsFilter.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,122 @@ | ||
package org.gitlab4j.api.models; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
import org.gitlab4j.models.Constants.GroupOrderBy; | ||
import org.gitlab4j.models.Constants.SortOrder; | ||
import org.gitlab4j.models.GitLabForm; | ||
import org.gitlab4j.models.utils.JacksonJson; | ||
|
||
/** | ||
* This class is used to filter Groups when getting lists of groups for a specified group where it has been invited. | ||
*/ | ||
public class SharedGroupsFilter implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private List<Long> skipGroups; | ||
private String search; | ||
private GroupOrderBy orderBy; | ||
private SortOrder sort; | ||
private Visibility visibility; | ||
private AccessLevel minAccessLevel; | ||
private Boolean withCustomAttributes; | ||
|
||
/** | ||
* Do not include the provided groups IDs. | ||
* | ||
* @param skipGroups List of group IDs to not include in the search | ||
* @return the reference to this SharedGroupsFilter instance | ||
*/ | ||
public SharedGroupsFilter withSkipGroups(List<Long> skipGroups) { | ||
this.skipGroups = skipGroups; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Return list of groups matching the search criteria. | ||
* | ||
* @param search the search criteria | ||
* @return the reference to this SharedGroupsFilter instance | ||
*/ | ||
public SharedGroupsFilter withSearch(String search) { | ||
this.search = search; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Return groups ordered by name, path, id, or similarity. Default is name. | ||
* | ||
* @param orderBy specifies what field to order by | ||
* @return the reference to this SharedGroupsFilter instance | ||
*/ | ||
public SharedGroupsFilter withOrderBy(GroupOrderBy orderBy) { | ||
this.orderBy = orderBy; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Return groups sorted in asc or desc order. Default is desc. | ||
* | ||
* @param sort sort direction, ASC or DESC | ||
* @return the reference to this SharedGroupsFilter instance | ||
*/ | ||
public SharedGroupsFilter withSortOder(SortOrder sort) { | ||
this.sort = sort; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Limit by visibility public, internal, or private. | ||
* | ||
* @param visibility the visibility to match | ||
* @return the reference to this SharedGroupsFilter instance | ||
*/ | ||
public SharedGroupsFilter withVisibility(Visibility visibility) { | ||
this.visibility = visibility; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Limit to groups where current user has at least the specified role (access_level). | ||
* | ||
* @param minAccessLevel the minimum access level to match | ||
* @return the reference to this SharedGroupsFilter instance | ||
*/ | ||
public SharedGroupsFilter withMinAccessLevel(AccessLevel minAccessLevel) { | ||
this.minAccessLevel = minAccessLevel; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Include custom attributes in response (admins only). | ||
* | ||
* @param withCustomAttributes if true, include custom attributes in the repsonse | ||
* @return the reference to this SharedGroupsFilter instance | ||
*/ | ||
public SharedGroupsFilter withCustomAttributes(Boolean withCustomAttributes) { | ||
this.withCustomAttributes = withCustomAttributes; | ||
return (this); | ||
} | ||
|
||
/** | ||
* Get the query params specified by this filter. | ||
* | ||
* @return a GitLabApiForm instance holding the query parameters for this SharedGroupsFilter instance | ||
*/ | ||
public GitLabForm getQueryParams() { | ||
return (new GitLabForm() | ||
.withParam("skip_groups", skipGroups) | ||
.withParam("search", search) | ||
.withParam("order_by", orderBy) | ||
.withParam("sort", sort) | ||
.withParam("visibility", visibility) | ||
.withParam("simple", minAccessLevel) | ||
.withParam("with_custom_attributes", withCustomAttributes)); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return (JacksonJson.toJsonString(this)); | ||
} | ||
} |
Oops, something went wrong.
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.