squareup/models/
catalog_item_modifier_list_info.rs

1//! Model struct for CatalogItemModifierListInfo type.
2
3use serde::{Deserialize, Serialize};
4use crate::models::enums::{AllowQuantities, HiddenFromCustomerOverride, IsConversational};
5use super::CatalogModifierOverride;
6
7/// Options to control the properties of a `CatalogModifierList` applied to a `CatalogItem`
8/// instance.
9#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
10pub struct CatalogItemModifierListInfo {
11    /// The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`.
12    /// Min Length 1
13    pub modifier_list_id: String,
14    /// A set of `CatalogModifierOverride` objects that override default modifier settings for this
15    /// item.
16    pub modifier_overrides: Option<Vec<CatalogModifierOverride>>,
17    /// The minimum number of modifiers that must be selected from this modifier list. Values:
18    ///     0: No selection is required.
19    ///     -1: Default value, the attribute was not set by the client. When max_selected_modifiers is also -1, use the minimum and maximum selection values set on the CatalogItemModifierList.
20    ///     >0: The required minimum modifier selections. This can be larger than the total CatalogModifiers when allow_quantities is enabled.
21    ///     < -1: Invalid. Treated as no selection required.
22    pub min_selected_modifiers: Option<i32>,
23    /// The maximum number of modifiers that can be selected. Values:
24    ///     0: No maximum limit.
25    ///     -1: Default value, the attribute was not set by the client. When min_selected_modifiers is also -1, use the minimum and maximum selection values set on the CatalogItemModifierList.
26    ///     >0: The maximum total modifier selections. This can be larger than the total CatalogModifiers when allow_quantities is enabled.
27    ///     < -1: Invalid. Treated as no maximum limit.
28    pub max_selected_modifiers: Option<i32>,
29    /// If `true`, enable this `CatalogModifierList`. The default value is `true`.
30    pub enabled: Option<bool>,
31    /// The position of this `CatalogItemModifierListInfo` object within the modifier_list_info
32    /// list applied to a `CatalogItem` instance.
33    pub ordinal: Option<i32>,
34    /// Controls whether multiple quantities of the same modifier can be selected for this item.
35    ///     `YES` means that every modifier in the `CatalogModifierList` can have multiple quantities selected for this item.
36    ///     `NO` means that each modifier in the `CatalogModifierList` can be selected only once for this item.
37    ///     `NOT_SET` means that the allow_quantities setting on the `CatalogModifierList` is obeyed.
38    pub allow_quantities: Option<AllowQuantities>,
39    /// Controls whether conversational mode is enabled for modifiers on this item.
40    ///     `YES` means conversational mode is enabled for every modifier in the `CatalogModifierList`.
41    ///     `NO` means that conversational mode is not enabled for any modifier in the `CatalogModifierList`.
42    ///     `NOT_SET` means that conversational mode is not enabled for any modifier in the `CatalogModifierList`.
43    pub is_conversational: Option<IsConversational>,
44    /// Controls whether all modifiers for this item are hidden from customer receipts.
45    ///     `YES` means that all modifiers in the `CatalogModifierList` are hidden from customer receipts for this item.
46    ///     `NO` means that all modifiers in the `CatalogModifierList` are visible on customer receipts for this item.
47    ///     `NOT_SET` means that the hidden_from_customer setting on the `CatalogModifierList` is obeyed.
48    pub hidden_from_customer_override: Option<HiddenFromCustomerOverride>,
49}