/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

    package com.ywt.gapi.im;

import org.apache.dubbo.common.stream.StreamObserver;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.PathResolver;
import org.apache.dubbo.rpc.RpcException;
import org.apache.dubbo.rpc.ServerService;
import org.apache.dubbo.rpc.TriRpcStatus;
import org.apache.dubbo.rpc.model.MethodDescriptor;
import org.apache.dubbo.rpc.model.ServiceDescriptor;
import org.apache.dubbo.rpc.model.StubMethodDescriptor;
import org.apache.dubbo.rpc.model.StubServiceDescriptor;
import org.apache.dubbo.rpc.stub.BiStreamMethodHandler;
import org.apache.dubbo.rpc.stub.ServerStreamMethodHandler;
import org.apache.dubbo.rpc.stub.StubInvocationUtil;
import org.apache.dubbo.rpc.stub.StubInvoker;
import org.apache.dubbo.rpc.stub.StubMethodHandler;
import org.apache.dubbo.rpc.stub.StubSuppliers;
import org.apache.dubbo.rpc.stub.UnaryStubMethodHandler;

import com.google.protobuf.Message;

import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.concurrent.CompletableFuture;

public final class DubboIMServiceTriple {

    public static final String SERVICE_NAME = IMService.SERVICE_NAME;

    private static final StubServiceDescriptor serviceDescriptor = new StubServiceDescriptor(SERVICE_NAME,IMService.class);

    static {
        org.apache.dubbo.rpc.protocol.tri.service.SchemaDescriptorRegistry.addSchemaDescriptor(SERVICE_NAME,ImProto.getDescriptor());
        StubSuppliers.addSupplier(SERVICE_NAME, DubboIMServiceTriple::newStub);
        StubSuppliers.addSupplier(IMService.JAVA_SERVICE_NAME,  DubboIMServiceTriple::newStub);
        StubSuppliers.addDescriptor(SERVICE_NAME, serviceDescriptor);
        StubSuppliers.addDescriptor(IMService.JAVA_SERVICE_NAME, serviceDescriptor);
    }

    @SuppressWarnings("all")
    public static IMService newStub(Invoker<?> invoker) {
        return new IMServiceStub((Invoker<IMService>)invoker);
    }

    private static final StubMethodDescriptor sendNoticeMessageMethod = new StubMethodDescriptor("sendNoticeMessage",
    com.ywt.gapi.im.NoticeMessage.class, com.ywt.gapi.im.SendResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.NoticeMessage::parseFrom,
    com.ywt.gapi.im.SendResponse::parseFrom);

    private static final StubMethodDescriptor sendNoticeMessageAsyncMethod = new StubMethodDescriptor("sendNoticeMessage",
    com.ywt.gapi.im.NoticeMessage.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.NoticeMessage::parseFrom,
    com.ywt.gapi.im.SendResponse::parseFrom);

    private static final StubMethodDescriptor sendNoticeMessageProxyAsyncMethod = new StubMethodDescriptor("sendNoticeMessageAsync",
    com.ywt.gapi.im.NoticeMessage.class, com.ywt.gapi.im.SendResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.NoticeMessage::parseFrom,
    com.ywt.gapi.im.SendResponse::parseFrom);

    private static final StubMethodDescriptor sendSessionMessageMethod = new StubMethodDescriptor("sendSessionMessage",
    com.ywt.gapi.im.SessionMessage.class, com.ywt.gapi.im.SendResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SessionMessage::parseFrom,
    com.ywt.gapi.im.SendResponse::parseFrom);

    private static final StubMethodDescriptor sendSessionMessageAsyncMethod = new StubMethodDescriptor("sendSessionMessage",
    com.ywt.gapi.im.SessionMessage.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SessionMessage::parseFrom,
    com.ywt.gapi.im.SendResponse::parseFrom);

    private static final StubMethodDescriptor sendSessionMessageProxyAsyncMethod = new StubMethodDescriptor("sendSessionMessageAsync",
    com.ywt.gapi.im.SessionMessage.class, com.ywt.gapi.im.SendResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SessionMessage::parseFrom,
    com.ywt.gapi.im.SendResponse::parseFrom);

    private static final StubMethodDescriptor pullSessionMessageRecordMethod = new StubMethodDescriptor("pullSessionMessageRecord",
    com.ywt.gapi.im.PullSessionMessageRecordRequest.class, com.ywt.gapi.im.SessionMessageRecordResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.PullSessionMessageRecordRequest::parseFrom,
    com.ywt.gapi.im.SessionMessageRecordResponse::parseFrom);

    private static final StubMethodDescriptor pullSessionMessageRecordAsyncMethod = new StubMethodDescriptor("pullSessionMessageRecord",
    com.ywt.gapi.im.PullSessionMessageRecordRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.PullSessionMessageRecordRequest::parseFrom,
    com.ywt.gapi.im.SessionMessageRecordResponse::parseFrom);

    private static final StubMethodDescriptor pullSessionMessageRecordProxyAsyncMethod = new StubMethodDescriptor("pullSessionMessageRecordAsync",
    com.ywt.gapi.im.PullSessionMessageRecordRequest.class, com.ywt.gapi.im.SessionMessageRecordResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.PullSessionMessageRecordRequest::parseFrom,
    com.ywt.gapi.im.SessionMessageRecordResponse::parseFrom);

    private static final StubMethodDescriptor pullNoticeMessageMethod = new StubMethodDescriptor("pullNoticeMessage",
    com.ywt.gapi.im.PullNoticeMessageRequest.class, com.ywt.gapi.im.NoticeMessageResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.PullNoticeMessageRequest::parseFrom,
    com.ywt.gapi.im.NoticeMessageResponse::parseFrom);

    private static final StubMethodDescriptor pullNoticeMessageAsyncMethod = new StubMethodDescriptor("pullNoticeMessage",
    com.ywt.gapi.im.PullNoticeMessageRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.PullNoticeMessageRequest::parseFrom,
    com.ywt.gapi.im.NoticeMessageResponse::parseFrom);

    private static final StubMethodDescriptor pullNoticeMessageProxyAsyncMethod = new StubMethodDescriptor("pullNoticeMessageAsync",
    com.ywt.gapi.im.PullNoticeMessageRequest.class, com.ywt.gapi.im.NoticeMessageResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.PullNoticeMessageRequest::parseFrom,
    com.ywt.gapi.im.NoticeMessageResponse::parseFrom);

    private static final StubMethodDescriptor issueTokenMethod = new StubMethodDescriptor("issueToken",
    com.ywt.gapi.im.IssueTokenRequest.class, com.ywt.gapi.im.IssueTokenResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.IssueTokenRequest::parseFrom,
    com.ywt.gapi.im.IssueTokenResponse::parseFrom);

    private static final StubMethodDescriptor issueTokenAsyncMethod = new StubMethodDescriptor("issueToken",
    com.ywt.gapi.im.IssueTokenRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.IssueTokenRequest::parseFrom,
    com.ywt.gapi.im.IssueTokenResponse::parseFrom);

    private static final StubMethodDescriptor issueTokenProxyAsyncMethod = new StubMethodDescriptor("issueTokenAsync",
    com.ywt.gapi.im.IssueTokenRequest.class, com.ywt.gapi.im.IssueTokenResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.IssueTokenRequest::parseFrom,
    com.ywt.gapi.im.IssueTokenResponse::parseFrom);

    private static final StubMethodDescriptor checkTokenMethod = new StubMethodDescriptor("checkToken",
    com.ywt.gapi.im.CheckTokenRequest.class, com.ywt.gapi.im.CheckTokenResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.CheckTokenRequest::parseFrom,
    com.ywt.gapi.im.CheckTokenResponse::parseFrom);

    private static final StubMethodDescriptor checkTokenAsyncMethod = new StubMethodDescriptor("checkToken",
    com.ywt.gapi.im.CheckTokenRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.CheckTokenRequest::parseFrom,
    com.ywt.gapi.im.CheckTokenResponse::parseFrom);

    private static final StubMethodDescriptor checkTokenProxyAsyncMethod = new StubMethodDescriptor("checkTokenAsync",
    com.ywt.gapi.im.CheckTokenRequest.class, com.ywt.gapi.im.CheckTokenResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.CheckTokenRequest::parseFrom,
    com.ywt.gapi.im.CheckTokenResponse::parseFrom);

    private static final StubMethodDescriptor saveSessionMessageMethod = new StubMethodDescriptor("saveSessionMessage",
    com.ywt.gapi.im.SaveSessionMessageRequest.class, com.ywt.gapi.im.SaveSessionMessageResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SaveSessionMessageRequest::parseFrom,
    com.ywt.gapi.im.SaveSessionMessageResponse::parseFrom);

    private static final StubMethodDescriptor saveSessionMessageAsyncMethod = new StubMethodDescriptor("saveSessionMessage",
    com.ywt.gapi.im.SaveSessionMessageRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SaveSessionMessageRequest::parseFrom,
    com.ywt.gapi.im.SaveSessionMessageResponse::parseFrom);

    private static final StubMethodDescriptor saveSessionMessageProxyAsyncMethod = new StubMethodDescriptor("saveSessionMessageAsync",
    com.ywt.gapi.im.SaveSessionMessageRequest.class, com.ywt.gapi.im.SaveSessionMessageResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SaveSessionMessageRequest::parseFrom,
    com.ywt.gapi.im.SaveSessionMessageResponse::parseFrom);

    /**
         * <pre>
         * 消息类型：1 文本消息 2 图片消息 3 病历消息
         * </pre>
         */
    private static final StubMethodDescriptor saveNoticeMessageMethod = new StubMethodDescriptor("saveNoticeMessage",
    com.ywt.gapi.im.SaveNoticeMessageRequest.class, com.ywt.gapi.im.SaveNoticeMessageResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SaveNoticeMessageRequest::parseFrom,
    com.ywt.gapi.im.SaveNoticeMessageResponse::parseFrom);

    private static final StubMethodDescriptor saveNoticeMessageAsyncMethod = new StubMethodDescriptor("saveNoticeMessage",
    com.ywt.gapi.im.SaveNoticeMessageRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SaveNoticeMessageRequest::parseFrom,
    com.ywt.gapi.im.SaveNoticeMessageResponse::parseFrom);

    private static final StubMethodDescriptor saveNoticeMessageProxyAsyncMethod = new StubMethodDescriptor("saveNoticeMessageAsync",
    com.ywt.gapi.im.SaveNoticeMessageRequest.class, com.ywt.gapi.im.SaveNoticeMessageResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SaveNoticeMessageRequest::parseFrom,
    com.ywt.gapi.im.SaveNoticeMessageResponse::parseFrom);

    private static final StubMethodDescriptor recallMethod = new StubMethodDescriptor("recall",
    com.ywt.gapi.im.RecallRequest.class, com.ywt.gapi.im.RecallResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.RecallRequest::parseFrom,
    com.ywt.gapi.im.RecallResponse::parseFrom);

    private static final StubMethodDescriptor recallAsyncMethod = new StubMethodDescriptor("recall",
    com.ywt.gapi.im.RecallRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.RecallRequest::parseFrom,
    com.ywt.gapi.im.RecallResponse::parseFrom);

    private static final StubMethodDescriptor recallProxyAsyncMethod = new StubMethodDescriptor("recallAsync",
    com.ywt.gapi.im.RecallRequest.class, com.ywt.gapi.im.RecallResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.RecallRequest::parseFrom,
    com.ywt.gapi.im.RecallResponse::parseFrom);

    private static final StubMethodDescriptor sessionCountMethod = new StubMethodDescriptor("sessionCount",
    com.ywt.gapi.im.SessionCountRequest.class, com.ywt.gapi.im.SessionCountResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SessionCountRequest::parseFrom,
    com.ywt.gapi.im.SessionCountResponse::parseFrom);

    private static final StubMethodDescriptor sessionCountAsyncMethod = new StubMethodDescriptor("sessionCount",
    com.ywt.gapi.im.SessionCountRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SessionCountRequest::parseFrom,
    com.ywt.gapi.im.SessionCountResponse::parseFrom);

    private static final StubMethodDescriptor sessionCountProxyAsyncMethod = new StubMethodDescriptor("sessionCountAsync",
    com.ywt.gapi.im.SessionCountRequest.class, com.ywt.gapi.im.SessionCountResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.SessionCountRequest::parseFrom,
    com.ywt.gapi.im.SessionCountResponse::parseFrom);

    private static final StubMethodDescriptor getChatsMethod = new StubMethodDescriptor("getChats",
    com.ywt.gapi.im.GetChatsRequest.class, com.ywt.gapi.im.GetChatsResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.GetChatsRequest::parseFrom,
    com.ywt.gapi.im.GetChatsResponse::parseFrom);

    private static final StubMethodDescriptor getChatsAsyncMethod = new StubMethodDescriptor("getChats",
    com.ywt.gapi.im.GetChatsRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.GetChatsRequest::parseFrom,
    com.ywt.gapi.im.GetChatsResponse::parseFrom);

    private static final StubMethodDescriptor getChatsProxyAsyncMethod = new StubMethodDescriptor("getChatsAsync",
    com.ywt.gapi.im.GetChatsRequest.class, com.ywt.gapi.im.GetChatsResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.GetChatsRequest::parseFrom,
    com.ywt.gapi.im.GetChatsResponse::parseFrom);

    private static final StubMethodDescriptor notifyNewPublishForDocMethod = new StubMethodDescriptor("notifyNewPublishForDoc",
    com.ywt.gapi.im.NotifyNewPublishForDocRequest.class, com.ywt.gapi.im.SendResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.NotifyNewPublishForDocRequest::parseFrom,
    com.ywt.gapi.im.SendResponse::parseFrom);

    private static final StubMethodDescriptor notifyNewPublishForDocAsyncMethod = new StubMethodDescriptor("notifyNewPublishForDoc",
    com.ywt.gapi.im.NotifyNewPublishForDocRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.NotifyNewPublishForDocRequest::parseFrom,
    com.ywt.gapi.im.SendResponse::parseFrom);

    private static final StubMethodDescriptor notifyNewPublishForDocProxyAsyncMethod = new StubMethodDescriptor("notifyNewPublishForDocAsync",
    com.ywt.gapi.im.NotifyNewPublishForDocRequest.class, com.ywt.gapi.im.SendResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.NotifyNewPublishForDocRequest::parseFrom,
    com.ywt.gapi.im.SendResponse::parseFrom);

    private static final StubMethodDescriptor updateSessionMsgMethod = new StubMethodDescriptor("updateSessionMsg",
    com.ywt.gapi.im.UpdateMsgRequest.class, com.ywt.gapi.im.UpdateMsgResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.UpdateMsgRequest::parseFrom,
    com.ywt.gapi.im.UpdateMsgResponse::parseFrom);

    private static final StubMethodDescriptor updateSessionMsgAsyncMethod = new StubMethodDescriptor("updateSessionMsg",
    com.ywt.gapi.im.UpdateMsgRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.UpdateMsgRequest::parseFrom,
    com.ywt.gapi.im.UpdateMsgResponse::parseFrom);

    private static final StubMethodDescriptor updateSessionMsgProxyAsyncMethod = new StubMethodDescriptor("updateSessionMsgAsync",
    com.ywt.gapi.im.UpdateMsgRequest.class, com.ywt.gapi.im.UpdateMsgResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.im.UpdateMsgRequest::parseFrom,
    com.ywt.gapi.im.UpdateMsgResponse::parseFrom);





    public static class IMServiceStub implements IMService{
        private final Invoker<IMService> invoker;

        public IMServiceStub(Invoker<IMService> invoker) {
            this.invoker = invoker;
        }

        @Override
        public com.ywt.gapi.im.SendResponse sendNoticeMessage(com.ywt.gapi.im.NoticeMessage request){
            return StubInvocationUtil.unaryCall(invoker, sendNoticeMessageMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.SendResponse> sendNoticeMessageAsync(com.ywt.gapi.im.NoticeMessage request){
            return StubInvocationUtil.unaryCall(invoker, sendNoticeMessageAsyncMethod, request);
        }

        @Override
        public void sendNoticeMessage(com.ywt.gapi.im.NoticeMessage request, StreamObserver<com.ywt.gapi.im.SendResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, sendNoticeMessageMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.SendResponse sendSessionMessage(com.ywt.gapi.im.SessionMessage request){
            return StubInvocationUtil.unaryCall(invoker, sendSessionMessageMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.SendResponse> sendSessionMessageAsync(com.ywt.gapi.im.SessionMessage request){
            return StubInvocationUtil.unaryCall(invoker, sendSessionMessageAsyncMethod, request);
        }

        @Override
        public void sendSessionMessage(com.ywt.gapi.im.SessionMessage request, StreamObserver<com.ywt.gapi.im.SendResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, sendSessionMessageMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.SessionMessageRecordResponse pullSessionMessageRecord(com.ywt.gapi.im.PullSessionMessageRecordRequest request){
            return StubInvocationUtil.unaryCall(invoker, pullSessionMessageRecordMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.SessionMessageRecordResponse> pullSessionMessageRecordAsync(com.ywt.gapi.im.PullSessionMessageRecordRequest request){
            return StubInvocationUtil.unaryCall(invoker, pullSessionMessageRecordAsyncMethod, request);
        }

        @Override
        public void pullSessionMessageRecord(com.ywt.gapi.im.PullSessionMessageRecordRequest request, StreamObserver<com.ywt.gapi.im.SessionMessageRecordResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, pullSessionMessageRecordMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.NoticeMessageResponse pullNoticeMessage(com.ywt.gapi.im.PullNoticeMessageRequest request){
            return StubInvocationUtil.unaryCall(invoker, pullNoticeMessageMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.NoticeMessageResponse> pullNoticeMessageAsync(com.ywt.gapi.im.PullNoticeMessageRequest request){
            return StubInvocationUtil.unaryCall(invoker, pullNoticeMessageAsyncMethod, request);
        }

        @Override
        public void pullNoticeMessage(com.ywt.gapi.im.PullNoticeMessageRequest request, StreamObserver<com.ywt.gapi.im.NoticeMessageResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, pullNoticeMessageMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.IssueTokenResponse issueToken(com.ywt.gapi.im.IssueTokenRequest request){
            return StubInvocationUtil.unaryCall(invoker, issueTokenMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.IssueTokenResponse> issueTokenAsync(com.ywt.gapi.im.IssueTokenRequest request){
            return StubInvocationUtil.unaryCall(invoker, issueTokenAsyncMethod, request);
        }

        @Override
        public void issueToken(com.ywt.gapi.im.IssueTokenRequest request, StreamObserver<com.ywt.gapi.im.IssueTokenResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, issueTokenMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.CheckTokenResponse checkToken(com.ywt.gapi.im.CheckTokenRequest request){
            return StubInvocationUtil.unaryCall(invoker, checkTokenMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.CheckTokenResponse> checkTokenAsync(com.ywt.gapi.im.CheckTokenRequest request){
            return StubInvocationUtil.unaryCall(invoker, checkTokenAsyncMethod, request);
        }

        @Override
        public void checkToken(com.ywt.gapi.im.CheckTokenRequest request, StreamObserver<com.ywt.gapi.im.CheckTokenResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, checkTokenMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.SaveSessionMessageResponse saveSessionMessage(com.ywt.gapi.im.SaveSessionMessageRequest request){
            return StubInvocationUtil.unaryCall(invoker, saveSessionMessageMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.SaveSessionMessageResponse> saveSessionMessageAsync(com.ywt.gapi.im.SaveSessionMessageRequest request){
            return StubInvocationUtil.unaryCall(invoker, saveSessionMessageAsyncMethod, request);
        }

        @Override
        public void saveSessionMessage(com.ywt.gapi.im.SaveSessionMessageRequest request, StreamObserver<com.ywt.gapi.im.SaveSessionMessageResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, saveSessionMessageMethod , request, responseObserver);
        }
            /**
         * <pre>
         * 消息类型：1 文本消息 2 图片消息 3 病历消息
         * </pre>
         */
        @Override
        public com.ywt.gapi.im.SaveNoticeMessageResponse saveNoticeMessage(com.ywt.gapi.im.SaveNoticeMessageRequest request){
            return StubInvocationUtil.unaryCall(invoker, saveNoticeMessageMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.SaveNoticeMessageResponse> saveNoticeMessageAsync(com.ywt.gapi.im.SaveNoticeMessageRequest request){
            return StubInvocationUtil.unaryCall(invoker, saveNoticeMessageAsyncMethod, request);
        }

            /**
         * <pre>
         * 消息类型：1 文本消息 2 图片消息 3 病历消息
         * </pre>
         */
        @Override
        public void saveNoticeMessage(com.ywt.gapi.im.SaveNoticeMessageRequest request, StreamObserver<com.ywt.gapi.im.SaveNoticeMessageResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, saveNoticeMessageMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.RecallResponse recall(com.ywt.gapi.im.RecallRequest request){
            return StubInvocationUtil.unaryCall(invoker, recallMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.RecallResponse> recallAsync(com.ywt.gapi.im.RecallRequest request){
            return StubInvocationUtil.unaryCall(invoker, recallAsyncMethod, request);
        }

        @Override
        public void recall(com.ywt.gapi.im.RecallRequest request, StreamObserver<com.ywt.gapi.im.RecallResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, recallMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.SessionCountResponse sessionCount(com.ywt.gapi.im.SessionCountRequest request){
            return StubInvocationUtil.unaryCall(invoker, sessionCountMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.SessionCountResponse> sessionCountAsync(com.ywt.gapi.im.SessionCountRequest request){
            return StubInvocationUtil.unaryCall(invoker, sessionCountAsyncMethod, request);
        }

        @Override
        public void sessionCount(com.ywt.gapi.im.SessionCountRequest request, StreamObserver<com.ywt.gapi.im.SessionCountResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, sessionCountMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.GetChatsResponse getChats(com.ywt.gapi.im.GetChatsRequest request){
            return StubInvocationUtil.unaryCall(invoker, getChatsMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.GetChatsResponse> getChatsAsync(com.ywt.gapi.im.GetChatsRequest request){
            return StubInvocationUtil.unaryCall(invoker, getChatsAsyncMethod, request);
        }

        @Override
        public void getChats(com.ywt.gapi.im.GetChatsRequest request, StreamObserver<com.ywt.gapi.im.GetChatsResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, getChatsMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.SendResponse notifyNewPublishForDoc(com.ywt.gapi.im.NotifyNewPublishForDocRequest request){
            return StubInvocationUtil.unaryCall(invoker, notifyNewPublishForDocMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.SendResponse> notifyNewPublishForDocAsync(com.ywt.gapi.im.NotifyNewPublishForDocRequest request){
            return StubInvocationUtil.unaryCall(invoker, notifyNewPublishForDocAsyncMethod, request);
        }

        @Override
        public void notifyNewPublishForDoc(com.ywt.gapi.im.NotifyNewPublishForDocRequest request, StreamObserver<com.ywt.gapi.im.SendResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, notifyNewPublishForDocMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.im.UpdateMsgResponse updateSessionMsg(com.ywt.gapi.im.UpdateMsgRequest request){
            return StubInvocationUtil.unaryCall(invoker, updateSessionMsgMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.im.UpdateMsgResponse> updateSessionMsgAsync(com.ywt.gapi.im.UpdateMsgRequest request){
            return StubInvocationUtil.unaryCall(invoker, updateSessionMsgAsyncMethod, request);
        }

        @Override
        public void updateSessionMsg(com.ywt.gapi.im.UpdateMsgRequest request, StreamObserver<com.ywt.gapi.im.UpdateMsgResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, updateSessionMsgMethod , request, responseObserver);
        }



    }

    public static abstract class IMServiceImplBase implements IMService, ServerService<IMService> {

        private <T, R> BiConsumer<T, StreamObserver<R>> syncToAsync(java.util.function.Function<T, R> syncFun) {
            return new BiConsumer<T, StreamObserver<R>>() {
                @Override
                public void accept(T t, StreamObserver<R> observer) {
                    try {
                        R ret = syncFun.apply(t);
                        observer.onNext(ret);
                        observer.onCompleted();
                    } catch (Throwable e) {
                        observer.onError(e);
                    }
                }
            };
        }

        @Override
        public final Invoker<IMService> getInvoker(URL url) {
            PathResolver pathResolver = url.getOrDefaultFrameworkModel()
            .getExtensionLoader(PathResolver.class)
            .getDefaultExtension();
            Map<String,StubMethodHandler<?, ?>> handlers = new HashMap<>();

            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/sendNoticeMessage" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/sendNoticeMessageAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/sendSessionMessage" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/sendSessionMessageAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/pullSessionMessageRecord" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/pullSessionMessageRecordAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/pullNoticeMessage" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/pullNoticeMessageAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/issueToken" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/issueTokenAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/checkToken" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/checkTokenAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/saveSessionMessage" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/saveSessionMessageAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/saveNoticeMessage" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/saveNoticeMessageAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/recall" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/recallAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/sessionCount" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/sessionCountAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/getChats" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/getChatsAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/notifyNewPublishForDoc" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/notifyNewPublishForDocAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/updateSessionMsg" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/updateSessionMsgAsync" );

            BiConsumer<com.ywt.gapi.im.NoticeMessage, StreamObserver<com.ywt.gapi.im.SendResponse>> sendNoticeMessageFunc = this::sendNoticeMessage;
            handlers.put(sendNoticeMessageMethod.getMethodName(), new UnaryStubMethodHandler<>(sendNoticeMessageFunc));
            BiConsumer<com.ywt.gapi.im.NoticeMessage, StreamObserver<com.ywt.gapi.im.SendResponse>> sendNoticeMessageAsyncFunc = syncToAsync(this::sendNoticeMessage);
            handlers.put(sendNoticeMessageProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(sendNoticeMessageAsyncFunc));
            BiConsumer<com.ywt.gapi.im.SessionMessage, StreamObserver<com.ywt.gapi.im.SendResponse>> sendSessionMessageFunc = this::sendSessionMessage;
            handlers.put(sendSessionMessageMethod.getMethodName(), new UnaryStubMethodHandler<>(sendSessionMessageFunc));
            BiConsumer<com.ywt.gapi.im.SessionMessage, StreamObserver<com.ywt.gapi.im.SendResponse>> sendSessionMessageAsyncFunc = syncToAsync(this::sendSessionMessage);
            handlers.put(sendSessionMessageProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(sendSessionMessageAsyncFunc));
            BiConsumer<com.ywt.gapi.im.PullSessionMessageRecordRequest, StreamObserver<com.ywt.gapi.im.SessionMessageRecordResponse>> pullSessionMessageRecordFunc = this::pullSessionMessageRecord;
            handlers.put(pullSessionMessageRecordMethod.getMethodName(), new UnaryStubMethodHandler<>(pullSessionMessageRecordFunc));
            BiConsumer<com.ywt.gapi.im.PullSessionMessageRecordRequest, StreamObserver<com.ywt.gapi.im.SessionMessageRecordResponse>> pullSessionMessageRecordAsyncFunc = syncToAsync(this::pullSessionMessageRecord);
            handlers.put(pullSessionMessageRecordProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(pullSessionMessageRecordAsyncFunc));
            BiConsumer<com.ywt.gapi.im.PullNoticeMessageRequest, StreamObserver<com.ywt.gapi.im.NoticeMessageResponse>> pullNoticeMessageFunc = this::pullNoticeMessage;
            handlers.put(pullNoticeMessageMethod.getMethodName(), new UnaryStubMethodHandler<>(pullNoticeMessageFunc));
            BiConsumer<com.ywt.gapi.im.PullNoticeMessageRequest, StreamObserver<com.ywt.gapi.im.NoticeMessageResponse>> pullNoticeMessageAsyncFunc = syncToAsync(this::pullNoticeMessage);
            handlers.put(pullNoticeMessageProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(pullNoticeMessageAsyncFunc));
            BiConsumer<com.ywt.gapi.im.IssueTokenRequest, StreamObserver<com.ywt.gapi.im.IssueTokenResponse>> issueTokenFunc = this::issueToken;
            handlers.put(issueTokenMethod.getMethodName(), new UnaryStubMethodHandler<>(issueTokenFunc));
            BiConsumer<com.ywt.gapi.im.IssueTokenRequest, StreamObserver<com.ywt.gapi.im.IssueTokenResponse>> issueTokenAsyncFunc = syncToAsync(this::issueToken);
            handlers.put(issueTokenProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(issueTokenAsyncFunc));
            BiConsumer<com.ywt.gapi.im.CheckTokenRequest, StreamObserver<com.ywt.gapi.im.CheckTokenResponse>> checkTokenFunc = this::checkToken;
            handlers.put(checkTokenMethod.getMethodName(), new UnaryStubMethodHandler<>(checkTokenFunc));
            BiConsumer<com.ywt.gapi.im.CheckTokenRequest, StreamObserver<com.ywt.gapi.im.CheckTokenResponse>> checkTokenAsyncFunc = syncToAsync(this::checkToken);
            handlers.put(checkTokenProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(checkTokenAsyncFunc));
            BiConsumer<com.ywt.gapi.im.SaveSessionMessageRequest, StreamObserver<com.ywt.gapi.im.SaveSessionMessageResponse>> saveSessionMessageFunc = this::saveSessionMessage;
            handlers.put(saveSessionMessageMethod.getMethodName(), new UnaryStubMethodHandler<>(saveSessionMessageFunc));
            BiConsumer<com.ywt.gapi.im.SaveSessionMessageRequest, StreamObserver<com.ywt.gapi.im.SaveSessionMessageResponse>> saveSessionMessageAsyncFunc = syncToAsync(this::saveSessionMessage);
            handlers.put(saveSessionMessageProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(saveSessionMessageAsyncFunc));
            BiConsumer<com.ywt.gapi.im.SaveNoticeMessageRequest, StreamObserver<com.ywt.gapi.im.SaveNoticeMessageResponse>> saveNoticeMessageFunc = this::saveNoticeMessage;
            handlers.put(saveNoticeMessageMethod.getMethodName(), new UnaryStubMethodHandler<>(saveNoticeMessageFunc));
            BiConsumer<com.ywt.gapi.im.SaveNoticeMessageRequest, StreamObserver<com.ywt.gapi.im.SaveNoticeMessageResponse>> saveNoticeMessageAsyncFunc = syncToAsync(this::saveNoticeMessage);
            handlers.put(saveNoticeMessageProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(saveNoticeMessageAsyncFunc));
            BiConsumer<com.ywt.gapi.im.RecallRequest, StreamObserver<com.ywt.gapi.im.RecallResponse>> recallFunc = this::recall;
            handlers.put(recallMethod.getMethodName(), new UnaryStubMethodHandler<>(recallFunc));
            BiConsumer<com.ywt.gapi.im.RecallRequest, StreamObserver<com.ywt.gapi.im.RecallResponse>> recallAsyncFunc = syncToAsync(this::recall);
            handlers.put(recallProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(recallAsyncFunc));
            BiConsumer<com.ywt.gapi.im.SessionCountRequest, StreamObserver<com.ywt.gapi.im.SessionCountResponse>> sessionCountFunc = this::sessionCount;
            handlers.put(sessionCountMethod.getMethodName(), new UnaryStubMethodHandler<>(sessionCountFunc));
            BiConsumer<com.ywt.gapi.im.SessionCountRequest, StreamObserver<com.ywt.gapi.im.SessionCountResponse>> sessionCountAsyncFunc = syncToAsync(this::sessionCount);
            handlers.put(sessionCountProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(sessionCountAsyncFunc));
            BiConsumer<com.ywt.gapi.im.GetChatsRequest, StreamObserver<com.ywt.gapi.im.GetChatsResponse>> getChatsFunc = this::getChats;
            handlers.put(getChatsMethod.getMethodName(), new UnaryStubMethodHandler<>(getChatsFunc));
            BiConsumer<com.ywt.gapi.im.GetChatsRequest, StreamObserver<com.ywt.gapi.im.GetChatsResponse>> getChatsAsyncFunc = syncToAsync(this::getChats);
            handlers.put(getChatsProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(getChatsAsyncFunc));
            BiConsumer<com.ywt.gapi.im.NotifyNewPublishForDocRequest, StreamObserver<com.ywt.gapi.im.SendResponse>> notifyNewPublishForDocFunc = this::notifyNewPublishForDoc;
            handlers.put(notifyNewPublishForDocMethod.getMethodName(), new UnaryStubMethodHandler<>(notifyNewPublishForDocFunc));
            BiConsumer<com.ywt.gapi.im.NotifyNewPublishForDocRequest, StreamObserver<com.ywt.gapi.im.SendResponse>> notifyNewPublishForDocAsyncFunc = syncToAsync(this::notifyNewPublishForDoc);
            handlers.put(notifyNewPublishForDocProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(notifyNewPublishForDocAsyncFunc));
            BiConsumer<com.ywt.gapi.im.UpdateMsgRequest, StreamObserver<com.ywt.gapi.im.UpdateMsgResponse>> updateSessionMsgFunc = this::updateSessionMsg;
            handlers.put(updateSessionMsgMethod.getMethodName(), new UnaryStubMethodHandler<>(updateSessionMsgFunc));
            BiConsumer<com.ywt.gapi.im.UpdateMsgRequest, StreamObserver<com.ywt.gapi.im.UpdateMsgResponse>> updateSessionMsgAsyncFunc = syncToAsync(this::updateSessionMsg);
            handlers.put(updateSessionMsgProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(updateSessionMsgAsyncFunc));




            return new StubInvoker<>(this, url, IMService.class, handlers);
        }


        @Override
        public com.ywt.gapi.im.SendResponse sendNoticeMessage(com.ywt.gapi.im.NoticeMessage request){
            throw unimplementedMethodException(sendNoticeMessageMethod);
        }

        @Override
        public com.ywt.gapi.im.SendResponse sendSessionMessage(com.ywt.gapi.im.SessionMessage request){
            throw unimplementedMethodException(sendSessionMessageMethod);
        }

        @Override
        public com.ywt.gapi.im.SessionMessageRecordResponse pullSessionMessageRecord(com.ywt.gapi.im.PullSessionMessageRecordRequest request){
            throw unimplementedMethodException(pullSessionMessageRecordMethod);
        }

        @Override
        public com.ywt.gapi.im.NoticeMessageResponse pullNoticeMessage(com.ywt.gapi.im.PullNoticeMessageRequest request){
            throw unimplementedMethodException(pullNoticeMessageMethod);
        }

        @Override
        public com.ywt.gapi.im.IssueTokenResponse issueToken(com.ywt.gapi.im.IssueTokenRequest request){
            throw unimplementedMethodException(issueTokenMethod);
        }

        @Override
        public com.ywt.gapi.im.CheckTokenResponse checkToken(com.ywt.gapi.im.CheckTokenRequest request){
            throw unimplementedMethodException(checkTokenMethod);
        }

        @Override
        public com.ywt.gapi.im.SaveSessionMessageResponse saveSessionMessage(com.ywt.gapi.im.SaveSessionMessageRequest request){
            throw unimplementedMethodException(saveSessionMessageMethod);
        }

        @Override
        public com.ywt.gapi.im.SaveNoticeMessageResponse saveNoticeMessage(com.ywt.gapi.im.SaveNoticeMessageRequest request){
            throw unimplementedMethodException(saveNoticeMessageMethod);
        }

        @Override
        public com.ywt.gapi.im.RecallResponse recall(com.ywt.gapi.im.RecallRequest request){
            throw unimplementedMethodException(recallMethod);
        }

        @Override
        public com.ywt.gapi.im.SessionCountResponse sessionCount(com.ywt.gapi.im.SessionCountRequest request){
            throw unimplementedMethodException(sessionCountMethod);
        }

        @Override
        public com.ywt.gapi.im.GetChatsResponse getChats(com.ywt.gapi.im.GetChatsRequest request){
            throw unimplementedMethodException(getChatsMethod);
        }

        @Override
        public com.ywt.gapi.im.SendResponse notifyNewPublishForDoc(com.ywt.gapi.im.NotifyNewPublishForDocRequest request){
            throw unimplementedMethodException(notifyNewPublishForDocMethod);
        }

        @Override
        public com.ywt.gapi.im.UpdateMsgResponse updateSessionMsg(com.ywt.gapi.im.UpdateMsgRequest request){
            throw unimplementedMethodException(updateSessionMsgMethod);
        }





        @Override
        public final ServiceDescriptor getServiceDescriptor() {
            return serviceDescriptor;
        }
        private RpcException unimplementedMethodException(StubMethodDescriptor methodDescriptor) {
            return TriRpcStatus.UNIMPLEMENTED.withDescription(String.format("Method %s is unimplemented",
                "/" + serviceDescriptor.getInterfaceName() + "/" + methodDescriptor.getMethodName())).asException();
        }
    }

}
