|
54 | 54 | import org.gitlab4j.api.models.ProjectApprovalsConfig;
|
55 | 55 | import org.gitlab4j.api.models.ProjectFetches;
|
56 | 56 | import org.gitlab4j.api.models.ProjectFilter;
|
| 57 | +import org.gitlab4j.api.models.ProjectGroupsFilter; |
| 58 | +import org.gitlab4j.api.models.ProjectGroup; |
57 | 59 | import org.gitlab4j.api.models.ProjectHook;
|
58 | 60 | import org.gitlab4j.api.models.ProjectUser;
|
59 | 61 | import org.gitlab4j.api.models.PushRules;
|
@@ -1624,7 +1626,7 @@ public Stream<Member> getAllMembersStream(Object projectIdOrPath, String query,
|
1624 | 1626 | * @throws GitLabApiException if any exception occurs
|
1625 | 1627 | */
|
1626 | 1628 | public Member getMember(Object projectIdOrPath, Long userId) throws GitLabApiException {
|
1627 |
| - return (getMember(projectIdOrPath, userId, false)); |
| 1629 | + return (getMember(projectIdOrPath, userId, false)); |
1628 | 1630 | }
|
1629 | 1631 |
|
1630 | 1632 | /**
|
@@ -1926,6 +1928,90 @@ public Stream<ProjectUser> getProjectUsersStream(Object projectIdOrPath, String
|
1926 | 1928 | return (getProjectUsers(projectIdOrPath, search, getDefaultPerPage()).stream());
|
1927 | 1929 | }
|
1928 | 1930 |
|
| 1931 | + /** |
| 1932 | + * Get a list of the ancestor groups for a given project. |
| 1933 | + * |
| 1934 | + * <pre><code>GitLab Endpoint: GET /projects/:id/groups</code></pre> |
| 1935 | + * |
| 1936 | + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required |
| 1937 | + * @return the ancestor groups for a given project |
| 1938 | + * @throws GitLabApiException if any exception occurs |
| 1939 | + */ |
| 1940 | + public List<ProjectGroup> getProjectGroups(Object projectIdOrPath) throws GitLabApiException { |
| 1941 | + return (getProjectGroups(projectIdOrPath, new ProjectGroupsFilter(), getDefaultPerPage()).all()); |
| 1942 | + } |
| 1943 | + |
| 1944 | + /** |
| 1945 | + * Get a Pager of the ancestor groups for a given project. |
| 1946 | + * |
| 1947 | + * <pre><code>GitLab Endpoint: GET /projects/:id/groups</code></pre> |
| 1948 | + * |
| 1949 | + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance |
| 1950 | + * @param itemsPerPage the number of Project instances that will be fetched per page |
| 1951 | + * @return a Pager of the ancestor groups for a given project |
| 1952 | + * @throws GitLabApiException if any exception occurs |
| 1953 | + */ |
| 1954 | + public Pager<ProjectGroup> getProjectGroups(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException { |
| 1955 | + return (getProjectGroups(projectIdOrPath, new ProjectGroupsFilter(), itemsPerPage)); |
| 1956 | + } |
| 1957 | + |
| 1958 | + /** |
| 1959 | + * Get a Stream of the ancestor groups for a given project. |
| 1960 | + * |
| 1961 | + * <pre><code>GitLab Endpoint: GET /projects/:id/groups</code></pre> |
| 1962 | + * |
| 1963 | + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required |
| 1964 | + * @return a Stream of the ancestor groups for a given project |
| 1965 | + * @throws GitLabApiException if any exception occurs |
| 1966 | + */ |
| 1967 | + public Stream<ProjectGroup> getProjectGroupsStream(Object projectIdOrPath) throws GitLabApiException { |
| 1968 | + return (getProjectGroups(projectIdOrPath, new ProjectGroupsFilter(), getDefaultPerPage()).stream()); |
| 1969 | + } |
| 1970 | + |
| 1971 | + /** |
| 1972 | + * Get a list of the ancestor groups for a given project matching the specified filter. |
| 1973 | + * |
| 1974 | + * <pre><code>GitLab Endpoint: GET /projects/:id/groups</code></pre> |
| 1975 | + * |
| 1976 | + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required |
| 1977 | + * @param filter the ProjectGroupsFilter to match against |
| 1978 | + * @return the ancestor groups for a given project |
| 1979 | + * @throws GitLabApiException if any exception occurs |
| 1980 | + */ |
| 1981 | + public List<ProjectGroup> getProjectGroups(Object projectIdOrPath, ProjectGroupsFilter filter) throws GitLabApiException { |
| 1982 | + return (getProjectGroups(projectIdOrPath, filter, getDefaultPerPage()).all()); |
| 1983 | + } |
| 1984 | + |
| 1985 | + /** |
| 1986 | + * Get a Pager of the ancestor groups for a given project matching the specified filter. |
| 1987 | + * |
| 1988 | + * <pre><code>GitLab Endpoint: GET /projects/:id/groups</code></pre> |
| 1989 | + * |
| 1990 | + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance |
| 1991 | + * @param filter the ProjectGroupsFilter to match against |
| 1992 | + * @param itemsPerPage the number of Project instances that will be fetched per page |
| 1993 | + * @return a Pager of the ancestor groups for a given project |
| 1994 | + * @throws GitLabApiException if any exception occurs |
| 1995 | + */ |
| 1996 | + public Pager<ProjectGroup> getProjectGroups(Object projectIdOrPath, ProjectGroupsFilter filter, int itemsPerPage) throws GitLabApiException { |
| 1997 | + GitLabApiForm formData = filter.getQueryParams(); |
| 1998 | + return (new Pager<ProjectGroup>(this, ProjectGroup.class, itemsPerPage, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "groups")); |
| 1999 | + } |
| 2000 | + |
| 2001 | + /** |
| 2002 | + * Get a Stream of the ancestor groups for a given project matching the specified filter. |
| 2003 | + * |
| 2004 | + * <pre><code>GitLab Endpoint: GET /projects/:id/groups</code></pre> |
| 2005 | + * |
| 2006 | + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required |
| 2007 | + * @param filter the ProjectGroupsFilter to match against |
| 2008 | + * @return a Stream of the ancestor groups for a given project |
| 2009 | + * @throws GitLabApiException if any exception occurs |
| 2010 | + */ |
| 2011 | + public Stream<ProjectGroup> getProjectGroupsStream(Object projectIdOrPath, ProjectGroupsFilter filter) throws GitLabApiException { |
| 2012 | + return (getProjectGroups(projectIdOrPath, filter, getDefaultPerPage()).stream()); |
| 2013 | + } |
| 2014 | + |
1929 | 2015 | /**
|
1930 | 2016 | * Get the project events for specific project. Sorted from newest to latest.
|
1931 | 2017 | *
|
|
0 commit comments