mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 07:56:19 +00:00
get flat representation from ShareeOcsResponse
This commit is contained in:
parent
fe425c8083
commit
7402c89a18
@ -40,7 +40,23 @@ data class ShareeOcsResponse(
|
||||
val remotes: List<ShareeItem>?,
|
||||
@Json(name = "users")
|
||||
val users: List<ShareeItem>?
|
||||
)
|
||||
) {
|
||||
fun getFlatRepresentation()
|
||||
= ArrayList<ShareeItem>().apply {
|
||||
if(exact != null) {
|
||||
addAll(exact.getFlatRepresentation())
|
||||
}
|
||||
if(users != null) {
|
||||
addAll(users)
|
||||
}
|
||||
if(remotes != null) {
|
||||
addAll(remotes)
|
||||
}
|
||||
if(groups != null) {
|
||||
addAll(groups)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExactSharees(
|
||||
@ -50,7 +66,20 @@ data class ExactSharees(
|
||||
val remotes: List<ShareeItem>?,
|
||||
@Json(name = "users")
|
||||
val users: List<ShareeItem>?
|
||||
)
|
||||
) {
|
||||
fun getFlatRepresentation()
|
||||
= ArrayList<ShareeItem>().apply {
|
||||
if(users != null) {
|
||||
addAll(users)
|
||||
}
|
||||
if(remotes != null) {
|
||||
addAll(remotes)
|
||||
}
|
||||
if(groups != null) {
|
||||
addAll(groups)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ShareeItem(
|
||||
|
Loading…
x
Reference in New Issue
Block a user