package com.tzld.piaoquan.recommend.server.gen.recommend;

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/server/recommend.proto")
public final class RecommendServiceGrpc {

  private RecommendServiceGrpc() {}

  public static final String SERVICE_NAME = "RecommendService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest,
      com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> getHomepageRecommendMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "HomepageRecommend",
      requestType = com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest.class,
      responseType = com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest,
      com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> getHomepageRecommendMethod() {
    io.grpc.MethodDescriptor<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest, com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> getHomepageRecommendMethod;
    if ((getHomepageRecommendMethod = RecommendServiceGrpc.getHomepageRecommendMethod) == null) {
      synchronized (RecommendServiceGrpc.class) {
        if ((getHomepageRecommendMethod = RecommendServiceGrpc.getHomepageRecommendMethod) == null) {
          RecommendServiceGrpc.getHomepageRecommendMethod = getHomepageRecommendMethod =
              io.grpc.MethodDescriptor.<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest, com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "HomepageRecommend"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse.getDefaultInstance()))
              .setSchemaDescriptor(new RecommendServiceMethodDescriptorSupplier("HomepageRecommend"))
              .build();
        }
      }
    }
    return getHomepageRecommendMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest,
      com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> getRelevantRecommendMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "RelevantRecommend",
      requestType = com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest.class,
      responseType = com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest,
      com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> getRelevantRecommendMethod() {
    io.grpc.MethodDescriptor<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest, com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> getRelevantRecommendMethod;
    if ((getRelevantRecommendMethod = RecommendServiceGrpc.getRelevantRecommendMethod) == null) {
      synchronized (RecommendServiceGrpc.class) {
        if ((getRelevantRecommendMethod = RecommendServiceGrpc.getRelevantRecommendMethod) == null) {
          RecommendServiceGrpc.getRelevantRecommendMethod = getRelevantRecommendMethod =
              io.grpc.MethodDescriptor.<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest, com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RelevantRecommend"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse.getDefaultInstance()))
              .setSchemaDescriptor(new RecommendServiceMethodDescriptorSupplier("RelevantRecommend"))
              .build();
        }
      }
    }
    return getRelevantRecommendMethod;
  }

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

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

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

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

    /**
     * <pre>
     * 首页推荐和tab分类 /applet/video/homepage/recommend
     * </pre>
     */
    public void homepageRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request,
        io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> responseObserver) {
      asyncUnimplementedUnaryCall(getHomepageRecommendMethod(), responseObserver);
    }

    /**
     */
    public void relevantRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request,
        io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> responseObserver) {
      asyncUnimplementedUnaryCall(getRelevantRecommendMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getHomepageRecommendMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest,
                com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse>(
                  this, METHODID_HOMEPAGE_RECOMMEND)))
          .addMethod(
            getRelevantRecommendMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest,
                com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse>(
                  this, METHODID_RELEVANT_RECOMMEND)))
          .build();
    }
  }

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

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

    /**
     * <pre>
     * 首页推荐和tab分类 /applet/video/homepage/recommend
     * </pre>
     */
    public void homepageRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request,
        io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getHomepageRecommendMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void relevantRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request,
        io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getRelevantRecommendMethod(), getCallOptions()), request, responseObserver);
    }
  }

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

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

    /**
     * <pre>
     * 首页推荐和tab分类 /applet/video/homepage/recommend
     * </pre>
     */
    public com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse homepageRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request) {
      return blockingUnaryCall(
          getChannel(), getHomepageRecommendMethod(), getCallOptions(), request);
    }

    /**
     */
    public com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse relevantRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request) {
      return blockingUnaryCall(
          getChannel(), getRelevantRecommendMethod(), getCallOptions(), request);
    }
  }

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

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

    /**
     * <pre>
     * 首页推荐和tab分类 /applet/video/homepage/recommend
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> homepageRecommend(
        com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getHomepageRecommendMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> relevantRecommend(
        com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getRelevantRecommendMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_HOMEPAGE_RECOMMEND = 0;
  private static final int METHODID_RELEVANT_RECOMMEND = 1;

  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 RecommendServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(RecommendServiceImplBase 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_HOMEPAGE_RECOMMEND:
          serviceImpl.homepageRecommend((com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest) request,
              (io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse>) responseObserver);
          break;
        case METHODID_RELEVANT_RECOMMEND:
          serviceImpl.relevantRecommend((com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest) request,
              (io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse>) 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 RecommendServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    RecommendServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.tzld.piaoquan.recommend.server.gen.recommend.Recommend.getDescriptor();
    }

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

  private static final class RecommendServiceFileDescriptorSupplier
      extends RecommendServiceBaseDescriptorSupplier {
    RecommendServiceFileDescriptorSupplier() {}
  }

  private static final class RecommendServiceMethodDescriptorSupplier
      extends RecommendServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    RecommendServiceMethodDescriptorSupplier(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 (RecommendServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new RecommendServiceFileDescriptorSupplier())
              .addMethod(getHomepageRecommendMethod())
              .addMethod(getRelevantRecommendMethod())
              .build();
        }
      }
    }
    return result;
  }
}
