Commit 83233b5d authored by Jeremie Bresson's avatar Jeremie Bresson
Browse files

Merge remote-tracking branch 'origin/main' into 6.x

parents 046172f3 a3ab79b2
......@@ -22,6 +22,7 @@ import org.gitlab4j.api.models.Group;
import org.gitlab4j.api.models.GroupFilter;
import org.gitlab4j.api.models.GroupParams;
import org.gitlab4j.api.models.GroupProjectsFilter;
import org.gitlab4j.api.models.LdapGroupLink;
import org.gitlab4j.api.models.Member;
import org.gitlab4j.api.models.Project;
import org.gitlab4j.api.models.Variable;
......@@ -1177,6 +1178,20 @@ public class GroupApi extends AbstractApi {
post(Response.Status.NO_CONTENT, (Form)null, "groups", getGroupIdOrPath(groupIdOrPath), "ldap_sync");
}
/**
* Get the list of LDAP group links.
*
* <pre><code>GitLab Endpoint: GET /groups/:id/ldap_group_links</code></pre>
*
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
* @return a list of LDAP group links
* @throws GitLabApiException if any exception occurs
*/
public List<LdapGroupLink> getLdapGroupLinks(Object groupIdOrPath) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "groups", getGroupIdOrPath(groupIdOrPath), "ldap_group_links");
return (response.readEntity(new GenericType<List<LdapGroupLink>>() {}));
}
/**
* Adds an LDAP group link.
*
......
package org.gitlab4j.api.models;
import org.gitlab4j.api.utils.JacksonJson;
public class LdapGroupLink {
private String cn;
private AccessLevel groupAccess;
private String provider;
private String filter;
public String getCn() {
return cn;
}
public void setCn(String aCn) {
cn = aCn;
}
public AccessLevel getGroupAccess() {
return groupAccess;
}
public void setGroupAccess(AccessLevel aGroupAccess) {
groupAccess = aGroupAccess;
}
public String getProvider() {
return provider;
}
public void setProvider(String aProvider) {
provider = aProvider;
}
public String getFilter() {
return filter;
}
public void setFilter(String aFilter) {
filter = aFilter;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -81,6 +81,7 @@ import org.gitlab4j.api.models.Job;
import org.gitlab4j.api.models.Key;
import org.gitlab4j.api.models.Label;
import org.gitlab4j.api.models.LabelEvent;
import org.gitlab4j.api.models.LdapGroupLink;
import org.gitlab4j.api.models.Link;
import org.gitlab4j.api.models.LinkedIssue;
import org.gitlab4j.api.models.Member;
......@@ -779,6 +780,12 @@ public class TestGitLabApiBeans {
assertTrue(compareJson(labels, "labels.json"));
}
@Test
public void testLdapGroupLink() throws Exception {
LdapGroupLink link = unmarshalResource(LdapGroupLink.class, "ldap-group-link.json");
assertTrue(compareJson(link, "ldap-group-link.json"));
}
@Test
public void testSearchBlobs() throws Exception {
List<SearchBlob> searchResults = unmarshalResourceList(SearchBlob.class, "wiki-blobs.json");
......
{
"cn": "My Group",
"group_access": 30,
"provider": "tertiary",
"filter": "(employeeType=developer)"
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment