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

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

        /**
         * <pre>
         * [R]订单编号
         * </pre>
         */
    com.ywt.gapi.sf.GetCityCodeResponse getCityCode(com.ywt.gapi.sf.GetCityCodeRequest request);

    default CompletableFuture<com.ywt.gapi.sf.GetCityCodeResponse> getCityCodeAsync(com.ywt.gapi.sf.GetCityCodeRequest request){
        return CompletableFuture.completedFuture(getCityCode(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 getCityCode(com.ywt.gapi.sf.GetCityCodeRequest request, StreamObserver<com.ywt.gapi.sf.GetCityCodeResponse> responseObserver){
        getCityCodeAsync(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 saveRouteInfo(com.ywt.gapi.sf.SaveRouteInfoRequest request);

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

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

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

        /**
         * <pre>
         * [R[寄件方公司
         * </pre>
         */
    com.ywt.gapi.sf.BaseResultResponse updatePrescriptionStatus(com.ywt.gapi.sf.UpdatePrescriptionStatusRequest request);

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






}
