square_api_client/models/order_line_item_applied_discount.rs
1//! Model struct for OrderLineItemAppliedDiscount type
2
3use serde::{Deserialize, Serialize};
4
5use super::Money;
6
7/// Represents an applied portion of a discount to a line item in an order.
8///
9/// Order scoped discounts have automatically applied discounts present for each line item.
10/// Line-item scoped discounts must have applied discounts added manually for any applicable line
11/// items. The corresponding applied money is automatically computed based on participating line
12/// items.
13#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
14pub struct OrderLineItemAppliedDiscount {
15 /// A unique ID that identifies the applied discount only within this order.
16 pub uid: Option<String>,
17 /// The `uid` of the discount that the applied discount represents. It must reference a discount
18 /// present in the `order.discounts` field.
19 ///
20 /// This field is immutable. To change which discounts apply to a line item, you must delete the
21 /// discount and re-add it as a new `OrderLineItemAppliedDiscount`.
22 pub discount_uid: String,
23 /// **Read only** The amount of money applied by the discount to the line item.
24 pub applied_money: Option<Money>,
25}