Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
83233b5d
Commit
83233b5d
authored
Aug 16, 2023
by
Jeremie Bresson
Browse files
Merge remote-tracking branch 'origin/main' into 6.x
parents
046172f3
a3ab79b2
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GroupApi.java
View file @
83233b5d
...
...
@@ -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.
*
...
...
src/main/java/org/gitlab4j/api/models/LdapGroupLink.java
0 → 100644
View file @
83233b5d
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
));
}
}
src/test/java/org/gitlab4j/api/TestGitLabApiBeans.java
View file @
83233b5d
...
...
@@ -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"
);
...
...
src/test/resources/org/gitlab4j/api/ldap-group-link.json
0 → 100644
View file @
83233b5d
{
"cn"
:
"My Group"
,
"group_access"
:
30
,
"provider"
:
"tertiary"
,
"filter"
:
"(employeeType=developer)"
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment