mirror of
https://github.com/owncloud/android-library.git
synced 2026-08-14 18:02:58 +00:00
add changes according to review
This commit is contained in:
committed by
Abel García de Prada
parent
db478efedc
commit
76c55c9a9c
-12
@@ -121,18 +121,6 @@ class GetRemoteShareesOperation
|
||||
return RemoteOperationResult(method)
|
||||
}
|
||||
|
||||
private fun flattenResultData(jsonResults: Array<JSONArray>):ArrayList<JSONObject> {
|
||||
val data = ArrayList<JSONObject>() // For result data
|
||||
for (i in 0..jsonResults.size) {
|
||||
for (j in 0 until jsonResults[i].length()) {
|
||||
val jsonResult = jsonResults[i].getJSONObject(j)
|
||||
data.add(jsonResult)
|
||||
Timber.d("*** Added item: ${jsonResult.getString(PROPERTY_LABEL)}")
|
||||
}
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
private fun onRequestSuccessful(response: String?): RemoteOperationResult<ShareeOcsResponse> {
|
||||
val result = RemoteOperationResult<ShareeOcsResponse>(OK)
|
||||
Timber.d("Successful response: $response")
|
||||
|
||||
-11
@@ -32,13 +32,9 @@ import com.squareup.moshi.JsonClass
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ShareeOcsResponse(
|
||||
@Json(name = "exact")
|
||||
val exact: ExactSharees?,
|
||||
@Json(name = "groups")
|
||||
val groups: List<ShareeItem>,
|
||||
@Json(name = "remotes")
|
||||
val remotes: List<ShareeItem>,
|
||||
@Json(name = "users")
|
||||
val users: List<ShareeItem>
|
||||
) {
|
||||
fun getFlatRepresentationWithoutExact() = ArrayList<ShareeItem>().apply {
|
||||
@@ -50,11 +46,8 @@ data class ShareeOcsResponse(
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExactSharees(
|
||||
@Json(name = "groups")
|
||||
val groups: List<ShareeItem>,
|
||||
@Json(name = "remotes")
|
||||
val remotes: List<ShareeItem>,
|
||||
@Json(name = "users")
|
||||
val users: List<ShareeItem>
|
||||
) {
|
||||
fun getFlatRepresentation() = ArrayList<ShareeItem>().apply {
|
||||
@@ -66,17 +59,13 @@ data class ExactSharees(
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ShareeItem(
|
||||
@Json(name = "label")
|
||||
val label: String,
|
||||
@Json(name = "value")
|
||||
val value: ShareeValue
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ShareeValue(
|
||||
@Json(name = "shareType")
|
||||
val shareType: Int,
|
||||
@Json(name = "shareWith")
|
||||
val shareWith: String,
|
||||
@Json(name = "shareWithAdditionalInfo")
|
||||
val additionalInfo: String?
|
||||
|
||||
Reference in New Issue
Block a user