/*
* 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.wx_ins_pay;

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 DubboWxInsPayServiceTriple {

    public static final String SERVICE_NAME = WxInsPayService.SERVICE_NAME;

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

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

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

    /**
         * <pre>
         *  支付类型：RegPay=挂号支付 DiagPay=诊间 支付 InHospPay=住院
         * </pre>
         */
    private static final StubMethodDescriptor createPayInsOrderMethod = new StubMethodDescriptor("createPayInsOrder",
    com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest.class, com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse::parseFrom);

    private static final StubMethodDescriptor createPayInsOrderAsyncMethod = new StubMethodDescriptor("createPayInsOrder",
    com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse::parseFrom);

    private static final StubMethodDescriptor createPayInsOrderProxyAsyncMethod = new StubMethodDescriptor("createPayInsOrderAsync",
    com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest.class, com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse::parseFrom);

    /**
         * <pre>
         *  微信分配的公众账号 ID
         * </pre>
         */
    private static final StubMethodDescriptor queryPayInsOrderMethod = new StubMethodDescriptor("queryPayInsOrder",
    com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest.class, com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse::parseFrom);

    private static final StubMethodDescriptor queryPayInsOrderAsyncMethod = new StubMethodDescriptor("queryPayInsOrder",
    com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse::parseFrom);

    private static final StubMethodDescriptor queryPayInsOrderProxyAsyncMethod = new StubMethodDescriptor("queryPayInsOrderAsync",
    com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest.class, com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse::parseFrom);

    /**
         * <pre>
         *  微信支付分配的商户号
         * </pre>
         */
    private static final StubMethodDescriptor wxPayCallbackMethod = new StubMethodDescriptor("wxPayCallback",
    com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest.class, com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse::parseFrom);

    private static final StubMethodDescriptor wxPayCallbackAsyncMethod = new StubMethodDescriptor("wxPayCallback",
    com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse::parseFrom);

    private static final StubMethodDescriptor wxPayCallbackProxyAsyncMethod = new StubMethodDescriptor("wxPayCallbackAsync",
    com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest.class, com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse::parseFrom);

    private static final StubMethodDescriptor verifyMedInfoMethod = new StubMethodDescriptor("verifyMedInfo",
    com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest.class, com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse::parseFrom);

    private static final StubMethodDescriptor verifyMedInfoAsyncMethod = new StubMethodDescriptor("verifyMedInfo",
    com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse::parseFrom);

    private static final StubMethodDescriptor verifyMedInfoProxyAsyncMethod = new StubMethodDescriptor("verifyMedInfoAsync",
    com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest.class, com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse::parseFrom);

    /**
         * <pre>
         *  第三方服务商平台自动生成的一个订单号
         * </pre>
         */
    private static final StubMethodDescriptor markOpOrderDeletedMethod = new StubMethodDescriptor("markOpOrderDeleted",
    com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest.class, com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse::parseFrom);

    private static final StubMethodDescriptor markOpOrderDeletedAsyncMethod = new StubMethodDescriptor("markOpOrderDeleted",
    com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse::parseFrom);

    private static final StubMethodDescriptor markOpOrderDeletedProxyAsyncMethod = new StubMethodDescriptor("markOpOrderDeletedAsync",
    com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest.class, com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse::parseFrom);

    private static final StubMethodDescriptor wechatAutoRefundCallbackMethod = new StubMethodDescriptor("wechatAutoRefundCallback",
    com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest.class, com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse::parseFrom);

    private static final StubMethodDescriptor wechatAutoRefundCallbackAsyncMethod = new StubMethodDescriptor("wechatAutoRefundCallback",
    com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse::parseFrom);

    private static final StubMethodDescriptor wechatAutoRefundCallbackProxyAsyncMethod = new StubMethodDescriptor("wechatAutoRefundCallbackAsync",
    com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest.class, com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest::parseFrom,
    com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse::parseFrom);





    public static class WxInsPayServiceStub implements WxInsPayService{
        private final Invoker<WxInsPayService> invoker;

        public WxInsPayServiceStub(Invoker<WxInsPayService> invoker) {
            this.invoker = invoker;
        }

            /**
         * <pre>
         *  支付类型：RegPay=挂号支付 DiagPay=诊间 支付 InHospPay=住院
         * </pre>
         */
        @Override
        public com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse createPayInsOrder(com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest request){
            return StubInvocationUtil.unaryCall(invoker, createPayInsOrderMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse> createPayInsOrderAsync(com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest request){
            return StubInvocationUtil.unaryCall(invoker, createPayInsOrderAsyncMethod, request);
        }

            /**
         * <pre>
         *  支付类型：RegPay=挂号支付 DiagPay=诊间 支付 InHospPay=住院
         * </pre>
         */
        @Override
        public void createPayInsOrder(com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest request, StreamObserver<com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, createPayInsOrderMethod , request, responseObserver);
        }
            /**
         * <pre>
         *  微信分配的公众账号 ID
         * </pre>
         */
        @Override
        public com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse queryPayInsOrder(com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest request){
            return StubInvocationUtil.unaryCall(invoker, queryPayInsOrderMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse> queryPayInsOrderAsync(com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest request){
            return StubInvocationUtil.unaryCall(invoker, queryPayInsOrderAsyncMethod, request);
        }

            /**
         * <pre>
         *  微信分配的公众账号 ID
         * </pre>
         */
        @Override
        public void queryPayInsOrder(com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest request, StreamObserver<com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, queryPayInsOrderMethod , request, responseObserver);
        }
            /**
         * <pre>
         *  微信支付分配的商户号
         * </pre>
         */
        @Override
        public com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse wxPayCallback(com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest request){
            return StubInvocationUtil.unaryCall(invoker, wxPayCallbackMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse> wxPayCallbackAsync(com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest request){
            return StubInvocationUtil.unaryCall(invoker, wxPayCallbackAsyncMethod, request);
        }

            /**
         * <pre>
         *  微信支付分配的商户号
         * </pre>
         */
        @Override
        public void wxPayCallback(com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest request, StreamObserver<com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, wxPayCallbackMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse verifyMedInfo(com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest request){
            return StubInvocationUtil.unaryCall(invoker, verifyMedInfoMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse> verifyMedInfoAsync(com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest request){
            return StubInvocationUtil.unaryCall(invoker, verifyMedInfoAsyncMethod, request);
        }

        @Override
        public void verifyMedInfo(com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest request, StreamObserver<com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, verifyMedInfoMethod , request, responseObserver);
        }
            /**
         * <pre>
         *  第三方服务商平台自动生成的一个订单号
         * </pre>
         */
        @Override
        public com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse markOpOrderDeleted(com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest request){
            return StubInvocationUtil.unaryCall(invoker, markOpOrderDeletedMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse> markOpOrderDeletedAsync(com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest request){
            return StubInvocationUtil.unaryCall(invoker, markOpOrderDeletedAsyncMethod, request);
        }

            /**
         * <pre>
         *  第三方服务商平台自动生成的一个订单号
         * </pre>
         */
        @Override
        public void markOpOrderDeleted(com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest request, StreamObserver<com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, markOpOrderDeletedMethod , request, responseObserver);
        }
        @Override
        public com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse wechatAutoRefundCallback(com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest request){
            return StubInvocationUtil.unaryCall(invoker, wechatAutoRefundCallbackMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse> wechatAutoRefundCallbackAsync(com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest request){
            return StubInvocationUtil.unaryCall(invoker, wechatAutoRefundCallbackAsyncMethod, request);
        }

        @Override
        public void wechatAutoRefundCallback(com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest request, StreamObserver<com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, wechatAutoRefundCallbackMethod , request, responseObserver);
        }



    }

    public static abstract class WxInsPayServiceImplBase implements WxInsPayService, ServerService<WxInsPayService> {

        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<WxInsPayService> getInvoker(URL url) {
            PathResolver pathResolver = url.getOrDefaultFrameworkModel()
            .getExtensionLoader(PathResolver.class)
            .getDefaultExtension();
            Map<String,StubMethodHandler<?, ?>> handlers = new HashMap<>();

            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/createPayInsOrder" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/createPayInsOrderAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/queryPayInsOrder" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/queryPayInsOrderAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/wxPayCallback" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/wxPayCallbackAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/verifyMedInfo" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/verifyMedInfoAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/markOpOrderDeleted" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/markOpOrderDeletedAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/wechatAutoRefundCallback" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/wechatAutoRefundCallbackAsync" );

            BiConsumer<com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse>> createPayInsOrderFunc = this::createPayInsOrder;
            handlers.put(createPayInsOrderMethod.getMethodName(), new UnaryStubMethodHandler<>(createPayInsOrderFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse>> createPayInsOrderAsyncFunc = syncToAsync(this::createPayInsOrder);
            handlers.put(createPayInsOrderProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(createPayInsOrderAsyncFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse>> queryPayInsOrderFunc = this::queryPayInsOrder;
            handlers.put(queryPayInsOrderMethod.getMethodName(), new UnaryStubMethodHandler<>(queryPayInsOrderFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse>> queryPayInsOrderAsyncFunc = syncToAsync(this::queryPayInsOrder);
            handlers.put(queryPayInsOrderProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(queryPayInsOrderAsyncFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse>> wxPayCallbackFunc = this::wxPayCallback;
            handlers.put(wxPayCallbackMethod.getMethodName(), new UnaryStubMethodHandler<>(wxPayCallbackFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse>> wxPayCallbackAsyncFunc = syncToAsync(this::wxPayCallback);
            handlers.put(wxPayCallbackProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(wxPayCallbackAsyncFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse>> verifyMedInfoFunc = this::verifyMedInfo;
            handlers.put(verifyMedInfoMethod.getMethodName(), new UnaryStubMethodHandler<>(verifyMedInfoFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse>> verifyMedInfoAsyncFunc = syncToAsync(this::verifyMedInfo);
            handlers.put(verifyMedInfoProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(verifyMedInfoAsyncFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse>> markOpOrderDeletedFunc = this::markOpOrderDeleted;
            handlers.put(markOpOrderDeletedMethod.getMethodName(), new UnaryStubMethodHandler<>(markOpOrderDeletedFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse>> markOpOrderDeletedAsyncFunc = syncToAsync(this::markOpOrderDeleted);
            handlers.put(markOpOrderDeletedProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(markOpOrderDeletedAsyncFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse>> wechatAutoRefundCallbackFunc = this::wechatAutoRefundCallback;
            handlers.put(wechatAutoRefundCallbackMethod.getMethodName(), new UnaryStubMethodHandler<>(wechatAutoRefundCallbackFunc));
            BiConsumer<com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest, StreamObserver<com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse>> wechatAutoRefundCallbackAsyncFunc = syncToAsync(this::wechatAutoRefundCallback);
            handlers.put(wechatAutoRefundCallbackProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(wechatAutoRefundCallbackAsyncFunc));




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


        @Override
        public com.ywt.gapi.wx_ins_pay.CreatePayInsOrderResponse createPayInsOrder(com.ywt.gapi.wx_ins_pay.CreatePayInsOrderRequest request){
            throw unimplementedMethodException(createPayInsOrderMethod);
        }

        @Override
        public com.ywt.gapi.wx_ins_pay.QueryPayInsOrderResponse queryPayInsOrder(com.ywt.gapi.wx_ins_pay.QueryPayInsOrderRequest request){
            throw unimplementedMethodException(queryPayInsOrderMethod);
        }

        @Override
        public com.ywt.gapi.wx_ins_pay.WxPayCallbackResponse wxPayCallback(com.ywt.gapi.wx_ins_pay.WxPayCallbackRequest request){
            throw unimplementedMethodException(wxPayCallbackMethod);
        }

        @Override
        public com.ywt.gapi.wx_ins_pay.VerifyMedInfoResponse verifyMedInfo(com.ywt.gapi.wx_ins_pay.VerifyMedInfoRequest request){
            throw unimplementedMethodException(verifyMedInfoMethod);
        }

        @Override
        public com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedResponse markOpOrderDeleted(com.ywt.gapi.wx_ins_pay.MarkOpOrderDeletedRequest request){
            throw unimplementedMethodException(markOpOrderDeletedMethod);
        }

        @Override
        public com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackResponse wechatAutoRefundCallback(com.ywt.gapi.wx_ins_pay.WechatAutoRefundCallbackRequest request){
            throw unimplementedMethodException(wechatAutoRefundCallbackMethod);
        }





        @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();
        }
    }

}
