Struct CatalogItemVariation

Source
pub struct CatalogItemVariation {
Show 21 fields pub item_id: Option<String>, pub name: Option<String>, pub sku: Option<String>, pub upc: Option<String>, pub ordinal: Option<i32>, pub pricing_type: Option<CatalogPricingType>, pub price_money: Option<Money>, pub location_overrides: Option<Vec<ItemVariationLocationOverrides>>, pub track_inventory: Option<bool>, pub inventory_alert_type: Option<InventoryAlertType>, pub inventory_alert_threshold: Option<i64>, pub user_data: Option<String>, pub service_duration: Option<i64>, pub available_for_booking: Option<bool>, pub item_option_values: Option<Vec<CatalogItemOptionValueForItemVariation>>, pub measurement_unit_id: Option<String>, pub sellable: Option<bool>, pub stockable: Option<bool>, pub image_ids: Option<Vec<String>>, pub team_member_ids: Option<Vec<String>>, pub stockable_conversion: Option<CatalogStockConversion>,
}
Expand description

An item variation (i.e., product) in the Catalog object model.

Each item may have a maximum of 250 item variations.

Fields§

§item_id: Option<String>

The ID of the CatalogItem associated with this item variation.

§name: Option<String>

The item variation’s name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.

Max Length 255

§sku: Option<String>

The item variation’s SKU, if any. This is a searchable attribute for use in applicable query filters.

§upc: Option<String>

The universal product code (UPC) of the item variation, if any. This is a searchable attribute for use in applicable query filters.

The value of this attribute should be a number of 12-14 digits long. This restriction is enforced on the Square Seller Dashboard, Square Point of Sale or Retail Point of Sale apps, where this attribute shows in the GTIN field. If a non-compliant UPC value is assigned to this attribute using the API, the value is not editable on the Seller Dashboard, Square Point of Sale or Retail Point of Sale apps unless it is updated to fit the expected format.

§ordinal: Option<i32>

Read only The order in which this item variation should be displayed. This value is read-only. On writes, the ordinal for each item variation within a parent CatalogItem is set according to the item variations’s position. On reads, the value is not guaranteed to be sequential or unique.

§pricing_type: Option<CatalogPricingType>

Indicates whether the item variation’s price is fixed or determined at the time of sale.

§price_money: Option<Money>

The item variation’s price, if fixed pricing is used.

§location_overrides: Option<Vec<ItemVariationLocationOverrides>>

Per-location price and inventory overrides.

§track_inventory: Option<bool>

If true, inventory tracking is active for the variation.

§inventory_alert_type: Option<InventoryAlertType>

Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its inventory_alert_threshold.

§inventory_alert_threshold: Option<i64>

If the inventory quantity for the variation is less than or equal to this value and inventory_alert_type is LOW_QUANTITY, the variation displays an alert in the merchant dashboard.

This value is always an integer.

§user_data: Option<String>

Arbitrary user metadata to associate with the item variation. This attribute value length is of Unicode code points.

Max Length 255

§service_duration: Option<i64>

If the CatalogItem that owns this item variation is of type APPOINTMENTS_SERVICE, then this is the duration of the service in milliseconds. For example, a 30 minute appointment would have the value 1800000, which is equal to 30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per second).

§available_for_booking: Option<bool>

If the CatalogItem that owns this item variation is of type APPOINTMENTS_SERVICE, a bool representing whether this service is available for booking.

§item_option_values: Option<Vec<CatalogItemOptionValueForItemVariation>>

List of item option values associated with this item variation. Listed in the same order as the item options of the parent item.

§measurement_unit_id: Option<String>

ID of the CatalogMeasurementUnit that is used to measure the quantity sold of this item variation. If left unset, the item will be sold in whole quantities.

§sellable: Option<bool>

Whether this variation can be sold.

§stockable: Option<bool>

Whether stock is counted directly on this variation (TRUE) or only on its components (FALSE).

§image_ids: Option<Vec<String>>

The IDs of images associated with this CatalogItemVariation instance. These images will be shown to customers in Square Online Store.

§team_member_ids: Option<Vec<String>>

Tokens of employees that can perform the service represented by this variation. Only valid for variations of type APPOINTMENTS_SERVICE.

§stockable_conversion: Option<CatalogStockConversion>

The rule of conversion of the CatalogStockConversion type that describes how this non-stockable sellable/receivable item variation is converted to/from the stockable item variation sharing the same parent item.

Trait Implementations§

Source§

impl Clone for CatalogItemVariation

Source§

fn clone(&self) -> CatalogItemVariation

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CatalogItemVariation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CatalogItemVariation

Source§

fn default() -> CatalogItemVariation

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CatalogItemVariation

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CatalogItemVariation

Source§

fn eq(&self, other: &CatalogItemVariation) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CatalogItemVariation

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for CatalogItemVariation

Source§

impl StructuralPartialEq for CatalogItemVariation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,