package com.kryptnostic.directory.v1.http;

import java.util.UUID;

import retrofit.client.Response;
import retrofit.http.GET;
import retrofit.http.POST;

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

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

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

    @Timed
    @GET( DOMAIN )
    Optional<UUID> getDomainId( String domainName );

}

@@ -94,16 +94,43 @@
 sponse;%0A
+import retrofit.http.Body;%0A
 import r
@@ -173,16 +173,43 @@
 tp.POST;
+%0Aimport retrofit.http.Path;
 %0A%0Aimport
@@ -579,16 +579,82 @@
 %22name%22;%0A
+    public static final String NAME_PATH     = %22/%7B%22 + NAME + %22%7D%22;%0A
     publ
@@ -864,16 +864,22 @@
 eDomain(
+ @Body
  DomainU
@@ -920,24 +920,36 @@
 GET( DOMAIN 
++ NAME_PATH 
 )%0A    Option
@@ -969,16 +969,30 @@
 omainId(
+ @Path( NAME )
  String 

add retrofit annotations for testing