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

import org.apache.dubbo.common.stream.StreamObserver;
import com.google.protobuf.Message;

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

public interface NatService extends org.apache.dubbo.rpc.model.DubboStub {

    String JAVA_SERVICE_NAME = "com.ywt.gapi.nat.NatService";
    String SERVICE_NAME = "com.ywt.gapi.nat.NatService";

        /**
         * <pre>
         *  医院 id
         * </pre>
         */
    com.ywt.gapi.nat.CreateOrderResponse createOrder(com.ywt.gapi.nat.CreateOrderRequest request);

    default CompletableFuture<com.ywt.gapi.nat.CreateOrderResponse> createOrderAsync(com.ywt.gapi.nat.CreateOrderRequest request){
        return CompletableFuture.completedFuture(createOrder(request));
    }

    /**
    * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
    * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
    */
    default void createOrder(com.ywt.gapi.nat.CreateOrderRequest request, StreamObserver<com.ywt.gapi.nat.CreateOrderResponse> responseObserver){
        createOrderAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

    com.ywt.gapi.nat.GetConfigResponse getConfig(com.ywt.gapi.nat.GetConfigRequest request);

    default CompletableFuture<com.ywt.gapi.nat.GetConfigResponse> getConfigAsync(com.ywt.gapi.nat.GetConfigRequest request){
        return CompletableFuture.completedFuture(getConfig(request));
    }

    /**
    * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
    * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
    */
    default void getConfig(com.ywt.gapi.nat.GetConfigRequest request, StreamObserver<com.ywt.gapi.nat.GetConfigResponse> responseObserver){
        getConfigAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

    com.ywt.gapi.nat.GetOrderDetailResponse getOrderDetail(com.ywt.gapi.nat.GetOrderDetailRequest request);

    default CompletableFuture<com.ywt.gapi.nat.GetOrderDetailResponse> getOrderDetailAsync(com.ywt.gapi.nat.GetOrderDetailRequest request){
        return CompletableFuture.completedFuture(getOrderDetail(request));
    }

    /**
    * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
    * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
    */
    default void getOrderDetail(com.ywt.gapi.nat.GetOrderDetailRequest request, StreamObserver<com.ywt.gapi.nat.GetOrderDetailResponse> responseObserver){
        getOrderDetailAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

    com.ywt.gapi.nat.GetOrderListResponse getOrderList(com.ywt.gapi.nat.GetOrderListRequest request);

    default CompletableFuture<com.ywt.gapi.nat.GetOrderListResponse> getOrderListAsync(com.ywt.gapi.nat.GetOrderListRequest request){
        return CompletableFuture.completedFuture(getOrderList(request));
    }

    /**
    * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
    * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
    */
    default void getOrderList(com.ywt.gapi.nat.GetOrderListRequest request, StreamObserver<com.ywt.gapi.nat.GetOrderListResponse> responseObserver){
        getOrderListAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

    com.ywt.gapi.nat.PayCallbackResponse payCallback(com.ywt.gapi.nat.PayCallbackRequest request);

    default CompletableFuture<com.ywt.gapi.nat.PayCallbackResponse> payCallbackAsync(com.ywt.gapi.nat.PayCallbackRequest request){
        return CompletableFuture.completedFuture(payCallback(request));
    }

    /**
    * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
    * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
    */
    default void payCallback(com.ywt.gapi.nat.PayCallbackRequest request, StreamObserver<com.ywt.gapi.nat.PayCallbackResponse> responseObserver){
        payCallbackAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

        /**
         * <pre>
         *  预约日期，yyyy-MM-dd
         * </pre>
         */
    com.ywt.gapi.nat.RefundNatOrderCallbackResponse refundNatOrderCallback(com.ywt.gapi.nat.RefundNatOrderCallbackRequest request);

    default CompletableFuture<com.ywt.gapi.nat.RefundNatOrderCallbackResponse> refundNatOrderCallbackAsync(com.ywt.gapi.nat.RefundNatOrderCallbackRequest request){
        return CompletableFuture.completedFuture(refundNatOrderCallback(request));
    }

    /**
    * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
    * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
    */
    default void refundNatOrderCallback(com.ywt.gapi.nat.RefundNatOrderCallbackRequest request, StreamObserver<com.ywt.gapi.nat.RefundNatOrderCallbackResponse> responseObserver){
        refundNatOrderCallbackAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

        /**
         * <pre>
         *  预约时间段：1-上午；2-下午；
         * </pre>
         */
    com.ywt.gapi.nat.BaseInfoResponse refund(com.ywt.gapi.nat.RefundOrderRequest request);

    default CompletableFuture<com.ywt.gapi.nat.BaseInfoResponse> refundAsync(com.ywt.gapi.nat.RefundOrderRequest request){
        return CompletableFuture.completedFuture(refund(request));
    }

    /**
    * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
    * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
    */
    default void refund(com.ywt.gapi.nat.RefundOrderRequest request, StreamObserver<com.ywt.gapi.nat.BaseInfoResponse> responseObserver){
        refundAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

        /**
         * <pre>
         *  现住址
         * </pre>
         */
    com.ywt.gapi.nat.BaseInfoResponse cancelOrder(com.ywt.gapi.nat.CancelOrderRequest request);

    default CompletableFuture<com.ywt.gapi.nat.BaseInfoResponse> cancelOrderAsync(com.ywt.gapi.nat.CancelOrderRequest request){
        return CompletableFuture.completedFuture(cancelOrder(request));
    }

    /**
    * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
    * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
    */
    default void cancelOrder(com.ywt.gapi.nat.CancelOrderRequest request, StreamObserver<com.ywt.gapi.nat.BaseInfoResponse> responseObserver){
        cancelOrderAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }






}
