pub struct CatalogCustomAttributeDefinition {
pub type: CatalogCustomAttributeDefinitionType,
pub name: String,
pub description: Option<Option<String>>,
pub source_application: Option<Box<SourceApplication>>,
pub allowed_object_types: Vec<CatalogObjectType>,
pub seller_visibility: Option<CatalogCustomAttributeDefinitionSellerVisibility>,
pub app_visibility: Option<CatalogCustomAttributeDefinitionAppVisibility>,
pub string_config: Option<Box<CatalogCustomAttributeDefinitionStringConfig>>,
pub number_config: Option<Box<CatalogCustomAttributeDefinitionNumberConfig>>,
pub selection_config: Option<Box<CatalogCustomAttributeDefinitionSelectionConfig>>,
pub custom_attribute_usage_count: Option<i32>,
pub key: Option<Option<String>>,
}Expand description
CatalogCustomAttributeDefinition : Contains information defining a custom attribute. Custom attributes are intended to store additional information about a catalog object or to associate a catalog object with an entity in another system. Do not use custom attributes to store any sensitive information (personally identifiable information, card details, etc.). Read more about custom attributes
Fields§
§type: CatalogCustomAttributeDefinitionType§name: StringThe name of this definition for API and seller-facing UI purposes. The name must be unique within the (merchant, application) pair. Required. May not be empty and may not exceed 255 characters. Can be modified after creation.
description: Option<Option<String>>Seller-oriented description of the meaning of this Custom Attribute, any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs.
source_application: Option<Box<SourceApplication>>§allowed_object_types: Vec<CatalogObjectType>The set of CatalogObject types that this custom atttribute may be applied to. Currently, only ITEM, ITEM_VARIATION, MODIFIER, MODIFIER_LIST, and CATEGORY are allowed. At least one type must be included. See CatalogObjectType for possible values
seller_visibility: Option<CatalogCustomAttributeDefinitionSellerVisibility>§app_visibility: Option<CatalogCustomAttributeDefinitionAppVisibility>§string_config: Option<Box<CatalogCustomAttributeDefinitionStringConfig>>§number_config: Option<Box<CatalogCustomAttributeDefinitionNumberConfig>>§selection_config: Option<Box<CatalogCustomAttributeDefinitionSelectionConfig>>§custom_attribute_usage_count: Option<i32>The number of custom attributes that reference this custom attribute definition. Set by the server in response to a ListCatalog request with include_counts set to true. If the actual count is greater than 100, custom_attribute_usage_count will be set to 100.
key: Option<Option<String>>The name of the desired custom attribute key that can be used to access the custom attribute value on catalog objects. Cannot be modified after the custom attribute definition has been created. Must be between 1 and 60 characters, and may only contain the characters [a-zA-Z0-9_-].
Implementations§
Source§impl CatalogCustomAttributeDefinition
impl CatalogCustomAttributeDefinition
Sourcepub fn new(
type: CatalogCustomAttributeDefinitionType,
name: String,
allowed_object_types: Vec<CatalogObjectType>,
) -> CatalogCustomAttributeDefinition
pub fn new( type: CatalogCustomAttributeDefinitionType, name: String, allowed_object_types: Vec<CatalogObjectType>, ) -> CatalogCustomAttributeDefinition
Contains information defining a custom attribute. Custom attributes are intended to store additional information about a catalog object or to associate a catalog object with an entity in another system. Do not use custom attributes to store any sensitive information (personally identifiable information, card details, etc.). Read more about custom attributes
Trait Implementations§
Source§impl Clone for CatalogCustomAttributeDefinition
impl Clone for CatalogCustomAttributeDefinition
Source§fn clone(&self) -> CatalogCustomAttributeDefinition
fn clone(&self) -> CatalogCustomAttributeDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more