package net.openl10n.flies.rest.client;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import net.openl10n.flies.common.LocaleId;
import net.openl10n.flies.rest.StringSet;
import net.openl10n.flies.rest.dto.resource.Resource;
import net.openl10n.flies.rest.dto.resource.ResourceMeta;
import net.openl10n.flies.rest.dto.resource.TranslationsResource;

import org.jboss.resteasy.client.ClientResponse;

@Produces({ MediaType.APPLICATION_XML })
@Consumes({ MediaType.APPLICATION_XML })
public interface ITranslationResources
{

   @GET
   public ClientResponse<List<ResourceMeta>> get(@QueryParam("ext") StringSet extensions);

   @POST
   public ClientResponse<String> post(Resource messageBody, @QueryParam("ext") StringSet extensions);

   @GET
   @Path("{id}")
   public ClientResponse<Resource> getResource(@PathParam("id") String idNoSlash, @QueryParam("ext") StringSet extensions);

   @PUT
   @Path("{id}")
   public ClientResponse<String> putResource(@PathParam("id") String idNoSlash, Resource messageBody, @QueryParam("ext") StringSet extensions);

   @PUT
   @Path("{id}")
   public ClientResponse<String> putResource(@PathParam("id") String idNoSlash, Resource messageBody, @QueryParam("ext") StringSet extensions, @QueryParam("copyTrans") boolean copyTrans);
   
   @DELETE
   @Path("{id}")
   public ClientResponse<String> deleteResource(@PathParam("id") String idNoSlash);

   @GET
   @Path("{id}/meta")
   public ClientResponse<ResourceMeta> getResourceMeta(@PathParam("id") String idNoSlash, @QueryParam("ext") StringSet extensions);

   @PUT
   @Path("{id}/meta")
   public ClientResponse<String> putResourceMeta(@PathParam("id") String idNoSlash, ResourceMeta messageBody, @QueryParam("ext") StringSet extensions);

   @GET
   @Path("{id}/translations/{locale}")
   public ClientResponse<TranslationsResource> getTranslations(@PathParam("id") String idNoSlash, @PathParam("locale") LocaleId locale, @QueryParam("ext") StringSet extensions);

   @DELETE
   @Path("{id}/translations/{locale}")
   public ClientResponse<String> deleteTranslations(@PathParam("id") String idNoSlash, @PathParam("locale") LocaleId locale);

   @PUT
   @Path("{id}/translations/{locale}")
   public ClientResponse<String> putTranslations(@PathParam("id") String idNoSlash, @PathParam("locale") LocaleId locale, TranslationsResource messageBody, @QueryParam("ext") StringSet extensions);

}

@@ -2631,12 +2631,300 @@
 nsions);
+%0A   %0A   @PUT%0A   @Path(%22%7Bid%7D/translations/%7Blocale%7D%22)%0A   public ClientResponse%3CString%3E putTranslations(@PathParam(%22id%22) String idNoSlash, @PathParam(%22locale%22) LocaleId locale, TranslationsResource messageBody, @QueryParam(%22ext%22) StringSet extensions, @QueryParam(%22merge%22) String mergeType);
 %0A%0A%7D%0A

add merge type option to Maven client (Fixes issue 28)