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
f2fe6932
Unverified
Commit
f2fe6932
authored
Nov 16, 2023
by
Jérémie Bresson
Committed by
GitHub
Nov 16, 2023
Browse files
Add "sharedWithGroups" to Group (#1057)
Fixes
https://github.com/gitlab4j/gitlab4j-api/issues/1053
parent
5890189f
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/Group.java
View file @
f2fe6932
...
...
@@ -60,6 +60,7 @@ public class Group extends AbstractGroup<Group> {
private
List
<
Project
>
projects
;
private
List
<
Project
>
sharedProjects
;
private
Date
createdAt
;
private
List
<
SharedGroup
>
sharedWithGroups
;
private
String
runnersToken
;
@JsonSerialize
(
using
=
JacksonJson
.
DateOnlySerializer
.
class
)
...
...
@@ -161,6 +162,14 @@ public class Group extends AbstractGroup<Group> {
this
.
createdAt
=
createdAt
;
}
public
List
<
SharedGroup
>
getSharedWithGroups
()
{
return
sharedWithGroups
;
}
public
void
setSharedWithGroups
(
List
<
SharedGroup
>
sharedWithGroups
)
{
this
.
sharedWithGroups
=
sharedWithGroups
;
}
public
String
getRunnersToken
()
{
return
runnersToken
;
}
...
...
src/main/java/org/gitlab4j/api/models/ProjectSharedGroup.java
View file @
f2fe6932
package
org.gitlab4j.api.models
;
import
org.gitlab4j.api.utils.JacksonJson
;
public
class
ProjectSharedGroup
{
private
Long
groupId
;
private
String
groupName
;
private
String
groupFullPath
;
private
AccessLevel
groupAccessLevel
;
public
long
getGroupId
()
{
return
groupId
;
}
public
void
setGroupId
(
long
groupId
)
{
this
.
groupId
=
groupId
;
}
public
String
getGroupName
()
{
return
groupName
;
}
public
void
setGroupName
(
String
groupName
)
{
this
.
groupName
=
groupName
;
}
public
AccessLevel
getGroupAccessLevel
()
{
return
(
groupAccessLevel
);
}
public
void
setGroupAccessLevel
(
AccessLevel
accessLevel
)
{
this
.
groupAccessLevel
=
accessLevel
;
}
public
String
getGroupFullPath
()
{
return
groupFullPath
;
}
public
void
setGroupFullPath
(
String
groupFullPath
)
{
this
.
groupFullPath
=
groupFullPath
;
}
@Override
public
String
toString
()
{
return
(
JacksonJson
.
toJsonString
(
this
));
}
/**
* @deprecated use {@link SharedGroup} instead
*/
@Deprecated
public
class
ProjectSharedGroup
extends
SharedGroup
{
}
src/main/java/org/gitlab4j/api/models/SharedGroup.java
0 → 100644
View file @
f2fe6932
package
org.gitlab4j.api.models
;
import
java.util.Date
;
import
org.gitlab4j.api.utils.JacksonJson
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
public
class
SharedGroup
{
private
Long
groupId
;
private
String
groupName
;
private
String
groupFullPath
;
private
AccessLevel
groupAccessLevel
;
@JsonSerialize
(
using
=
JacksonJson
.
DateOnlySerializer
.
class
)
private
Date
expiresAt
;
public
long
getGroupId
()
{
return
groupId
;
}
public
void
setGroupId
(
long
groupId
)
{
this
.
groupId
=
groupId
;
}
public
String
getGroupName
()
{
return
groupName
;
}
public
void
setGroupName
(
String
groupName
)
{
this
.
groupName
=
groupName
;
}
public
AccessLevel
getGroupAccessLevel
()
{
return
(
groupAccessLevel
);
}
public
void
setGroupAccessLevel
(
AccessLevel
accessLevel
)
{
this
.
groupAccessLevel
=
accessLevel
;
}
public
String
getGroupFullPath
()
{
return
groupFullPath
;
}
public
void
setGroupFullPath
(
String
groupFullPath
)
{
this
.
groupFullPath
=
groupFullPath
;
}
public
Date
getExpiresAt
()
{
return
expiresAt
;
}
public
void
setExpiresAt
(
Date
expiresAt
)
{
this
.
expiresAt
=
expiresAt
;
}
@Override
public
String
toString
()
{
return
(
JacksonJson
.
toJsonString
(
this
));
}
}
src/test/resources/org/gitlab4j/api/group.json
View file @
f2fe6932
...
...
@@ -17,6 +17,16 @@
"lfs_objects_size"
:
123
,
"job_artifacts_size"
:
57
},
"shared_with_groups"
:
[
{
"group_id"
:
104
,
"group_name"
:
"A Group"
,
"group_full_path"
:
"a-group"
,
"group_access_level"
:
10
,
"expires_at"
:
"2023-11-19"
}
],
"runners_token"
:
"GRnEE2mDc13489411jmS2d5R1XTfM"
,
"projects"
:
[
{
"id"
:
7
,
...
...
src/test/resources/org/gitlab4j/api/project.json
View file @
f2fe6932
...
...
@@ -73,13 +73,15 @@
"group_id"
:
4
,
"group_name"
:
"Twitter"
,
"group_full_path"
:
"twitter"
,
"group_access_level"
:
30
"group_access_level"
:
30
,
"expires_at"
:
"2023-11-19"
},
{
"group_id"
:
3
,
"group_name"
:
"Gitlab Org"
,
"group_full_path"
:
"gitlab-org"
,
"group_access_level"
:
10
"group_access_level"
:
10
,
"expires_at"
:
"2023-11-19"
}
],
"repository_storage"
:
"default"
,
...
...
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