Example #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Contact == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Contact");
     }
     if (PalletList == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "PalletList");
     }
     if (TotalWeight == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TotalWeight");
     }
     if (PreviewFreightClass == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "PreviewFreightClass");
     }
     if (AmazonReferenceId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "AmazonReferenceId");
     }
     if (CarrierName == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CarrierName");
     }
     if (Contact != null)
     {
         Contact.Validate();
     }
     if (PalletList != null)
     {
         foreach (var element in PalletList)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (TotalWeight != null)
     {
         TotalWeight.Validate();
     }
     if (SellerDeclaredValue != null)
     {
         SellerDeclaredValue.Validate();
     }
     if (AmazonCalculatedValue != null)
     {
         AmazonCalculatedValue.Validate();
     }
     if (PartneredEstimate != null)
     {
         PartneredEstimate.Validate();
     }
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the PartneredLtlDataOutput class.
 /// </summary>
 /// <param name="contact">Contact information for the person in the
 /// seller's organization who is responsible for the shipment. Used by
 /// the carrier if they have questions about the shipment.</param>
 /// <param name="boxCount">The number of boxes in the shipment.</param>
 /// <param name="freightReadyDate">The date that the shipment will be
 /// ready to be picked up by the carrier. Must be in YYYY-MM-DD
 /// format.</param>
 /// <param name="totalWeight">The total weight of the shipment.</param>
 /// <param name="previewPickupDate">The estimated date that the
 /// shipment will be picked up by the carrier, in YYYY-MM-DD
 /// format.</param>
 /// <param name="previewDeliveryDate">The estimated date that the
 /// shipment will be delivered to an Amazon fulfillment center, in
 /// YYYY-MM-DD format.</param>
 /// <param name="previewFreightClass">The freight class of the shipment
 /// as estimated by Amazon if you did not include a freight class when
 /// you called the putTransportDetails operation. Possible values
 /// include: '50', '55', '60', '65', '70', '77.5', '85', '92.5', '100',
 /// '110', '125', '150', '175', '200', '250', '300', '400',
 /// '500'</param>
 /// <param name="amazonReferenceId">A unique identifier created by
 /// Amazon that identifies this Amazon-partnered, Less Than
 /// Truckload/Full Truckload (LTL/FTL) shipment.</param>
 /// <param name="isBillOfLadingAvailable">Indicates whether the bill of
 /// lading for the shipment is available.</param>
 /// <param name="carrierName">The carrier for the inbound
 /// shipment.</param>
 /// <param name="sellerFreightClass">Possible values include: '50',
 /// '55', '60', '65', '70', '77.5', '85', '92.5', '100', '110', '125',
 /// '150', '175', '200', '250', '300', '400', '500'</param>
 /// <param name="sellerDeclaredValue">Your declaration of the total
 /// value of the inventory in the shipment.</param>
 /// <param name="amazonCalculatedValue">Estimate by Amazon of the total
 /// value of the inventory in the shipment.</param>
 /// <param name="partneredEstimate">The estimated shipping cost using
 /// an Amazon-partnered carrier.</param>
 public PartneredLtlDataOutput(Contact contact, long boxCount, System.DateTime freightReadyDate, IList <Pallet> palletList, Weight totalWeight, System.DateTime previewPickupDate, System.DateTime previewDeliveryDate, string previewFreightClass, string amazonReferenceId, bool isBillOfLadingAvailable, string carrierName, string sellerFreightClass = default(string), Amount sellerDeclaredValue = default(Amount), Amount amazonCalculatedValue = default(Amount), PartneredEstimate partneredEstimate = default(PartneredEstimate))
 {
     Contact                 = contact;
     BoxCount                = boxCount;
     SellerFreightClass      = sellerFreightClass;
     FreightReadyDate        = freightReadyDate;
     PalletList              = palletList;
     TotalWeight             = totalWeight;
     SellerDeclaredValue     = sellerDeclaredValue;
     AmazonCalculatedValue   = amazonCalculatedValue;
     PreviewPickupDate       = previewPickupDate;
     PreviewDeliveryDate     = previewDeliveryDate;
     PreviewFreightClass     = previewFreightClass;
     AmazonReferenceId       = amazonReferenceId;
     IsBillOfLadingAvailable = isBillOfLadingAvailable;
     PartneredEstimate       = partneredEstimate;
     CarrierName             = carrierName;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the PartneredSmallParcelDataOutput
 /// class.
 /// </summary>
 public PartneredSmallParcelDataOutput(IList <PartneredSmallParcelPackageOutput> packageList, PartneredEstimate partneredEstimate = default(PartneredEstimate))
 {
     PackageList       = packageList;
     PartneredEstimate = partneredEstimate;
     CustomInit();
 }