using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace gehGassi.Klarna.Checkout
{
public class OrderLine
{
///
/// Type of the order line item. The possible values are:<ul><li><em>physical (physical good)</em></li><li><em>discount</em></li><li><em>shipping_fee</em></li><li><em>sales_tax (depends on the country/city, usually called VAT)</em></li><li><em>digital (digital good)</em></li><li><em>gift_card</em></li><li><em>store_credit (credit from the merchant)</em></li><li><em>surcharge (extra charge)</em></li></ul>
///
/// Type of the order line item. The possible values are:<ul><li><em>physical (physical good)</em></li><li><em>discount</em></li><li><em>shipping_fee</em></li><li><em>sales_tax (depends on the country/city, usually called VAT)</em></li><li><em>digital (digital good)</em></li><li><em>gift_card</em></li><li><em>store_credit (credit from the merchant)</em></li><li><em>surcharge (extra charge)</em></li></ul>
[JsonProperty("type")]
public string Type { get; set; }
///
/// Article number, SKU or similar. (max 64 characters)
///
/// Article number, SKU or similar. (max 64 characters)
[StringLength(64, MinimumLength = 0)]
[JsonProperty("reference")]
public string Reference { get; set; }
///
/// Descriptive name of the order line item (max 255 characters)
///
/// Descriptive name of the order line item (max 255 characters)
[Required]
[StringLength(255, MinimumLength = 1)]
[JsonProperty("name")]
public string Name { get; set; }
///
/// Non-negative number. Quantity of the order line item.
///
/// Non-negative number. Quantity of the order line item.
[Required]
[JsonProperty("quantity")]
public long? Quantity { get; set; }
///
/// Unit used to describe the quantity, e.g. kg, pcs... If defined has to be 1-8 characters
///
/// Unit used to describe the quantity, e.g. kg, pcs... If defined has to be 1-8 characters
[JsonProperty("quantity_unit")]
public string QuantityUnit { get; set; }
///
/// Minor units. Includes tax, excludes discount. (max value: 100000000). Example: 100 Euros should be 10000.
///
/// Minor units. Includes tax, excludes discount. (max value: 100000000). Example: 100 Euros should be 10000.
[Required]
[JsonProperty("unit_price")]
public long? UnitPrice { get; set; }
///
/// Non-negative value. The percentage value is represented with two implicit decimals. (max 10000) Example: 25% should be 2500.
///
/// Non-negative value. The percentage value is represented with two implicit decimals. (max 10000) Example: 25% should be 2500.
[Required]
[JsonProperty("tax_rate")]
public long? TaxRate { get; set; }
///
/// Minor units. Includes tax and discount. Example: 25 euros should be 2500 Value = (quantity x unit_price) - total_discount_amount. (max value: 100000000)
///
/// Minor units. Includes tax and discount. Example: 25 euros should be 2500 Value = (quantity x unit_price) - total_discount_amount. (max value: 100000000)
[Required]
[JsonProperty("total_amount")]
public long? TotalAmount { get; set; }
///
/// Non-negative minor units. Includes tax. Example: 25 euros should be 2500
///
/// Non-negative minor units. Includes tax. Example: 25 euros should be 2500
[JsonProperty("total_discount_amount")]
public long? TotalDiscountAmount { get; set; }
///
/// Must be within ±1 of total_amount - total_amount \\* 10000 / (10000 + tax_rate). Negative when type is discount.
///
/// Must be within ±1 of total_amount - total_amount \\* 10000 / (10000 + tax_rate). Negative when type is discount.
[Required]
[JsonProperty("total_tax_amount")]
public long? TotalTaxAmount { get; set; }
///
/// Property used to store additional metadata per item that will be returned whenever an order is read from Klarna. Pass through field. (max 1024 characters).
///
/// Property used to store additional metadata per item that will be returned whenever an order is read from Klarna. Pass through field. (max 1024 characters).
[StringLength(1024, MinimumLength = 0)]
[JsonProperty("merchant_data")]
public string MerchantData { get; set; }
///
/// URL to the product page that can be later embedded in communications between Klarna and the customer. (max 1024 characters)
///
/// URL to the product page that can be later embedded in communications between Klarna and the customer. (max 1024 characters)
[StringLength(1024, MinimumLength = 0)]
[JsonProperty("product_url")]
public string ProductUrl { get; set; }
///
/// URL to an image that can be later embedded in communications between Klarna and the customer. (max 1024 characters) Improves post-purchase customer experiences.
///
/// URL to an image that can be later embedded in communications between Klarna and the customer. (max 1024 characters) Improves post-purchase customer experiences.
[StringLength(1024, MinimumLength = 0)]
[JsonProperty("image_url")]
public string ImageUrl { get; set; }
///
/// Gets or Sets ProductIdentifiers
///
[JsonProperty("product_identifiers")]
public ProductIdentifiers ProductIdentifiers { get; set; }
///
/// Gets or Sets ShippingAttributes
///
[JsonProperty("shipping_attributes")]
public ShippingAttributes ShippingAttributes { get; set; }
}
}