package com.kryptnostic.directory.v1.http;

import java.util.Set;
import java.util.UUID;

import com.codahale.metrics.annotation.Timed;
import com.google.common.base.Optional;
import com.kryptnostic.directory.v1.model.DomainUpdate;

import retrofit.client.Response;
import retrofit.http.Body;
import retrofit.http.DELETE;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Path;

/**
 * {@code Domain} management functionality.
 * 
 * @author Nick Hewitt
 * @author Yao Pan
 *
 */
public interface DomainManagementApi {
    public static final String DOMAIN        = "/domain";
    public static final String NAME          = "name";
    public static final String NAME_PATH     = "/{" + NAME + "}";
    public static final String NAME_WITH_DOT = "/{" + NAME + ":.+}";

    public static final String WHITE_LIST    = "/whitelist";

    /**
     * Update domain settings.
     * 
     * @param request
     * @return
     */
    @Timed
    @POST( DOMAIN )
    Response updateDomain( @Body DomainUpdate request );

    @Timed
    @GET( DOMAIN + NAME_PATH )
    Optional<UUID> getDomainId( @Path( NAME ) String domainName);

    /**
     * Update white list settings.
     * 
     * @param domains
     * @return
     */
    @PUT( WHITE_LIST + NAME_PATH )
    Response addDomainWhiteList( @Path( NAME ) String domainName, @Body Set<String> domains);

    @GET( WHITE_LIST + NAME_PATH )
    Set<String> getDomainWhiteList( @Path( NAME ) String domainName);

    @DELETE( WHITE_LIST + NAME_PATH )
    Response deleteDomainWhiteList( @Path( NAME ) String domainName, @Body Set<String> domains);
}
@@ -1276,36 +1276,24 @@
  WHITE_LIST 
-+ NAME_PATH 
 )%0A    Respon
@@ -1318,41 +1318,8 @@
 ist(
- @Path( NAME ) String domainName,
  @Bo
@@ -1340,16 +1340,17 @@
  domains
+ 
 );%0A%0A    
@@ -1362,36 +1362,24 @@
  WHITE_LIST 
-+ NAME_PATH 
 )%0A    Set%3CSt
@@ -1407,40 +1407,8 @@
 ist(
- @Path( NAME ) String domainName
 );%0A%0A
@@ -1431,28 +1431,16 @@
 TE_LIST 
-+ NAME_PATH 
 )%0A    Re
@@ -1472,41 +1472,8 @@
 ist(
- @Path( NAME ) String domainName,
  @Bo
@@ -1494,12 +1494,13 @@
  domains
+ 
 );%0A%7D

update white list related api