diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/shares/responses/ShareeResponse.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/shares/responses/ShareeResponse.kt index ca7b8e67..f372747e 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/shares/responses/ShareeResponse.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/shares/responses/ShareeResponse.kt @@ -35,63 +35,49 @@ data class ShareeOcsResponse( @Json(name = "exact") val exact: ExactSharees?, @Json(name = "groups") - val groups: List?, + val groups: List, @Json(name = "remotes") - val remotes: List?, + val remotes: List, @Json(name = "users") - val users: List? + val users: List ) { - fun getFlatRepresentationWithoutExact() - = ArrayList().apply { - if(users != null) { - addAll(users) - } - if(remotes != null) { - addAll(remotes) - } - if(groups != null) { - addAll(groups) - } + fun getFlatRepresentationWithoutExact() = ArrayList().apply { + addAll(users) + addAll(remotes) + addAll(groups) } } @JsonClass(generateAdapter = true) data class ExactSharees( @Json(name = "groups") - val groups: List?, + val groups: List, @Json(name = "remotes") - val remotes: List?, + val remotes: List, @Json(name = "users") - val users: List? + val users: List ) { - fun getFlatRepresentation() - = ArrayList().apply { - if(users != null) { - addAll(users) - } - if(remotes != null) { - addAll(remotes) - } - if(groups != null) { - addAll(groups) - } + fun getFlatRepresentation() = ArrayList().apply { + addAll(users) + addAll(remotes) + addAll(groups) } } @JsonClass(generateAdapter = true) data class ShareeItem( @Json(name = "label") - val label: String?, + val label: String, @Json(name = "value") - val value: ShareeValue? + val value: ShareeValue ) @JsonClass(generateAdapter = true) data class ShareeValue( @Json(name = "shareType") - val shareType: Int?, + val shareType: Int, @Json(name = "shareWith") - val shareWith: String?, - @Json(name ="shareWithAdditionalInfo") + val shareWith: String, + @Json(name = "shareWithAdditionalInfo") val additionalInfo: String? )