mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
add Sharee response model
This commit is contained in:
parent
4f72f93f8b
commit
9f1c20b418
@ -21,7 +21,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.owncloud.android.lib.resources.status.responses
|
||||
package com.owncloud.android.lib.resources
|
||||
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
@ -0,0 +1,91 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
*
|
||||
* Copyright (C) 2020 ownCloud GmbH.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.owncloud.android.lib.resources.shares.responses
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* This was modeled according to the documentation:
|
||||
* https://doc.owncloud.com/server/developer_manual/core/apis/ocs-recipient-api.html#get-shares-recipients
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ShareeOcsResponse(
|
||||
@Json(name = "data")
|
||||
val data: ShareeResponseData?,
|
||||
@Json(name = "meta")
|
||||
val meta: ShareeMeta?
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ShareeResponseData(
|
||||
@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>?
|
||||
)
|
||||
|
||||
@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>?
|
||||
)
|
||||
|
||||
@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?
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ShareeMeta(
|
||||
@Json(name = "itemsperpage")
|
||||
val itemsPerPage: Int?,
|
||||
@Json(name = "message")
|
||||
val message: String?,
|
||||
@Json(name = "status")
|
||||
val status: String?,
|
||||
@Json(name = "statuscode")
|
||||
val statusCode: Int?,
|
||||
@Json(name = "totalitems")
|
||||
val totalItems: Int?
|
||||
)
|
@ -35,7 +35,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperation
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode.OK
|
||||
import com.owncloud.android.lib.resources.status.responses.CapabilityResponse
|
||||
import com.owncloud.android.lib.resources.status.responses.CommonOcsResponse
|
||||
import com.owncloud.android.lib.resources.CommonOcsResponse
|
||||
import com.squareup.moshi.JsonAdapter
|
||||
import com.squareup.moshi.Moshi
|
||||
import com.squareup.moshi.Types
|
||||
|
@ -29,7 +29,7 @@ import com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode
|
||||
import com.owncloud.android.lib.resources.status.responses.CommonOcsResponse
|
||||
import com.owncloud.android.lib.resources.CommonOcsResponse
|
||||
import com.owncloud.android.lib.resources.users.responses.UserInfoResponse
|
||||
import com.squareup.moshi.JsonAdapter
|
||||
import com.squareup.moshi.Moshi
|
||||
|
Loading…
x
Reference in New Issue
Block a user