/// <summary>
 /// Initializes a new instance of the <see cref="LineItemGiftCertificateRequestData" /> class.
 /// </summary>
 /// <param name="name">Given name for gift certificate line item. (required).</param>
 /// <param name="theme">Currently supports &#x60;Birthday&#x60;, &#x60;Boy&#x60;, &#x60;Celebration&#x60;, &#x60;Christmas&#x60;, &#x60;General&#x60;, and &#x60;Girl&#x60;. (required).</param>
 /// <param name="amount">amount (required).</param>
 /// <param name="quantity">quantity (required).</param>
 /// <param name="sender">sender (required).</param>
 /// <param name="recipient">recipient (required).</param>
 /// <param name="message">Message shown to recipient, as provided by sender..</param>
 public LineItemGiftCertificateRequestData(string name = default(string), string theme = default(string), decimal?amount = default(decimal?), int?quantity = default(int?), ContactEntity sender = default(ContactEntity), ContactEntity recipient = default(ContactEntity), string message = default(string))
 {
     // to ensure "name" is required (not null)
     if (name == null)
     {
         throw new InvalidDataException("name is a required property for LineItemGiftCertificateRequestData and cannot be null");
     }
     else
     {
         this.Name = name;
     }
     // to ensure "theme" is required (not null)
     if (theme == null)
     {
         throw new InvalidDataException("theme is a required property for LineItemGiftCertificateRequestData and cannot be null");
     }
     else
     {
         this.Theme = theme;
     }
     // to ensure "amount" is required (not null)
     if (amount == null)
     {
         throw new InvalidDataException("amount is a required property for LineItemGiftCertificateRequestData and cannot be null");
     }
     else
     {
         this.Amount = amount;
     }
     // to ensure "quantity" is required (not null)
     if (quantity == null)
     {
         throw new InvalidDataException("quantity is a required property for LineItemGiftCertificateRequestData and cannot be null");
     }
     else
     {
         this.Quantity = quantity;
     }
     // to ensure "sender" is required (not null)
     if (sender == null)
     {
         throw new InvalidDataException("sender is a required property for LineItemGiftCertificateRequestData and cannot be null");
     }
     else
     {
         this.Sender = sender;
     }
     // to ensure "recipient" is required (not null)
     if (recipient == null)
     {
         throw new InvalidDataException("recipient is a required property for LineItemGiftCertificateRequestData and cannot be null");
     }
     else
     {
         this.Recipient = recipient;
     }
     this.Message = message;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemGiftCertificate" /> class.
 /// </summary>
 /// <param name="id">id.</param>
 /// <param name="name">GiftCertificate-provided name that will appear in the control panel..</param>
 /// <param name="theme">Currently supports &#x60;Birthday&#x60;, &#x60;Boy&#x60;, &#x60;Celebration&#x60;, &#x60;Christmas&#x60;, &#x60;General&#x60;, and &#x60;Girl&#x60;. (required).</param>
 /// <param name="amount">Value must be between 1.00 and 1,000.00 in the store&#x27;s default currency. (required).</param>
 /// <param name="isTaxable">isTaxable.</param>
 /// <param name="sender">sender (required).</param>
 /// <param name="recipient">recipient (required).</param>
 /// <param name="message">Limited to 200 characters..</param>
 public ItemGiftCertificate(string id = default(string), string name = default(string), string theme = default(string), decimal?amount = default(decimal?), bool?isTaxable = default(bool?), ContactEntity sender = default(ContactEntity), ContactEntity recipient = default(ContactEntity), string message = default(string))
 {
     // to ensure "theme" is required (not null)
     if (theme == null)
     {
         throw new InvalidDataException("theme is a required property for ItemGiftCertificate and cannot be null");
     }
     else
     {
         this.Theme = theme;
     }
     // to ensure "amount" is required (not null)
     if (amount == null)
     {
         throw new InvalidDataException("amount is a required property for ItemGiftCertificate and cannot be null");
     }
     else
     {
         this.Amount = amount;
     }
     // to ensure "sender" is required (not null)
     if (sender == null)
     {
         throw new InvalidDataException("sender is a required property for ItemGiftCertificate and cannot be null");
     }
     else
     {
         this.Sender = sender;
     }
     // to ensure "recipient" is required (not null)
     if (recipient == null)
     {
         throw new InvalidDataException("recipient is a required property for ItemGiftCertificate and cannot be null");
     }
     else
     {
         this.Recipient = recipient;
     }
     this.Id        = id;
     this.Name      = name;
     this.IsTaxable = isTaxable;
     this.Message   = message;
 }