Пример #1
0
        /// <summary>
        /// Attempts to create the specified vehicles on the specified job on Car Delivery Network.
        /// </summary>
        /// <param name="loadId">LoadId of the job to create vehicles against.</param>
        /// <param name="vehicles">The collection of vehicles to create.</param>
        /// <returns>A collection of the newly created vehicles.</returns>
        public Vehicles CreateJobVehicles(string loadId, Vehicles vehicles)
        {
            if (vehicles == null || vehicles.Count == 0)
            {
                throw new ArgumentException("Vehicles collection was null or empty");
            }
            var resource = string.Format("Jobs/{0}/Vehicles", loadId);

            return(Vehicles.FromString(CallWithRetry(resource, "POST", true, vehicles), _interfaceFormat));
        }
Пример #2
0
        /// <summary>
        /// Gets a collection of vehicles form the job of the specified LoadId
        /// </summary>
        /// <param name="loadId">LoadId of the job resource</param>
        /// <returns>A collection of vehicles from the specified job</returns>
        public Vehicles GetJobVehicles(string loadId)
        {
            var resource = string.Format("Jobs/{0}/Vehicles", loadId);

            return(Vehicles.FromString(CallWithRetry(resource, "GET", true), _interfaceFormat));
        }