shipments.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:logistics-wizard-controller 作者: IBM-Cloud 项目源码 文件源码
def get_shipment(shipment_id):
    """
    Retrieve a single shipment object.

    :param shipment_id:   The shipment's id

    :return: {
        "id": "123",
        "status": "SHIPPED",
        "createdAt": "2015-11-05T22:00:51.692765",
        "updatedAt": "2015-11-08T22:00:51.692765",
        "deliveredAt": "2015-11-08T22:00:51.692765",
        "estimatedTimeOfArrival": "2015-11-07T22:00:51.692765",
        "currentLocation": {Address},
        "fromId": "123",
        "toId:": "123",
        "items": [{LineItem}]
    }

    """
    include_items = request.args.get('include_items')
    check_null_input((shipment_id, 'shipment to retrieve'))

    shipment = shipment_service.get_shipment(token=g.auth['loopback_token'],
                                             shipment_id=shipment_id,
                                             include_items=include_items)

    return Response(shipment,
                    status=200,
                    mimetype='application/json')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号