square_api_client/models/
order_quantity_unit.rs

1//! Model struct for OrderQuantityUnit type
2
3use serde::{Deserialize, Serialize};
4
5use super::MeasurementUnit;
6
7/// Contains the measurement unit for a quantity and a precision that specifies the number of digits
8/// after the decimal point for decimal quantities.
9#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
10pub struct OrderQuantityUnit {
11    /// A [MeasurementUnit] that represents the unit of measure for the quantity.
12    pub measurement_unit: Option<MeasurementUnit>,
13    /// For non-integer quantities, represents the number of digits after the decimal point that are
14    /// recorded for this quantity.
15    ///
16    /// For example, a precision of 1 allows quantities such as "1.0" and "1.1", but not "1.01".
17    ///
18    /// Min: 0. Max: 5.
19    pub precision: Option<i32>,
20    /// The catalog object ID referencing the [CatalogMeasurementUnit].
21    ///
22    /// This field is set when this is a catalog-backed measurement unit.
23    pub catalog_object_id: Option<String>,
24    /// The version of the catalog object that this measurement unit references.
25    ///
26    /// This field is set when this is a catalog-backed measurement unit.
27    pub catalog_version: Option<i64>,
28}