package com.ywt.gapi.system;

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 项目的 SystemServiceImpl 类
 * </pre>
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.7.2-SNAPSHOT)",
    comments = "Source: system.proto")
public final class SystemServiceGrpc {

  private SystemServiceGrpc() {}

  public static final String SERVICE_NAME = "com.ywt.gapi.system.SystemService";

  // 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.system.HospitalListRequest,
      com.ywt.gapi.system.HospitalListResponse> METHOD_GET_HOSPITAL_LIST =
      io.grpc.MethodDescriptor.<com.ywt.gapi.system.HospitalListRequest, com.ywt.gapi.system.HospitalListResponse>newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "com.ywt.gapi.system.SystemService", "getHospitalList"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              com.ywt.gapi.system.HospitalListRequest.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              com.ywt.gapi.system.HospitalListResponse.getDefaultInstance()))
          .setSchemaDescriptor(new SystemServiceMethodDescriptorSupplier("getHospitalList"))
          .build();
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor<com.ywt.gapi.system.AreaListRequest,
      com.ywt.gapi.system.AreaListResponse> METHOD_GET_APP_AREA_LIST =
      io.grpc.MethodDescriptor.<com.ywt.gapi.system.AreaListRequest, com.ywt.gapi.system.AreaListResponse>newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "com.ywt.gapi.system.SystemService", "getAppAreaList"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              com.ywt.gapi.system.AreaListRequest.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              com.ywt.gapi.system.AreaListResponse.getDefaultInstance()))
          .setSchemaDescriptor(new SystemServiceMethodDescriptorSupplier("getAppAreaList"))
          .build();

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

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

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

  /**
   * <pre>
   * 对应 rpc 项目的 SystemServiceImpl 类
   * </pre>
   */
  public static abstract class SystemServiceImplBase implements io.grpc.BindableService {

    /**
     * <pre>
     *获取医院列表
     * </pre>
     */
    public void getHospitalList(com.ywt.gapi.system.HospitalListRequest request,
        io.grpc.stub.StreamObserver<com.ywt.gapi.system.HospitalListResponse> responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_GET_HOSPITAL_LIST, responseObserver);
    }

    /**
     * <pre>
     *获取地区
     * </pre>
     */
    public void getAppAreaList(com.ywt.gapi.system.AreaListRequest request,
        io.grpc.stub.StreamObserver<com.ywt.gapi.system.AreaListResponse> responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_GET_APP_AREA_LIST, responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            METHOD_GET_HOSPITAL_LIST,
            asyncUnaryCall(
              new MethodHandlers<
                com.ywt.gapi.system.HospitalListRequest,
                com.ywt.gapi.system.HospitalListResponse>(
                  this, METHODID_GET_HOSPITAL_LIST)))
          .addMethod(
            METHOD_GET_APP_AREA_LIST,
            asyncUnaryCall(
              new MethodHandlers<
                com.ywt.gapi.system.AreaListRequest,
                com.ywt.gapi.system.AreaListResponse>(
                  this, METHODID_GET_APP_AREA_LIST)))
          .build();
    }
  }

  /**
   * <pre>
   * 对应 rpc 项目的 SystemServiceImpl 类
   * </pre>
   */
  public static final class SystemServiceStub extends io.grpc.stub.AbstractStub<SystemServiceStub> {
    private SystemServiceStub(io.grpc.Channel channel) {
      super(channel);
    }

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

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

    /**
     * <pre>
     *获取医院列表
     * </pre>
     */
    public void getHospitalList(com.ywt.gapi.system.HospitalListRequest request,
        io.grpc.stub.StreamObserver<com.ywt.gapi.system.HospitalListResponse> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_GET_HOSPITAL_LIST, getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     *获取地区
     * </pre>
     */
    public void getAppAreaList(com.ywt.gapi.system.AreaListRequest request,
        io.grpc.stub.StreamObserver<com.ywt.gapi.system.AreaListResponse> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_GET_APP_AREA_LIST, getCallOptions()), request, responseObserver);
    }
  }

  /**
   * <pre>
   * 对应 rpc 项目的 SystemServiceImpl 类
   * </pre>
   */
  public static final class SystemServiceBlockingStub extends io.grpc.stub.AbstractStub<SystemServiceBlockingStub> {
    private SystemServiceBlockingStub(io.grpc.Channel channel) {
      super(channel);
    }

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

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

    /**
     * <pre>
     *获取医院列表
     * </pre>
     */
    public com.ywt.gapi.system.HospitalListResponse getHospitalList(com.ywt.gapi.system.HospitalListRequest request) {
      return blockingUnaryCall(
          getChannel(), METHOD_GET_HOSPITAL_LIST, getCallOptions(), request);
    }

    /**
     * <pre>
     *获取地区
     * </pre>
     */
    public com.ywt.gapi.system.AreaListResponse getAppAreaList(com.ywt.gapi.system.AreaListRequest request) {
      return blockingUnaryCall(
          getChannel(), METHOD_GET_APP_AREA_LIST, getCallOptions(), request);
    }
  }

  /**
   * <pre>
   * 对应 rpc 项目的 SystemServiceImpl 类
   * </pre>
   */
  public static final class SystemServiceFutureStub extends io.grpc.stub.AbstractStub<SystemServiceFutureStub> {
    private SystemServiceFutureStub(io.grpc.Channel channel) {
      super(channel);
    }

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

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

    /**
     * <pre>
     *获取医院列表
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<com.ywt.gapi.system.HospitalListResponse> getHospitalList(
        com.ywt.gapi.system.HospitalListRequest request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_GET_HOSPITAL_LIST, getCallOptions()), request);
    }

    /**
     * <pre>
     *获取地区
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<com.ywt.gapi.system.AreaListResponse> getAppAreaList(
        com.ywt.gapi.system.AreaListRequest request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_GET_APP_AREA_LIST, getCallOptions()), request);
    }
  }

  private static final int METHODID_GET_HOSPITAL_LIST = 0;
  private static final int METHODID_GET_APP_AREA_LIST = 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 SystemServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(SystemServiceImplBase 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_HOSPITAL_LIST:
          serviceImpl.getHospitalList((com.ywt.gapi.system.HospitalListRequest) request,
              (io.grpc.stub.StreamObserver<com.ywt.gapi.system.HospitalListResponse>) responseObserver);
          break;
        case METHODID_GET_APP_AREA_LIST:
          serviceImpl.getAppAreaList((com.ywt.gapi.system.AreaListRequest) request,
              (io.grpc.stub.StreamObserver<com.ywt.gapi.system.AreaListResponse>) 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 SystemServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    SystemServiceBaseDescriptorSupplier() {}

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

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

  private static final class SystemServiceFileDescriptorSupplier
      extends SystemServiceBaseDescriptorSupplier {
    SystemServiceFileDescriptorSupplier() {}
  }

  private static final class SystemServiceMethodDescriptorSupplier
      extends SystemServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    SystemServiceMethodDescriptorSupplier(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 (SystemServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new SystemServiceFileDescriptorSupplier())
              .addMethod(METHOD_GET_HOSPITAL_LIST)
              .addMethod(METHOD_GET_APP_AREA_LIST)
              .build();
        }
      }
    }
    return result;
  }
}
