/// <summary> /// Initializes a new instance of the <see cref="CreateInvoice" /> class. /// </summary> /// <param name="InvoiceNumber">InvoiceNumber.</param> /// <param name="Description">Description.</param> /// <param name="Customer">Customer (required).</param> /// <param name="PayerName">PayerName (required).</param> /// <param name="PaymentDueDate">PaymentDueDate (required).</param> /// <param name="SubAmount">SubAmount.</param> /// <param name="DiscountPercent">DiscountPercent.</param> /// <param name="DiscountAmount">DiscountAmount.</param> /// <param name="TotalAmount">TotalAmount (required).</param> /// <param name="LineItems">LineItems.</param> /// <param name="Tax">Tax.</param> /// <param name="SendEmailImmediately">SendEmailImmediately.</param> public CreateInvoice(string InvoiceNumber = null, string Description = null, Customer Customer = null, string PayerName = null, string PaymentDueDate = null, decimal?SubAmount = null, decimal?DiscountPercent = null, decimal?DiscountAmount = null, decimal?TotalAmount = null, List <LineItem> LineItems = null, Tax Tax = null, bool?SendEmailImmediately = null) { // to ensure "Customer" is required (not null) if (Customer == null) { throw new InvalidDataException("Customer is a required property for CreateInvoice and cannot be null"); } else { this.Customer = Customer; } // to ensure "PayerName" is required (not null) if (PayerName == null) { throw new InvalidDataException("PayerName is a required property for CreateInvoice and cannot be null"); } else { this.PayerName = PayerName; } // to ensure "PaymentDueDate" is required (not null) if (PaymentDueDate == null) { throw new InvalidDataException("PaymentDueDate is a required property for CreateInvoice and cannot be null"); } else { this.PaymentDueDate = PaymentDueDate; } // to ensure "TotalAmount" is required (not null) if (TotalAmount == null) { throw new InvalidDataException("TotalAmount is a required property for CreateInvoice and cannot be null"); } else { this.TotalAmount = TotalAmount; } this.InvoiceNumber = InvoiceNumber; this.Description = Description; this.SubAmount = SubAmount; this.DiscountPercent = DiscountPercent; this.DiscountAmount = DiscountAmount; this.LineItems = LineItems; this.Tax = Tax; this.SendEmailImmediately = SendEmailImmediately; }