/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (InboundShipmentHeader == null) { throw new ValidationException(ValidationRules.CannotBeNull, "InboundShipmentHeader"); } if (InboundShipmentItems == null) { throw new ValidationException(ValidationRules.CannotBeNull, "InboundShipmentItems"); } if (MarketplaceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "MarketplaceId"); } if (InboundShipmentHeader != null) { InboundShipmentHeader.Validate(); } if (InboundShipmentItems != null) { foreach (var element in InboundShipmentItems) { if (element != null) { element.Validate(); } } } }
/// <summary> /// Initializes a new instance of the InboundShipmentRequest class. /// </summary> /// <param name="marketplaceId">A marketplace identifier. Specifies the /// marketplace where the product would be stored.</param> public InboundShipmentRequest(InboundShipmentHeader inboundShipmentHeader, IList <InboundShipmentItem> inboundShipmentItems, string marketplaceId) { InboundShipmentHeader = inboundShipmentHeader; InboundShipmentItems = inboundShipmentItems; MarketplaceId = marketplaceId; CustomInit(); }