square_api_client/models/
catalog_custom_attribute_value.rs

1//! Model struct for CatalogCustomAttributeValue type.
2
3use serde::{Deserialize, Serialize};
4
5use super::enums::CatalogCustomAttributeDefinitionType;
6
7/// An instance of a custom attribute.
8///
9/// Custom attributes can be defined and added to `ITEM` and `ITEM_VARIATION` type catalog objects.
10/// [Read more about custom
11/// attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes).
12#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
13pub struct CatalogCustomAttributeValue {
14    /// The name of the custom attribute.
15    pub name: Option<String>,
16    /// The string value of the custom attribute. Populated if `type` = `STRING`.
17    pub string_value: Option<String>,
18    /// **Read-only.** The id of the [CatalogCustomAttributeDefinition] this value belongs to.
19    pub custom_attribute_definition_id: Option<String>,
20    /// **Read-only.** A copy of type from the associated `CatalogCustomAttributeDefinition`.
21    pub r#type: Option<CatalogCustomAttributeDefinitionType>,
22    /// Populated if `type` = `NUMBER`. Contains a string representation of a decimal number, using
23    /// a `.` as the decimal separator.
24    pub number_value: Option<String>,
25    /// A `true` or `false` value. Populated if `type` = `BOOLEAN`.
26    pub boolean_value: Option<bool>,
27    /// One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`.
28    pub selection_uid_values: Option<Vec<String>>,
29    /// **Read-only.** A copy of key from the associated `CatalogCustomAttributeDefinition`.
30    pub key: Option<String>,
31}