io.contek.invoker.hbdminverse.api.rest.user.PostSwapPositionInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of invoker-hbdminverse-api Show documentation
Show all versions of invoker-hbdminverse-api Show documentation
Huobi Derivative Inverse Java API
package io.contek.invoker.hbdminverse.api.rest.user;
import com.google.common.collect.ImmutableList;
import io.contek.invoker.commons.actor.IActor;
import io.contek.invoker.commons.actor.ratelimit.TypedPermitRequest;
import io.contek.invoker.commons.rest.RestContext;
import io.contek.invoker.commons.rest.RestParams;
import io.contek.invoker.hbdminverse.api.common._PositionInfo;
import io.contek.invoker.hbdminverse.api.rest.common.RestDataResponse;
import javax.annotation.concurrent.NotThreadSafe;
import java.util.List;
import static io.contek.invoker.hbdminverse.api.ApiFactory.RateLimits.ONE_API_KEY_REST_PRIVATE_READ_REQUEST;
@NotThreadSafe
public final class PostSwapPositionInfo extends UserRestRequest {
private String contract_code;
PostSwapPositionInfo(IActor actor, RestContext context) {
super(actor, context);
}
public PostSwapPositionInfo setContractCode(String contract_code) {
this.contract_code = contract_code;
return this;
}
@Override
protected Class getResponseType() {
return Response.class;
}
@Override
protected String getEndpointPath() {
return "/swap-api/v1/swap_position_info";
}
@Override
protected RestParams getParams() {
RestParams.Builder builder = RestParams.newBuilder();
if (contract_code != null) {
builder.add("contract_code", contract_code);
}
return builder.build();
}
@Override
protected ImmutableList getRequiredQuotas() {
return ONE_API_KEY_REST_PRIVATE_READ_REQUEST;
}
@NotThreadSafe
public static final class Response extends RestDataResponse> {}
}