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

ru.tinkoff.piapi.contract.v1.SignalServiceGrpc Maven / Gradle / Ivy

There is a newer version: 1.25
Show newest version
package ru.tinkoff.piapi.contract.v1;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.56.1)",
    comments = "Source: signals.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class SignalServiceGrpc {

  private SignalServiceGrpc() {}

  public static final String SERVICE_NAME = "tinkoff.public.invest.api.contract.v1.SignalService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor getGetStrategiesMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "GetStrategies",
      requestType = ru.tinkoff.piapi.contract.v1.GetStrategiesRequest.class,
      responseType = ru.tinkoff.piapi.contract.v1.GetStrategiesResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getGetStrategiesMethod() {
    io.grpc.MethodDescriptor getGetStrategiesMethod;
    if ((getGetStrategiesMethod = SignalServiceGrpc.getGetStrategiesMethod) == null) {
      synchronized (SignalServiceGrpc.class) {
        if ((getGetStrategiesMethod = SignalServiceGrpc.getGetStrategiesMethod) == null) {
          SignalServiceGrpc.getGetStrategiesMethod = getGetStrategiesMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStrategies"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ru.tinkoff.piapi.contract.v1.GetStrategiesRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ru.tinkoff.piapi.contract.v1.GetStrategiesResponse.getDefaultInstance()))
              .setSchemaDescriptor(new SignalServiceMethodDescriptorSupplier("GetStrategies"))
              .build();
        }
      }
    }
    return getGetStrategiesMethod;
  }

  private static volatile io.grpc.MethodDescriptor getGetSignalsMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "GetSignals",
      requestType = ru.tinkoff.piapi.contract.v1.GetSignalsRequest.class,
      responseType = ru.tinkoff.piapi.contract.v1.GetSignalsResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getGetSignalsMethod() {
    io.grpc.MethodDescriptor getGetSignalsMethod;
    if ((getGetSignalsMethod = SignalServiceGrpc.getGetSignalsMethod) == null) {
      synchronized (SignalServiceGrpc.class) {
        if ((getGetSignalsMethod = SignalServiceGrpc.getGetSignalsMethod) == null) {
          SignalServiceGrpc.getGetSignalsMethod = getGetSignalsMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSignals"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ru.tinkoff.piapi.contract.v1.GetSignalsRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ru.tinkoff.piapi.contract.v1.GetSignalsResponse.getDefaultInstance()))
              .setSchemaDescriptor(new SignalServiceMethodDescriptorSupplier("GetSignals"))
              .build();
        }
      }
    }
    return getGetSignalsMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static SignalServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public SignalServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new SignalServiceStub(channel, callOptions);
        }
      };
    return SignalServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static SignalServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public SignalServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new SignalServiceBlockingStub(channel, callOptions);
        }
      };
    return SignalServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static SignalServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public SignalServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new SignalServiceFutureStub(channel, callOptions);
        }
      };
    return SignalServiceFutureStub.newStub(factory, channel);
  }

  /**
   */
  public interface AsyncService {

    /**
     */
    default void getStrategies(ru.tinkoff.piapi.contract.v1.GetStrategiesRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStrategiesMethod(), responseObserver);
    }

    /**
     */
    default void getSignals(ru.tinkoff.piapi.contract.v1.GetSignalsRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSignalsMethod(), responseObserver);
    }
  }

  /**
   * Base class for the server implementation of the service SignalService.
   */
  public static abstract class SignalServiceImplBase
      implements io.grpc.BindableService, AsyncService {

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return SignalServiceGrpc.bindService(this);
    }
  }

  /**
   * A stub to allow clients to do asynchronous rpc calls to service SignalService.
   */
  public static final class SignalServiceStub
      extends io.grpc.stub.AbstractAsyncStub {
    private SignalServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected SignalServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new SignalServiceStub(channel, callOptions);
    }

    /**
     */
    public void getStrategies(ru.tinkoff.piapi.contract.v1.GetStrategiesRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getGetStrategiesMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void getSignals(ru.tinkoff.piapi.contract.v1.GetSignalsRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getGetSignalsMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   * A stub to allow clients to do synchronous rpc calls to service SignalService.
   */
  public static final class SignalServiceBlockingStub
      extends io.grpc.stub.AbstractBlockingStub {
    private SignalServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected SignalServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new SignalServiceBlockingStub(channel, callOptions);
    }

    /**
     */
    public ru.tinkoff.piapi.contract.v1.GetStrategiesResponse getStrategies(ru.tinkoff.piapi.contract.v1.GetStrategiesRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getGetStrategiesMethod(), getCallOptions(), request);
    }

    /**
     */
    public ru.tinkoff.piapi.contract.v1.GetSignalsResponse getSignals(ru.tinkoff.piapi.contract.v1.GetSignalsRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getGetSignalsMethod(), getCallOptions(), request);
    }
  }

  /**
   * A stub to allow clients to do ListenableFuture-style rpc calls to service SignalService.
   */
  public static final class SignalServiceFutureStub
      extends io.grpc.stub.AbstractFutureStub {
    private SignalServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected SignalServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new SignalServiceFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture getStrategies(
        ru.tinkoff.piapi.contract.v1.GetStrategiesRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getGetStrategiesMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture getSignals(
        ru.tinkoff.piapi.contract.v1.GetSignalsRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getGetSignalsMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_GET_STRATEGIES = 0;
  private static final int METHODID_GET_SIGNALS = 1;

  private static final class MethodHandlers implements
      io.grpc.stub.ServerCalls.UnaryMethod,
      io.grpc.stub.ServerCalls.ServerStreamingMethod,
      io.grpc.stub.ServerCalls.ClientStreamingMethod,
      io.grpc.stub.ServerCalls.BidiStreamingMethod {
    private final AsyncService serviceImpl;
    private final int methodId;

    MethodHandlers(AsyncService serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
      switch (methodId) {
        case METHODID_GET_STRATEGIES:
          serviceImpl.getStrategies((ru.tinkoff.piapi.contract.v1.GetStrategiesRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_GET_SIGNALS:
          serviceImpl.getSignals((ru.tinkoff.piapi.contract.v1.GetSignalsRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver invoke(
        io.grpc.stub.StreamObserver responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        .addMethod(
          getGetStrategiesMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              ru.tinkoff.piapi.contract.v1.GetStrategiesRequest,
              ru.tinkoff.piapi.contract.v1.GetStrategiesResponse>(
                service, METHODID_GET_STRATEGIES)))
        .addMethod(
          getGetSignalsMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              ru.tinkoff.piapi.contract.v1.GetSignalsRequest,
              ru.tinkoff.piapi.contract.v1.GetSignalsResponse>(
                service, METHODID_GET_SIGNALS)))
        .build();
  }

  private static abstract class SignalServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    SignalServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return ru.tinkoff.piapi.contract.v1.Signals.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("SignalService");
    }
  }

  private static final class SignalServiceFileDescriptorSupplier
      extends SignalServiceBaseDescriptorSupplier {
    SignalServiceFileDescriptorSupplier() {}
  }

  private static final class SignalServiceMethodDescriptorSupplier
      extends SignalServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    SignalServiceMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (SignalServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new SignalServiceFileDescriptorSupplier())
              .addMethod(getGetStrategiesMethod())
              .addMethod(getGetSignalsMethod())
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy