Struct CatalogObject

Source
pub struct CatalogObject {
Show 27 fields pub type: CatalogObjectType, pub id: String, pub updated_at: Option<DateTime>, pub version: Option<i64>, pub is_deleted: Option<bool>, pub custom_attribute_values: Option<HashMap<String, CatalogCustomAttributeValue>>, pub catalog_v1_ids: Option<Vec<CatalogV1Id>>, pub present_at_all_locations: Option<bool>, pub present_at_location_ids: Option<Vec<String>>, pub absent_at_location_ids: Option<Vec<String>>, pub item_data: Option<CatalogItem>, pub category_data: Option<CatalogCategory>, pub item_variation_data: Option<CatalogItemVariation>, pub tax_data: Option<CatalogTax>, pub discount_data: Option<CatalogDiscount>, pub modifier_list_data: Option<CatalogModifierList>, pub modifier_data: Option<CatalogModifier>, pub time_period_data: Option<CatalogTimePeriod>, pub product_set_data: Option<CatalogProductSet>, pub pricing_rule_data: Option<CatalogPricingRule>, pub image_data: Option<CatalogImage>, pub measurement_unit_data: Option<CatalogMeasurementUnit>, pub subscription_plan_data: Option<CatalogSubscriptionPlan>, pub item_option_data: Option<CatalogItemOption>, pub item_option_value_data: Option<CatalogItemOptionValue>, pub custom_attribute_definition_data: Option<CatalogCustomAttributeDefinition>, pub quick_amounts_settings_data: Option<CatalogQuickAmountsSettings>,
}
Expand description

The wrapper object for the catalog entries of a given object type.

Depending on the type attribute value, a CatalogObject instance assumes a type-specific data to yield the corresponding type of catalog object.

For example, if type=ITEM, the CatalogObject instance must have the ITEM-specific data set on the item_data attribute. The resulting CatalogObject instance is also a CatalogItem instance.

In general, if type=<OBJECT_TYPE>, the CatalogObject instance must have the <OBJECT_TYPE>-specific data set on the <object_type>_data attribute. The resulting CatalogObject instance is also a Catalog<ObjectType> instance.

For a more detailed discussion of the Catalog data model, please see the Design a Catalog guide.

Fields§

§type: CatalogObjectType

The type of this object. Each object type has expected properties expressed in a structured format within its corresponding *_data field below.

§id: String

An identifier to reference this object in the catalog. When a new CatalogObject is inserted, the client should set the id to a temporary identifier starting with a “#” character. Other objects being inserted or updated within the same request may use this identifier to refer to the new object.

When the server receives the new object, it will supply a unique identifier that replaces the temporary identifier for all future references.

§updated_at: Option<DateTime>

Read only Last modification timestamp.

§version: Option<i64>

The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting.

§is_deleted: Option<bool>

If true, the object has been deleted from the database. Must be false for new objects being inserted. When deleted, the updated_at field will equal the deletion time.

§custom_attribute_values: Option<HashMap<String, CatalogCustomAttributeValue>>

A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair is a CatalogCustomAttributeValue object. The key is the key attribute value defined in the associated CatalogCustomAttributeDefinition object defined by the application making the request.

If the CatalogCustomAttributeDefinition object is defined by another application, the CatalogCustomAttributeDefinition’s key attribute value is prefixed by the defining application ID. For example, if the CatalogCustomAttributeDefinition has a key attribute of "cocoa_brand" and the defining application ID is "abcd1234", the key in the map is "abcd1234:cocoa_brand" if the application making the request is different from the application defining the custom attribute definition. Otherwise, the key used in the map is simply "cocoa_brand".

Application-defined custom attributes are set at a global (location-independent) level. Custom attribute values are intended to store additional information about a catalog object or associations with an entity in another system. Do not use custom attributes to store any sensitive information (personally identifiable information, card details, etc.).

§catalog_v1_ids: Option<Vec<CatalogV1Id>>

The Connect v1 IDs for this object at each location where it is present, where they differ from the object’s Connect V2 ID. The field will only be present for objects that have been created or modified by legacy APIs.

§present_at_all_locations: Option<bool>

If true, this object is present at all locations (including future locations), except where specified in the absent_at_location_ids field. If false, this object is not present at any locations (including future locations), except where specified in the present_at_location_ids field. If not specified, defaults to true.

§present_at_location_ids: Option<Vec<String>>

A list of locations where the object is present, even if present_at_all_locations is false. This can include locations that are deactivated.

§absent_at_location_ids: Option<Vec<String>>

A list of locations where the object is not present, even if present_at_all_locations is true. This can include locations that are deactivated.

§item_data: Option<CatalogItem>

Structured data for a CatalogItem, set for CatalogObjects of type ITEM.

§category_data: Option<CatalogCategory>

Structured data for a CatalogCategory, set for CatalogObjects of type CATEGORY.

§item_variation_data: Option<CatalogItemVariation>

Structured data for a CatalogItemVariation, set for CatalogObjects of type ITEM_VARIATION.

§tax_data: Option<CatalogTax>

Structured data for a CatalogTax, set for CatalogObjects of type TAX.

§discount_data: Option<CatalogDiscount>

Structured data for a CatalogDiscount, set for CatalogObjects of type DISCOUNT.

§modifier_list_data: Option<CatalogModifierList>

Structured data for a CatalogModifierList, set for CatalogObjects of type MODIFIER_LIST.

§modifier_data: Option<CatalogModifier>

Structured data for a CatalogModifier, set for CatalogObjects of type MODIFIER.

§time_period_data: Option<CatalogTimePeriod>

Structured data for a CatalogTimePeriod, set for CatalogObjects of type TIME_PERIOD.

§product_set_data: Option<CatalogProductSet>

Structured data for a CatalogProductSet, set for CatalogObjects of type PRODUCT_SET.

§pricing_rule_data: Option<CatalogPricingRule>

Structured data for a CatalogPricingRule, set for CatalogObjects of type PRICING_RULE. A CatalogPricingRule object often works with a CatalogProductSet object or a CatalogTimePeriod object.

§image_data: Option<CatalogImage>

Structured data for a CatalogImage, set for CatalogObjects of type IMAGE.

§measurement_unit_data: Option<CatalogMeasurementUnit>

Structured data for a CatalogMeasurementUnit, set for CatalogObjects of type MEASUREMENT_UNIT.

§subscription_plan_data: Option<CatalogSubscriptionPlan>

Structured data for a CatalogSubscriptionPlan, set for CatalogObjects of type SUBSCRIPTION_PLAN.

§item_option_data: Option<CatalogItemOption>

Structured data for a CatalogItemOption, set for CatalogObjects of type ITEM_OPTION.

§item_option_value_data: Option<CatalogItemOptionValue>

Structured data for a CatalogItemOptionValue, set for CatalogObjects of type ITEM_OPTION_VAL.

§custom_attribute_definition_data: Option<CatalogCustomAttributeDefinition>

Structured data for a CatalogCustomAttributeDefinition, set for CatalogObjects of type CUSTOM_ATTRIBUTE_DEFINITION.

§quick_amounts_settings_data: Option<CatalogQuickAmountsSettings>

Structured data for a CatalogQuickAmountsSettings, set for CatalogObjects of type QUICK_AMOUNTS_SETTINGS.

Trait Implementations§

Source§

impl Clone for CatalogObject

Source§

fn clone(&self) -> CatalogObject

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 CatalogObject

Source§

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

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

impl Default for CatalogObject

Source§

fn default() -> CatalogObject

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

impl<'de> Deserialize<'de> for CatalogObject

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 CatalogObject

Source§

fn eq(&self, other: &CatalogObject) -> 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 CatalogObject

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 CatalogObject

Source§

impl StructuralPartialEq for CatalogObject

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,