io.contek.invoker.bybitinverse.api.rest.user.PostOrderCancelAll Maven / Gradle / Ivy
package io.contek.invoker.bybitinverse.api.rest.user;
import com.google.common.collect.ImmutableList;
import io.contek.invoker.bybitinverse.api.ApiFactory;
import io.contek.invoker.bybitinverse.api.common._OrderCancelAll;
import io.contek.invoker.bybitinverse.api.rest.common.ResponseWrapper;
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 java.util.List;
import static io.contek.invoker.bybitinverse.api.rest.user.PostOrderCancelAll.Response;
import static io.contek.invoker.commons.rest.RestMethod.POST;
import static java.util.Objects.requireNonNull;
@NotThreadSafe
public final class PostOrderCancelAll extends UserRestRequest {
private String symbol;
PostOrderCancelAll(IActor actor, RestContext context) {
super(actor, context);
}
public PostOrderCancelAll setSymbol(String symbol) {
this.symbol = symbol;
return this;
}
@Override
protected RestMethod getMethod() {
return POST;
}
@Override
protected String getEndpointPath() {
return "/v2/private/order/cancelAll";
}
@Override
protected RestParams getParams() {
RestParams.Builder builder = RestParams.newBuilder();
requireNonNull(symbol);
builder.add("symbol", symbol);
return builder.build();
}
@Override
protected ImmutableList getRequiredQuotas() {
return ApiFactory.RateLimits.ONE_REST_PRIVATE_ORDER_WRITE_REQUEST;
}
@Override
protected Class getResponseType() {
return Response.class;
}
@NotThreadSafe
public static final class Response extends ResponseWrapper> {}
}