square_api_client/models/order_line_item_modifier.rs
1//! Model struct for OrderLineItemModifier type
2
3use std::collections::HashMap;
4
5use serde::{Deserialize, Serialize};
6
7use super::Money;
8
9/// A [CatalogModifier].
10#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
11pub struct OrderLineItemModifier {
12 /// A unique ID that identifies the modifier only within this order.
13 pub uid: Option<String>,
14 /// The catalog object ID referencing [CatalogModifier].
15 pub catalog_object_id: Option<String>,
16 /// The version of the catalog object that this modifier references.
17 pub catalog_version: Option<i64>,
18 /// The name of the item modifier.
19 pub name: Option<String>,
20 /// The base price for the modifier.
21 ///
22 /// `base_price_money` is required for ad hoc modifiers. If both `catalog_object_id` and
23 /// `base_price_money` are set, `base_price_money` will override the predefined
24 /// [CatalogModifier] price.
25 pub base_price_money: Option<Money>,
26 /// **Read only** The total price of the item modifier for its line item. This is the modifier's
27 /// base_price_money multiplied by the line item's quantity.
28 pub total_price_money: Option<Money>,
29 /// Application-defined data attached to this order. Metadata fields are intended to store
30 /// descriptive references or associations with an entity in another system or store brief
31 /// information about the object. Square does not process this field; it only stores and returns
32 /// it in relevant API calls. Do not use metadata to store any sensitive information (such as
33 /// personally identifiable information or card details).
34 ///
35 /// Keys written by applications must be 60 characters or less and must be in the character set
36 /// `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are
37 /// prefixed with a namespace, separated from the key with a ':' character.
38 ///
39 /// Values have a maximum length of 255 characters.
40 ///
41 /// An application can have up to 10 entries per metadata field.
42 ///
43 /// Entries written by applications are private and can only be read or modified by the same
44 /// application.
45 ///
46 /// For more information,
47 /// see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
48 pub metadata: Option<HashMap<String, String>>,
49}