package com.xeiam.xchange.itbit.v1;

import java.io.IOException;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
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 com.xeiam.xchange.itbit.v1.dto.account.ItBitAccountInfoReturn;
import com.xeiam.xchange.itbit.v1.dto.marketdata.ItBitTicker;
import com.xeiam.xchange.itbit.v1.dto.trade.ItBitOrder;
import com.xeiam.xchange.itbit.v1.dto.trade.ItBitPlaceOrderRequest;

import si.mazi.rescu.ParamsDigest;
import si.mazi.rescu.SynchronizedValueFactory;

@Path("v1")
@Produces(MediaType.APPLICATION_JSON)
public interface ItBitAuthenticated extends ItBit {

  @GET
  @Path("/markets/{ident}{currency}/ticker")
  ItBitTicker getTicker(@PathParam("ident") String tradeableIdentifier, @PathParam("currency") String currency) throws IOException;

  @GET
  @Path("wallets?userId={userId}")
  ItBitAccountInfoReturn[] getInfo(@HeaderParam("Authorization") ParamsDigest signer, @HeaderParam("X-Auth-Timestamp") long timestamp,
      @HeaderParam("X-Auth-Nonce") SynchronizedValueFactory<Long> valueFactory, @PathParam("userId") String userId) throws IOException;

  @GET
  @Path("wallets/{walletId}")
  @Consumes(MediaType.APPLICATION_JSON)
  ItBitAccountInfoReturn getWallet(@HeaderParam("Authorization") ParamsDigest signer, @HeaderParam("X-Auth-Timestamp") long timestamp,
      @HeaderParam("X-Auth-Nonce") SynchronizedValueFactory<Long> valueFactory, @PathParam("walletId") String walletId) throws IOException;

  @GET
  @Path("wallets/{walletId}/orders")
  @Consumes(MediaType.APPLICATION_JSON)
  ItBitOrder[] getOrders(@HeaderParam("Authorization") ParamsDigest signer, @HeaderParam("X-Auth-Timestamp") long timestamp,
      @HeaderParam("X-Auth-Nonce") SynchronizedValueFactory<Long> valueFactory, @QueryParam("instrument") String instrument,
      @QueryParam("page") String page, @QueryParam("perPage") String perPage, @QueryParam("status") String status,
      @PathParam("walletId") String walletId) throws IOException;

  @GET
  @Path("wallets/{walletId}/orders/{orderId}")
  @Consumes(MediaType.APPLICATION_JSON)
  ItBitOrder getOrder(@HeaderParam("Authorization") ParamsDigest signer, @HeaderParam("X-Auth-Timestamp") long timestamp,
      @HeaderParam("X-Auth-Nonce") SynchronizedValueFactory<Long> valueFactory, @PathParam("walletId") String walletId,
      @PathParam("orderId") String orderId) throws IOException;

  @POST
  @Path("wallets/{walletId}/orders")
  @Consumes(MediaType.APPLICATION_JSON)
  ItBitOrder postOrder(@HeaderParam("Authorization") ParamsDigest signer, @HeaderParam("X-Auth-Timestamp") long timestamp,
      @HeaderParam("X-Auth-Nonce") SynchronizedValueFactory<Long> valueFactory, @PathParam("walletId") String walletId,
      ItBitPlaceOrderRequest request) throws IOException;

  /** Returns empty body, return object is always null */
  @DELETE
  @Path("wallets/{walletId}/orders/{orderId}")
  @Consumes(MediaType.APPLICATION_JSON)
  Object cancelOrder(@HeaderParam("Authorization") ParamsDigest signer, @HeaderParam("X-Auth-Timestamp") long timestamp,
      @HeaderParam("X-Auth-Nonce") SynchronizedValueFactory<Long> valueFactory, @PathParam("walletId") String walletId,
      @PathParam("orderId") String orderId) throws IOException;

  @POST
  @Path("wallets/{walletId}/cryptocurrency_withdrawals")
  @Consumes(MediaType.APPLICATION_JSON)
  ItBitOrder requestWithdrawal(@HeaderParam("Authorization") ParamsDigest signer, @HeaderParam("X-Auth-Timestamp") long timestamp,
      @HeaderParam("X-Auth-Nonce") SynchronizedValueFactory<Long> valueFactory, @PathParam("walletId") String walletId,
      ItBitPlaceOrderRequest request) throws IOException;

}

@@ -1330,48 +1330,8 @@
 %7D%22)%0A
-  @Consumes(MediaType.APPLICATION_JSON)%0A
   It
@@ -1453,32 +1453,32 @@
 long timestamp,%0A
+
       @HeaderPar
@@ -1650,48 +1650,8 @@
 s%22)%0A
-  @Consumes(MediaType.APPLICATION_JSON)%0A
   It
@@ -2136,48 +2136,8 @@
 %7D%22)%0A
-  @Consumes(MediaType.APPLICATION_JSON)%0A
   It
@@ -2894,16 +2894,16 @@
 @DELETE%0A
+
   @Path(
@@ -2945,48 +2945,8 @@
 %7D%22)%0A
-  @Consumes(MediaType.APPLICATION_JSON)%0A
   Ob

Remove @Consumes from GET requests