package com.ywt.gapi.user;

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

/**
 * <pre>
 *医生相关服务      // 对应 rpc 项目的 DoctorServiceImpl 类
 * </pre>
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.7.2-SNAPSHOT)",
    comments = "Source: doctor.proto")
public final class DoctorServiceGrpc {

  private DoctorServiceGrpc() {}

  public static final String SERVICE_NAME = "com.ywt.gapi.user.DoctorService";

  // Static method descriptors that strictly reflect the proto.
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor<com.ywt.gapi.user.GetDoctorAllRequest,
      com.ywt.gapi.user.GetDoctorAllResponse> METHOD_GET_DOCTOR_ALL =
      io.grpc.MethodDescriptor.<com.ywt.gapi.user.GetDoctorAllRequest, com.ywt.gapi.user.GetDoctorAllResponse>newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "com.ywt.gapi.user.DoctorService", "getDoctorAll"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              com.ywt.gapi.user.GetDoctorAllRequest.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              com.ywt.gapi.user.GetDoctorAllResponse.getDefaultInstance()))
          .setSchemaDescriptor(new DoctorServiceMethodDescriptorSupplier("getDoctorAll"))
          .build();

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static DoctorServiceStub newStub(io.grpc.Channel channel) {
    return new DoctorServiceStub(channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static DoctorServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    return new DoctorServiceBlockingStub(channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static DoctorServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    return new DoctorServiceFutureStub(channel);
  }

  /**
   * <pre>
   *医生相关服务      // 对应 rpc 项目的 DoctorServiceImpl 类
   * </pre>
   */
  public static abstract class DoctorServiceImplBase implements io.grpc.BindableService {

    /**
     * <pre>
     *获取所有医生信息
     * </pre>
     */
    public void getDoctorAll(com.ywt.gapi.user.GetDoctorAllRequest request,
        io.grpc.stub.StreamObserver<com.ywt.gapi.user.GetDoctorAllResponse> responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_GET_DOCTOR_ALL, responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            METHOD_GET_DOCTOR_ALL,
            asyncUnaryCall(
              new MethodHandlers<
                com.ywt.gapi.user.GetDoctorAllRequest,
                com.ywt.gapi.user.GetDoctorAllResponse>(
                  this, METHODID_GET_DOCTOR_ALL)))
          .build();
    }
  }

  /**
   * <pre>
   *医生相关服务      // 对应 rpc 项目的 DoctorServiceImpl 类
   * </pre>
   */
  public static final class DoctorServiceStub extends io.grpc.stub.AbstractStub<DoctorServiceStub> {
    private DoctorServiceStub(io.grpc.Channel channel) {
      super(channel);
    }

    private DoctorServiceStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     * <pre>
     *获取所有医生信息
     * </pre>
     */
    public void getDoctorAll(com.ywt.gapi.user.GetDoctorAllRequest request,
        io.grpc.stub.StreamObserver<com.ywt.gapi.user.GetDoctorAllResponse> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_GET_DOCTOR_ALL, getCallOptions()), request, responseObserver);
    }
  }

  /**
   * <pre>
   *医生相关服务      // 对应 rpc 项目的 DoctorServiceImpl 类
   * </pre>
   */
  public static final class DoctorServiceBlockingStub extends io.grpc.stub.AbstractStub<DoctorServiceBlockingStub> {
    private DoctorServiceBlockingStub(io.grpc.Channel channel) {
      super(channel);
    }

    private DoctorServiceBlockingStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     * <pre>
     *获取所有医生信息
     * </pre>
     */
    public com.ywt.gapi.user.GetDoctorAllResponse getDoctorAll(com.ywt.gapi.user.GetDoctorAllRequest request) {
      return blockingUnaryCall(
          getChannel(), METHOD_GET_DOCTOR_ALL, getCallOptions(), request);
    }
  }

  /**
   * <pre>
   *医生相关服务      // 对应 rpc 项目的 DoctorServiceImpl 类
   * </pre>
   */
  public static final class DoctorServiceFutureStub extends io.grpc.stub.AbstractStub<DoctorServiceFutureStub> {
    private DoctorServiceFutureStub(io.grpc.Channel channel) {
      super(channel);
    }

    private DoctorServiceFutureStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     * <pre>
     *获取所有医生信息
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<com.ywt.gapi.user.GetDoctorAllResponse> getDoctorAll(
        com.ywt.gapi.user.GetDoctorAllRequest request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_GET_DOCTOR_ALL, getCallOptions()), request);
    }
  }

  private static final int METHODID_GET_DOCTOR_ALL = 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 DoctorServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(DoctorServiceImplBase 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_GET_DOCTOR_ALL:
          serviceImpl.getDoctorAll((com.ywt.gapi.user.GetDoctorAllRequest) request,
              (io.grpc.stub.StreamObserver<com.ywt.gapi.user.GetDoctorAllResponse>) 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 DoctorServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    DoctorServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.ywt.gapi.user.DoctorOuterClass.getDescriptor();
    }

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

  private static final class DoctorServiceFileDescriptorSupplier
      extends DoctorServiceBaseDescriptorSupplier {
    DoctorServiceFileDescriptorSupplier() {}
  }

  private static final class DoctorServiceMethodDescriptorSupplier
      extends DoctorServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    DoctorServiceMethodDescriptorSupplier(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 (DoctorServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new DoctorServiceFileDescriptorSupplier())
              .addMethod(METHOD_GET_DOCTOR_ALL)
              .build();
        }
      }
    }
    return result;
  }
}
