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

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 SFService extends org.apache.dubbo.rpc.model.DubboStub {

    String JAVA_SERVICE_NAME = "com.ywt.gapi.sf.SFService";
    String SERVICE_NAME = "com.ywt.gapi.sf.SFService";

        /**
         * <pre>
         * [R]订单编号
         * </pre>
         */
    com.ywt.gapi.sf.CreateOrderResponse createOrder(com.ywt.gapi.sf.CreateOrderRequest request);

    default CompletableFuture<com.ywt.gapi.sf.CreateOrderResponse> createOrderAsync(com.ywt.gapi.sf.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.sf.CreateOrderRequest request, StreamObserver<com.ywt.gapi.sf.CreateOrderResponse> responseObserver){
        createOrderAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

        /**
         * <pre>
         * [O]快件产品类型。1-标准快递；2-顺丰特惠；3-电商特惠；6-即日件，12-医药专递等。详情查阅顺丰规范文档
         * </pre>
         */
    com.ywt.gapi.sf.BaseResultResponse confirmOrder(com.ywt.gapi.sf.ConfirmOrderRequest request);

    default CompletableFuture<com.ywt.gapi.sf.BaseResultResponse> confirmOrderAsync(com.ywt.gapi.sf.ConfirmOrderRequest request){
        return CompletableFuture.completedFuture(confirmOrder(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 confirmOrder(com.ywt.gapi.sf.ConfirmOrderRequest request, StreamObserver<com.ywt.gapi.sf.BaseResultResponse> responseObserver){
        confirmOrderAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

        /**
         * <pre>
         * [C]寄件方地址，必须包含省市区.如果需要生成电子运单，则为必填。
         * </pre>
         */
    com.ywt.gapi.sf.CreateOrderResponse checkOrderStatus(com.ywt.gapi.sf.CheckOrderStatusRequest request);

    default CompletableFuture<com.ywt.gapi.sf.CreateOrderResponse> checkOrderStatusAsync(com.ywt.gapi.sf.CheckOrderStatusRequest request){
        return CompletableFuture.completedFuture(checkOrderStatus(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 checkOrderStatus(com.ywt.gapi.sf.CheckOrderStatusRequest request, StreamObserver<com.ywt.gapi.sf.CreateOrderResponse> responseObserver){
        checkOrderStatusAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

        /**
         * <pre>
         * [R[寄件方公司
         * </pre>
         */
    com.ywt.gapi.sf.GetRouteResponse getRoute(com.ywt.gapi.sf.GetRouteRequest request);

    default CompletableFuture<com.ywt.gapi.sf.GetRouteResponse> getRouteAsync(com.ywt.gapi.sf.GetRouteRequest request){
        return CompletableFuture.completedFuture(getRoute(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 getRoute(com.ywt.gapi.sf.GetRouteRequest request, StreamObserver<com.ywt.gapi.sf.GetRouteResponse> responseObserver){
        getRouteAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }

        /**
         * <pre>
         * [R[寄件方联系人
         * </pre>
         */
    com.ywt.gapi.sf.CalcTimePromiseAndFreightResponse calcTimePromiseAndFreight(com.ywt.gapi.sf.CalcTimePromiseAndFreightRequest request);

    default CompletableFuture<com.ywt.gapi.sf.CalcTimePromiseAndFreightResponse> calcTimePromiseAndFreightAsync(com.ywt.gapi.sf.CalcTimePromiseAndFreightRequest request){
        return CompletableFuture.completedFuture(calcTimePromiseAndFreight(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 calcTimePromiseAndFreight(com.ywt.gapi.sf.CalcTimePromiseAndFreightRequest request, StreamObserver<com.ywt.gapi.sf.CalcTimePromiseAndFreightResponse> responseObserver){
        calcTimePromiseAndFreightAsync(request).whenComplete((r, t) -> {
            if (t != null) {
                responseObserver.onError(t);
            } else {
                responseObserver.onNext(r);
                responseObserver.onCompleted();
            }
        });
    }






}
