square_api_client/models/item_variation_location_overrides.rs
1//! Model struct for ItemVariationLocationOverrides type.
2
3use serde::{Deserialize, Serialize};
4
5use super::{
6 enums::{CatalogPricingType, InventoryAlertType},
7 DateTime, Money,
8};
9
10/// Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`.
11#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
12pub struct ItemVariationLocationOverrides {
13 /// The ID of the `Location`. This can include locations that are deactivated.
14 pub location_id: Option<String>,
15 /// The price of the `CatalogItemVariation` at the given `Location`, or blank for variable
16 /// pricing.
17 pub price_money: Option<Money>,
18 /// The pricing type (fixed or variable) for the `CatalogItemVariation` at the given `Location`.
19 pub pricing_type: Option<CatalogPricingType>,
20 /// If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`.
21 pub track_inventory: Option<bool>,
22 /// Indicates whether the `CatalogItemVariation` displays an alert when its inventory quantity
23 /// is less than or equal to its `inventory_alert_threshold`.
24 pub inventory_alert_type: Option<InventoryAlertType>,
25 /// If the inventory quantity for the variation is less than or equal to this value and
26 /// `inventory_alert_type` is `LOW_QUANTITY`, the variation displays an alert in the merchant
27 /// dashboard.
28 ///
29 /// This value is always an integer.
30 pub inventory_alert_threshold: Option<i64>,
31 /// **Read only** Indicates whether the overridden item variation is sold out at the specified
32 /// location.
33 ///
34 /// When inventory tracking is enabled on the item variation either globally or at the specified
35 /// location, the item variation is automatically marked as sold out when its inventory count
36 /// reaches zero. The seller can manually set the item variation as sold out even when the
37 /// inventory count is greater than zero. Attempts by an application to set this attribute are
38 /// ignored. Regardless how the sold-out status is set, applications should treat its inventory
39 /// count as zero when this attribute value is `true`.
40 pub sold_out: Option<bool>,
41 /// **Read only** The seller-assigned timestamp to indicate when this sold-out variation becomes
42 /// available again at the specified location. Attempts by an application to set this attribute
43 /// are ignored. When the current time is later than this attribute value, the affected item
44 /// variation is no longer sold out.
45 pub sold_out_valid_until: Option<DateTime>,
46}