package com.kryptnostic.v2.api;

import java.util.UUID;

import com.kryptnostic.v2.constants.Names;

import retrofit.http.GET;
import retrofit.http.Path;

public interface ObjectAuthorizationApi {

    String CONTROLLER   = "/access";

    String READERS_PATH = "/readers";
    String WRITERS_PATH = "/writers";
    String OWNERS_PATH  = "/owners";

    String ID                = Names.ID_FIELD;
    String OBJECT_ID_PATH = "/{" + ID + "}";

    String FULL_READERS_PATH = READERS_PATH + OBJECT_ID_PATH;
    String FULL_WRITERS_PATH = WRITERS_PATH + OBJECT_ID_PATH;
    String FULL_OWNERS_PATH  = OWNERS_PATH + OBJECT_ID_PATH;

    @GET( CONTROLLER + FULL_READERS_PATH )
    Iterable<UUID> getUsersWithReadAccess( @Path( ID ) UUID objectId);

    @GET( CONTROLLER + FULL_WRITERS_PATH )
    Iterable<UUID> getUsersWithWriteAccess( @Path( ID ) UUID objectId);

    @GET( CONTROLLER + FULL_OWNERS_PATH )
    Iterable<UUID> getUsersWithOwnerAccess( @Path( ID ) UUID objectId);

}

@@ -94,16 +94,49 @@
 Names;%0A%0A
+import retrofit.client.Response;%0A
 import r
@@ -248,16 +248,27 @@
 OLLER   
+           
 = %22/acce
@@ -293,24 +293,35 @@
 EADERS_PATH 
+           
 = %22/readers%22
@@ -342,24 +342,35 @@
 RITERS_PATH 
+           
 = %22/writers%22
@@ -395,16 +395,27 @@
 S_PATH  
+           
 = %22/owne
@@ -418,16 +418,64 @@
 owners%22;
+%0A    String REVOKE_PATH             = %22/revoke%22;
 %0A%0A    St
@@ -497,16 +497,22 @@
         
+    
+  
 = Names.
@@ -547,16 +547,25 @@
 ID_PATH 
+         
 = %22/%7B%22 +
@@ -605,16 +605,22 @@
 RS_PATH 
+      
 = READER
@@ -673,16 +673,22 @@
 RS_PATH 
+      
 = WRITER
@@ -741,16 +741,22 @@
 S_PATH  
+      
 = OWNERS
@@ -778,16 +778,83 @@
 ID_PATH;
+%0A    String FULL_REVOKE_ACCESS_PATH = REVOKE_PATH + OBJECT_ID_PATH;
 %0A%0A    @G
@@ -1193,10 +1193,121 @@
 ctId);%0A%0A
+    @GET( CONTROLLER + FULL_REVOKE_ACCESS_PATH )%0A    Response revokeAccessForUser( @Path( ID ) UUID objectId);%0A
 %7D%0A

add access revocation call