This repository was archived by the owner on Mar 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +31
-2
lines changed
owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/shares/responses Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,23 @@ data class ShareeOcsResponse(
40
40
val remotes : List <ShareeItem >? ,
41
41
@Json(name = " users" )
42
42
val users : List <ShareeItem >?
43
- )
43
+ ) {
44
+ fun getFlatRepresentation ()
45
+ = ArrayList <ShareeItem >().apply {
46
+ if (exact != null ) {
47
+ addAll(exact.getFlatRepresentation())
48
+ }
49
+ if (users != null ) {
50
+ addAll(users)
51
+ }
52
+ if (remotes != null ) {
53
+ addAll(remotes)
54
+ }
55
+ if (groups != null ) {
56
+ addAll(groups)
57
+ }
58
+ }
59
+ }
44
60
45
61
@JsonClass(generateAdapter = true )
46
62
data class ExactSharees (
@@ -50,7 +66,20 @@ data class ExactSharees(
50
66
val remotes : List <ShareeItem >? ,
51
67
@Json(name = " users" )
52
68
val users : List <ShareeItem >?
53
- )
69
+ ) {
70
+ fun getFlatRepresentation ()
71
+ = ArrayList <ShareeItem >().apply {
72
+ if (users != null ) {
73
+ addAll(users)
74
+ }
75
+ if (remotes != null ) {
76
+ addAll(remotes)
77
+ }
78
+ if (groups != null ) {
79
+ addAll(groups)
80
+ }
81
+ }
82
+ }
54
83
55
84
@JsonClass(generateAdapter = true )
56
85
data class ShareeItem (
You can’t perform that action at this time.
0 commit comments