mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 10:27:45 +00:00 
			
		
		
		
	Update permissions parsing to latest api changes
Supports api renaming from grantedTo to grantedToIdentities on v1.0.1 https://github.com/owncloud/libre-graph-api/releases/tag/v1.0.1
This commit is contained in:
		
							parent
							
								
									d931071907
								
							
						
					
					
						commit
						7799b77600
					
				| @ -89,8 +89,15 @@ data class FileResponse( | |||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @JsonClass(generateAdapter = true) | @JsonClass(generateAdapter = true) | ||||||
| data class GrantedToResponse( | data class IdentityPermissionResponse( | ||||||
|     val user: UserResponse |     val id: String, | ||||||
|  |     val displayName: String?, | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | @JsonClass(generateAdapter = true) | ||||||
|  | data class GrantedToIdentitiesResponse( | ||||||
|  |     val user: IdentityPermissionResponse?, | ||||||
|  |     val group: IdentityPermissionResponse?, | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @JsonClass(generateAdapter = true) | @JsonClass(generateAdapter = true) | ||||||
| @ -100,9 +107,18 @@ data class DeleteResponse( | |||||||
| 
 | 
 | ||||||
| @JsonClass(generateAdapter = true) | @JsonClass(generateAdapter = true) | ||||||
| data class PermissionResponse( | data class PermissionResponse( | ||||||
|     val grantedTo: List<GrantedToResponse>, |     val grantedTo: List<GrantedToIdentitiesResponse>?, | ||||||
|     val roles: List<String> |     val grantedToIdentities: List<GrantedToIdentitiesResponse>?, | ||||||
| ) |     val roles: List<String>, | ||||||
|  | ) { | ||||||
|  |     /** | ||||||
|  |      * Supports api renaming from grantedTo to grantedToIdentities on v1.0.1 | ||||||
|  |      * https://github.com/owncloud/libre-graph-api/releases/tag/v1.0.1 | ||||||
|  |      */ | ||||||
|  |     fun getGrantedToIdentitiesResponse(): List<GrantedToIdentitiesResponse> { | ||||||
|  |         return grantedToIdentities ?: grantedTo ?: throw IllegalArgumentException("Permissions not granted to anyone") | ||||||
|  |     } | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| @JsonClass(generateAdapter = true) | @JsonClass(generateAdapter = true) | ||||||
| data class SpecialFolderResponse( | data class SpecialFolderResponse( | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user