示例#1
0
        /// <summary>
        /// Get all shipment events
        /// </summary>
        /// <param name="trackingNumber">The tracking number to track</param>
        /// <param name="shipment">Shipment; pass null if the tracking number is not associated with a specific shipment</param>
        /// <returns>
        /// A task that represents the asynchronous operation
        /// The task result contains the list of shipment events
        /// </returns>
        public async Task <IList <ShipmentStatusEvent> > GetShipmentEventsAsync(string trackingNumber, Shipment shipment = null)
        {
            var result = new List <ShipmentStatusEvent>();

            if (string.IsNullOrEmpty(trackingNumber))
            {
                return(result);
            }

            result.AddRange(await _upsService.GetShipmentEventsAsync(trackingNumber));

            return(result);
        }