-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #488 from vimeo/access-grant
Support access grant property on TeamMembership
- Loading branch information
Showing
5 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.vimeo.networking2 | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
/** | ||
* The access granted to a team member in a folder. | ||
* | ||
* @param folder The folder with the largest scope to which the user has been granted access. | ||
* @param permissionPolicy The permissions that have been | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class AccessGrant( | ||
@Json(name = "folder") | ||
val folder: Folder? = null, | ||
|
||
@Json(name = "permission_policy") | ||
val permissionPolicy: PermissionPolicy? = null | ||
) |
28 changes: 28 additions & 0 deletions
28
models/src/main/java/com/vimeo/networking2/PermissionActions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.vimeo.networking2 | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
/** | ||
* The actions that can be taken by a team member in a folder. | ||
* | ||
* @param folderDeleteVideo True if the user can delete videos from the folder, false otherwise. | ||
* @param folderEdit True if the user can edit the folder, false otherwise. | ||
* @param folderInvite True if the user can invite others to the folder, false otherwise. | ||
* @param folderView True if the user can view the folder, false otherwise. | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class PermissionActions( | ||
|
||
@Json(name = "folder.delete_video") | ||
val folderDeleteVideo: Boolean? = null, | ||
|
||
@Json(name = "folder.edit") | ||
val folderEdit: Boolean? = null, | ||
|
||
@Json(name = "folder.invite") | ||
val folderInvite: Boolean? = null, | ||
|
||
@Json(name = "folder.view") | ||
val folderView: Boolean? = null | ||
) |
20 changes: 20 additions & 0 deletions
20
models/src/main/java/com/vimeo/networking2/PermissionPolicy.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.vimeo.networking2 | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
/** | ||
* The permission policy for a team member in a folder. | ||
* | ||
* @param name The name of the permission level the user has. | ||
* @param permissionActions The actions the user can take. | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class PermissionPolicy( | ||
|
||
@Json(name = "name") | ||
val name: String? = null, | ||
|
||
@Json(name = "permission_actions") | ||
val permissionActions: PermissionActions? = null | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters