io.contek.invoker.ftx.api.rest.user.PostAccountLeverage Maven / Gradle / Ivy
package io.contek.invoker.ftx.api.rest.user;
import io.contek.invoker.commons.api.actor.IActor;
import io.contek.invoker.commons.api.rest.RestContext;
import io.contek.invoker.commons.api.rest.RestMethod;
import io.contek.invoker.commons.api.rest.RestParams;
import io.contek.invoker.ftx.api.common._Leverage;
import io.contek.invoker.ftx.api.rest.common.RestResponse;
import javax.annotation.concurrent.NotThreadSafe;
import static io.contek.invoker.commons.api.rest.RestMethod.POST;
import static java.util.Objects.requireNonNull;
@NotThreadSafe
public final class PostAccountLeverage extends UserRestRequest {
private Double leverage;
PostAccountLeverage(IActor actor, RestContext context) {
super(actor, context);
}
public PostAccountLeverage setLeverage(Double leverage) {
this.leverage = leverage;
return this;
}
@Override
protected RestMethod getMethod() {
return POST;
}
@Override
protected String getEndpointPath() {
return "/account/leverage";
}
@Override
protected RestParams getParams() {
RestParams.Builder builder = RestParams.newBuilder();
requireNonNull(leverage);
builder.add("leverage", leverage);
return builder.build();
}
@Override
protected Class getResponseType() {
return Response.class;
}
@NotThreadSafe
public static final class Response extends RestResponse<_Leverage> {}
}