io.contek.invoker.okx.api.rest.user.GetAccountConfig Maven / Gradle / Ivy
package io.contek.invoker.okx.api.rest.user;
import com.google.common.collect.ImmutableList;
import io.contek.invoker.commons.actor.IActor;
import io.contek.invoker.commons.actor.ratelimit.RateLimitRule;
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 io.contek.invoker.okx.api.common._AccountConfig;
import io.contek.invoker.okx.api.rest.common.ResponseWrapper;
import javax.annotation.concurrent.NotThreadSafe;
import java.time.Duration;
import static io.contek.invoker.commons.actor.ratelimit.LimitType.API_KEY;
import static io.contek.invoker.commons.rest.RestMethod.GET;
@NotThreadSafe
public final class GetAccountConfig extends UserRestRequest {
public static final RateLimitRule RATE_LIMIT_RULE =
RateLimitRule.newBuilder()
.setName("api_key_rest_get_account_config")
.setType(API_KEY)
.setMaxPermits(5)
.setResetPeriod(Duration.ofSeconds(2))
.build();
private static final ImmutableList REQUIRED_QUOTA =
ImmutableList.of(RATE_LIMIT_RULE.forPermits(1));
GetAccountConfig(IActor actor, RestContext context) {
super(actor, context);
}
@Override
protected RestMethod getMethod() {
return GET;
}
@Override
protected String getEndpointPath() {
return "/api/v5/account/config";
}
@Override
protected RestParams getParams() {
return RestParams.empty();
}
@Override
protected Class getResponseType() {
return Response.class;
}
@Override
protected ImmutableList getRequiredQuotas() {
return REQUIRED_QUOTA;
}
@NotThreadSafe
public static final class Response extends ResponseWrapper<_AccountConfig> {}
}