All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.contek.invoker.deribit.api.rest.user.GetCancelByLabel Maven / Gradle / Ivy

There is a newer version: 3.8.0
Show newest version
package io.contek.invoker.deribit.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.RestMethod;
import io.contek.invoker.commons.rest.RestParams;
import io.contek.invoker.deribit.api.rest.common.RestResponse;

import javax.annotation.concurrent.NotThreadSafe;

import static io.contek.invoker.commons.rest.RestMethod.GET;
import static io.contek.invoker.deribit.api.ApiFactory.RateLimits.ONE_API_KEY_MATCHING_ENGINE_REQUEST;
import static java.util.Objects.requireNonNull;

@NotThreadSafe
public final class GetCancelByLabel extends UserRestRequest {
  private String label;

  GetCancelByLabel(IActor actor, RestContext context) {
    super(actor, context);
  }

  public GetCancelByLabel setLabel(String label) {
    this.label = label;
    return this;
  }

  @Override
  protected Class getResponseType() {
    return Response.class;
  }

  @Override
  protected RestMethod getMethod() {
    return GET;
  }

  @Override
  protected String getEndpointPath() {
    return "/api/v2/private/cancel_by_label";
  }

  @Override
  protected RestParams getParams() {
    RestParams.Builder builder = RestParams.newBuilder();

    requireNonNull(label);
    builder.add("label", label);

    return builder.build();
  }

  @Override
  protected ImmutableList getRequiredQuotas() {
    return ONE_API_KEY_MATCHING_ENGINE_REQUEST;
  }

  @NotThreadSafe
  public static final class Response extends RestResponse {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy