io.contek.invoker.binanceinverse.api.rest.user.GetAccount Maven / Gradle / Ivy
The newest version!
package io.contek.invoker.binanceinverse.api.rest.user;
import com.google.common.collect.ImmutableList;
import io.contek.invoker.binanceinverse.api.common._Account;
import io.contek.invoker.binanceinverse.api.rest.user.GetAccount.Response;
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.RestMethod;
import io.contek.invoker.commons.rest.RestParams;
import javax.annotation.concurrent.NotThreadSafe;
import static io.contek.invoker.binanceinverse.api.ApiFactory.RateLimits.IP_REST_REQUEST_RULE;
import static io.contek.invoker.commons.rest.RestMethod.GET;
@NotThreadSafe
public final class GetAccount extends UserRestRequest {
private static final ImmutableList REQUIRED_QUOTA =
ImmutableList.of(IP_REST_REQUEST_RULE.forPermits(5));
GetAccount(IActor actor, RestContext context) {
super(actor, context);
}
@Override
protected RestMethod getMethod() {
return GET;
}
@Override
protected Class getResponseType() {
return Response.class;
}
@Override
protected String getEndpointPath() {
return "/dapi/v1/account";
}
@Override
protected RestParams getParams() {
RestParams.Builder builder = RestParams.newBuilder();
builder.add("timestamp", getMillis());
return builder.build();
}
@Override
protected ImmutableList getRequiredQuotas() {
return REQUIRED_QUOTA;
}
@NotThreadSafe
public static final class Response extends _Account {}
}