package com.tzld.piaoquan.recommend.model.grpc.model;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.34.1)",
    comments = "Source: com/tzld/piaoquan/recommend/model/predict.proto")
public final class PredictServiceGrpc {

  private PredictServiceGrpc() {}

  public static final String SERVICE_NAME = "PredictService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest,
      com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse> getPredictMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "predict",
      requestType = com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest.class,
      responseType = com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest,
      com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse> getPredictMethod() {
    io.grpc.MethodDescriptor<com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest, com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse> getPredictMethod;
    if ((getPredictMethod = PredictServiceGrpc.getPredictMethod) == null) {
      synchronized (PredictServiceGrpc.class) {
        if ((getPredictMethod = PredictServiceGrpc.getPredictMethod) == null) {
          PredictServiceGrpc.getPredictMethod = getPredictMethod =
              io.grpc.MethodDescriptor.<com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest, com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "predict"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse.getDefaultInstance()))
              .setSchemaDescriptor(new PredictServiceMethodDescriptorSupplier("predict"))
              .build();
        }
      }
    }
    return getPredictMethod;
  }

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

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

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

  /**
   */
  public static abstract class PredictServiceImplBase implements io.grpc.BindableService {

    /**
     */
    public void predict(com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest request,
        io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse> responseObserver) {
      asyncUnimplementedUnaryCall(getPredictMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getPredictMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest,
                com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse>(
                  this, METHODID_PREDICT)))
          .build();
    }
  }

  /**
   */
  public static final class PredictServiceStub extends io.grpc.stub.AbstractAsyncStub<PredictServiceStub> {
    private PredictServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     */
    public void predict(com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest request,
        io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getPredictMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   */
  public static final class PredictServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<PredictServiceBlockingStub> {
    private PredictServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     */
    public com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse predict(com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest request) {
      return blockingUnaryCall(
          getChannel(), getPredictMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class PredictServiceFutureStub extends io.grpc.stub.AbstractFutureStub<PredictServiceFutureStub> {
    private PredictServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse> predict(
        com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getPredictMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_PREDICT = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final PredictServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(PredictServiceImplBase 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<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_PREDICT:
          serviceImpl.predict((com.tzld.piaoquan.recommend.model.grpc.model.PredictRequest) request,
              (io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.model.grpc.model.PredictResponse>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

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

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

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.tzld.piaoquan.recommend.model.grpc.model.Predict.getDescriptor();
    }

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

  private static final class PredictServiceFileDescriptorSupplier
      extends PredictServiceBaseDescriptorSupplier {
    PredictServiceFileDescriptorSupplier() {}
  }

  private static final class PredictServiceMethodDescriptorSupplier
      extends PredictServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    PredictServiceMethodDescriptorSupplier(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 (PredictServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new PredictServiceFileDescriptorSupplier())
              .addMethod(getPredictMethod())
              .build();
        }
      }
    }
    return result;
  }
}
