pub struct CatalogCustomAttributeDefinition {
pub type: CatalogCustomAttributeDefinitionType,
pub name: String,
pub description: Option<String>,
pub source_application: Option<SourceApplication>,
pub allowed_object_types: Vec<CatalogObjectType>,
pub seller_visibility: Option<CatalogCustomAttributeDefinitionSellerVisibility>,
pub app_visibility: Option<CatalogCustomAttributeDefinitionAppVisibility>,
pub string_config: Option<CatalogCustomAttributeDefinitionStringConfig>,
pub number_config: Option<CatalogCustomAttributeDefinitionNumberConfig>,
pub selection_config: Option<CatalogCustomAttributeDefinitionSelectionConfig>,
pub custom_attribute_usage_count: Option<i32>,
pub key: Option<String>,
}
Expand description
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
The type of this custom attribute. Cannot be modified after creation. Required.
name: String
The 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<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<SourceApplication>
Read only. Contains information about the application that created this custom attribute definition.
allowed_object_types: Vec<CatalogObjectType>
The set of Catalog Object Types that this Custom Attribute may be applied to. Currently,
only ITEM
and ITEM_VARIATION
are allowed. At least one type must be included.
seller_visibility: Option<CatalogCustomAttributeDefinitionSellerVisibility>
The visibility of a custom attribute in seller-facing UIs (including Square Point of Sale applications and Square Dashboard). May be modified.
app_visibility: Option<CatalogCustomAttributeDefinitionAppVisibility>
The visibility of a custom attribute to applications other than the application that created the attribute.
string_config: Option<CatalogCustomAttributeDefinitionStringConfig>
Optionally, populated when type
= STRING
, unset otherwise.
number_config: Option<CatalogCustomAttributeDefinitionNumberConfig>
Optionally, populated when type
= NUMBER
, unset otherwise.
selection_config: Option<CatalogCustomAttributeDefinitionSelectionConfig>
Populated when type
is set to SELECTION
, unset otherwise.
custom_attribute_usage_count: Option<i32>
Read-only. 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<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_-]
.
Trait Implementations§
Source§impl Clone for CatalogCustomAttributeDefinition
impl Clone for CatalogCustomAttributeDefinition
Source§fn clone(&self) -> CatalogCustomAttributeDefinition
fn clone(&self) -> CatalogCustomAttributeDefinition
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for CatalogCustomAttributeDefinition
impl Default for CatalogCustomAttributeDefinition
Source§fn default() -> CatalogCustomAttributeDefinition
fn default() -> CatalogCustomAttributeDefinition
Source§impl<'de> Deserialize<'de> for CatalogCustomAttributeDefinition
impl<'de> Deserialize<'de> for CatalogCustomAttributeDefinition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CatalogCustomAttributeDefinition
impl PartialEq for CatalogCustomAttributeDefinition
Source§fn eq(&self, other: &CatalogCustomAttributeDefinition) -> bool
fn eq(&self, other: &CatalogCustomAttributeDefinition) -> bool
self
and other
values to be equal, and is used by ==
.impl Eq for CatalogCustomAttributeDefinition
impl StructuralPartialEq for CatalogCustomAttributeDefinition
Auto Trait Implementations§
impl Freeze for CatalogCustomAttributeDefinition
impl RefUnwindSafe for CatalogCustomAttributeDefinition
impl Send for CatalogCustomAttributeDefinition
impl Sync for CatalogCustomAttributeDefinition
impl Unpin for CatalogCustomAttributeDefinition
impl UnwindSafe for CatalogCustomAttributeDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.