Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderLineItem" /> class.
 /// </summary>
 /// <param name="Uid">[beta] Unique ID that identifies the line item only within this order..</param>
 /// <param name="Name">The name of the line item..</param>
 /// <param name="Quantity">The quantity purchased, formatted as a decimal number. For example: &#x60;\&quot;3\&quot;&#x60;.  Line items with a &#x60;quantity_unit&#x60; can have non-integer quantities. For example: &#x60;\&quot;1.70000\&quot;&#x60;. (required).</param>
 /// <param name="QuantityUnit">The unit and precision that this line item&#39;s quantity is measured in..</param>
 /// <param name="Note">The note of the line item..</param>
 /// <param name="CatalogObjectId">The &#x60;CatalogItemVariation&#x60; id applied to this line item..</param>
 /// <param name="VariationName">The name of the variation applied to this line item..</param>
 /// <param name="Metadata">[beta] Application-defined data attached to this line item. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (personally identifiable information, card details, etc.).  Keys written by applications must be 60 characters or less and must be in the character set &#x60;[a-zA-Z0-9_-]&#x60;. Entries may also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a &#39;:&#39; character.  Values have a max length of 255 characters.  An application may have up to 10 entries per metadata field.  Entries written by applications are private and can only be read or modified by the same application.  See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information..</param>
 /// <param name="Modifiers">The &#x60;CatalogModifier&#x60;s applied to this line item..</param>
 /// <param name="Taxes">[deprecated] A list of taxes applied to this line item. On read or retrieve, this list includes both item-level taxes and any order-level taxes apportioned to this item. When creating an Order, set your item-level taxes in this list.  This field has been deprecated in favour of &#x60;applied_taxes&#x60;. Usage of both this field and &#x60;applied_taxes&#x60; when creating an order will result in an error. Usage of this field when sending requests to the UpdateOrder endpoint will result in an error..</param>
 /// <param name="Discounts">[deprecated] A list of discounts applied to this line item. On read or retrieve, this list includes both item-level discounts and any order-level discounts apportioned to this item. When creating an Order, set your item-level discounts in this list.  This field has been deprecated in favour of &#x60;applied_discounts&#x60;. Usage of both this field and &#x60;applied_discounts&#x60; when creating an order will result in an error. Usage of this field when sending requests to the UpdateOrder endpoint will result in an error..</param>
 /// <param name="AppliedTaxes">[beta] The list of references to taxes applied to this line item. Each &#x60;OrderLineItemAppliedTax&#x60; has a &#x60;tax_uid&#x60; that references the &#x60;uid&#x60; of a top-level &#x60;OrderLineItemTax&#x60; applied to the line item. On reads, the amount applied is populated.  An &#x60;OrderLineItemAppliedTax&#x60; will be automatically created on every line item for all &#x60;ORDER&#x60; scoped taxes added to the order. &#x60;OrderLineItemAppliedTax&#x60; records for &#x60;LINE_ITEM&#x60; scoped taxes must be added in requests for the tax to apply to any line items.  To change the amount of a tax, modify the referenced top-level tax..</param>
 /// <param name="AppliedDiscounts">[beta] The list of references to discounts applied to this line item. Each &#x60;OrderLineItemAppliedDiscount&#x60; has a &#x60;discount_uid&#x60; that references the &#x60;uid&#x60; of a top-level &#x60;OrderLineItemDiscounts&#x60; applied to the line item. On reads, the amount applied is populated.  An &#x60;OrderLineItemAppliedDiscount&#x60; will be automatically created on every line item for all &#x60;ORDER&#x60; scoped discounts that are added to the order. &#x60;OrderLineItemAppliedDiscount&#x60; records for &#x60;LINE_ITEM&#x60; scoped discounts must be added in requests for the discount to apply to any line items.  To change the amount of a discount, modify the referenced top-level discount..</param>
 /// <param name="BasePriceMoney">The base price for a single unit of the line item..</param>
 /// <param name="VariationTotalPriceMoney">The total price of all item variations sold in this line item. Calculated as &#x60;base_price_money&#x60; multiplied by &#x60;quantity&#x60;. Does not include modifiers..</param>
 /// <param name="GrossSalesMoney">The amount of money made in gross sales for this line item. Calculated as the sum of the variation&#39;s total price and each modifier&#39;s total price..</param>
 /// <param name="TotalTaxMoney">The total tax amount of money to collect for the line item..</param>
 /// <param name="TotalDiscountMoney">The total discount amount of money to collect for the line item..</param>
 /// <param name="TotalMoney">The total amount of money to collect for this line item..</param>
 public OrderLineItem(string Uid = default(string), string Name = default(string), string Quantity = default(string), OrderQuantityUnit QuantityUnit = default(OrderQuantityUnit), string Note = default(string), string CatalogObjectId = default(string), string VariationName = default(string), Dictionary <string, string> Metadata = default(Dictionary <string, string>), List <OrderLineItemModifier> Modifiers = default(List <OrderLineItemModifier>), List <OrderLineItemTax> Taxes = default(List <OrderLineItemTax>), List <OrderLineItemDiscount> Discounts = default(List <OrderLineItemDiscount>), List <OrderLineItemAppliedTax> AppliedTaxes = default(List <OrderLineItemAppliedTax>), List <OrderLineItemAppliedDiscount> AppliedDiscounts = default(List <OrderLineItemAppliedDiscount>), Money BasePriceMoney = default(Money), Money VariationTotalPriceMoney = default(Money), Money GrossSalesMoney = default(Money), Money TotalTaxMoney = default(Money), Money TotalDiscountMoney = default(Money), Money TotalMoney = default(Money))
 {
     // to ensure "Quantity" is required (not null)
     if (Quantity == null)
     {
         throw new InvalidDataException("Quantity is a required property for OrderLineItem and cannot be null");
     }
     else
     {
         this.Quantity = Quantity;
     }
     this.Uid                      = Uid;
     this.Name                     = Name;
     this.QuantityUnit             = QuantityUnit;
     this.Note                     = Note;
     this.CatalogObjectId          = CatalogObjectId;
     this.VariationName            = VariationName;
     this.Metadata                 = Metadata;
     this.Modifiers                = Modifiers;
     this.Taxes                    = Taxes;
     this.Discounts                = Discounts;
     this.AppliedTaxes             = AppliedTaxes;
     this.AppliedDiscounts         = AppliedDiscounts;
     this.BasePriceMoney           = BasePriceMoney;
     this.VariationTotalPriceMoney = VariationTotalPriceMoney;
     this.GrossSalesMoney          = GrossSalesMoney;
     this.TotalTaxMoney            = TotalTaxMoney;
     this.TotalDiscountMoney       = TotalDiscountMoney;
     this.TotalMoney               = TotalMoney;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderReturnLineItem" /> class.
 /// </summary>
 /// <param name="Uid">Unique identifier for this return line item entry..</param>
 /// <param name="SourceLineItemUid">&#x60;uid&#x60; of the LineItem in the original sale Order..</param>
 /// <param name="Name">The name of the line item..</param>
 /// <param name="Quantity">The quantity returned, formatted as a decimal number. For example: &#x60;\&quot;3\&quot;&#x60;.  Line items with a &#x60;quantity_unit&#x60; can have non-integer quantities. For example: &#x60;\&quot;1.70000\&quot;&#x60;. (required).</param>
 /// <param name="QuantityUnit">The unit and precision that this return line item&#39;s quantity is measured in..</param>
 /// <param name="Note">The note of the returned line item..</param>
 /// <param name="CatalogObjectId">The [CatalogItemVariation](#type-catalogitemvariation) id applied to this returned line item..</param>
 /// <param name="VariationName">The name of the variation applied to this returned line item..</param>
 /// <param name="ReturnModifiers">The [CatalogModifier](#type-catalogmodifier)s applied to this line item..</param>
 /// <param name="ReturnTaxes">A list of taxes applied to this line item. On read or retrieve, this list includes both item-level taxes and any return-level taxes apportioned to this item.  This field has been deprecated in favour of &#x60;applied_taxes&#x60;..</param>
 /// <param name="ReturnDiscounts">A list of discounts applied to this line item. On read or retrieve, this list includes both item-level discounts and any return-level discounts apportioned to this item.  This field has been deprecated in favour of &#x60;applied_discounts&#x60;..</param>
 /// <param name="AppliedTaxes">The list of references to &#x60;OrderReturnTax&#x60; entities applied to the returned line item. Each &#x60;OrderLineItemAppliedTax&#x60; has a &#x60;tax_uid&#x60; that references the &#x60;uid&#x60; of a top-level &#x60;OrderReturnTax&#x60; applied to the returned line item. On reads, the amount applied is populated..</param>
 /// <param name="AppliedDiscounts">The list of references to &#x60;OrderReturnDiscount&#x60; entities applied to the returned line item. Each &#x60;OrderLineItemAppliedDiscount&#x60; has a &#x60;discount_uid&#x60; that references the &#x60;uid&#x60; of a top-level &#x60;OrderReturnDiscount&#x60; applied to the returned line item. On reads, the amount applied is populated..</param>
 /// <param name="BasePriceMoney">The base price for a single unit of the line item..</param>
 /// <param name="VariationTotalPriceMoney">The total price of all item variations returned in this line item. Calculated as &#x60;base_price_money&#x60; multiplied by &#x60;quantity&#x60;. Does not include modifiers..</param>
 /// <param name="GrossReturnMoney">The gross return amount of money calculated as (item base price + modifiers price) * quantity..</param>
 /// <param name="TotalTaxMoney">The total tax amount of money to return for the line item..</param>
 /// <param name="TotalDiscountMoney">The total discount amount of money to return for the line item..</param>
 /// <param name="TotalMoney">The total amount of money to return for this line item..</param>
 public OrderReturnLineItem(string Uid = default(string), string SourceLineItemUid = default(string), string Name = default(string), string Quantity = default(string), OrderQuantityUnit QuantityUnit = default(OrderQuantityUnit), string Note = default(string), string CatalogObjectId = default(string), string VariationName = default(string), List <OrderReturnLineItemModifier> ReturnModifiers = default(List <OrderReturnLineItemModifier>), List <OrderReturnTax> ReturnTaxes = default(List <OrderReturnTax>), List <OrderReturnDiscount> ReturnDiscounts = default(List <OrderReturnDiscount>), List <OrderLineItemAppliedTax> AppliedTaxes = default(List <OrderLineItemAppliedTax>), List <OrderLineItemAppliedDiscount> AppliedDiscounts = default(List <OrderLineItemAppliedDiscount>), Money BasePriceMoney = default(Money), Money VariationTotalPriceMoney = default(Money), Money GrossReturnMoney = default(Money), Money TotalTaxMoney = default(Money), Money TotalDiscountMoney = default(Money), Money TotalMoney = default(Money))
 {
     // to ensure "Quantity" is required (not null)
     if (Quantity == null)
     {
         throw new InvalidDataException("Quantity is a required property for OrderReturnLineItem and cannot be null");
     }
     else
     {
         this.Quantity = Quantity;
     }
     this.Uid = Uid;
     this.SourceLineItemUid = SourceLineItemUid;
     this.Name                     = Name;
     this.QuantityUnit             = QuantityUnit;
     this.Note                     = Note;
     this.CatalogObjectId          = CatalogObjectId;
     this.VariationName            = VariationName;
     this.ReturnModifiers          = ReturnModifiers;
     this.ReturnTaxes              = ReturnTaxes;
     this.ReturnDiscounts          = ReturnDiscounts;
     this.AppliedTaxes             = AppliedTaxes;
     this.AppliedDiscounts         = AppliedDiscounts;
     this.BasePriceMoney           = BasePriceMoney;
     this.VariationTotalPriceMoney = VariationTotalPriceMoney;
     this.GrossReturnMoney         = GrossReturnMoney;
     this.TotalTaxMoney            = TotalTaxMoney;
     this.TotalDiscountMoney       = TotalDiscountMoney;
     this.TotalMoney               = TotalMoney;
 }