pub struct CreatePromotion {Show 32 fields
pub code: Option<String>,
pub name: String,
pub description: Option<String>,
pub internal_notes: Option<String>,
pub promotion_type: PromotionType,
pub trigger: PromotionTrigger,
pub target: PromotionTarget,
pub stacking: StackingBehavior,
pub percentage_off: Option<Decimal>,
pub fixed_amount_off: Option<Decimal>,
pub max_discount_amount: Option<Decimal>,
pub buy_quantity: Option<i32>,
pub get_quantity: Option<i32>,
pub get_discount_percent: Option<Decimal>,
pub tiers: Option<Vec<DiscountTier>>,
pub bundle_product_ids: Option<Vec<ProductId>>,
pub bundle_discount: Option<Decimal>,
pub starts_at: Option<DateTime<Utc>>,
pub ends_at: Option<DateTime<Utc>>,
pub total_usage_limit: Option<i32>,
pub per_customer_limit: Option<i32>,
pub conditions: Option<Vec<CreatePromotionCondition>>,
pub applicable_product_ids: Option<Vec<ProductId>>,
pub applicable_category_ids: Option<Vec<Uuid>>,
pub applicable_skus: Option<Vec<String>>,
pub excluded_product_ids: Option<Vec<ProductId>>,
pub excluded_category_ids: Option<Vec<Uuid>>,
pub eligible_customer_ids: Option<Vec<CustomerId>>,
pub eligible_customer_groups: Option<Vec<String>>,
pub currency: Option<CurrencyCode>,
pub priority: Option<i32>,
pub metadata: Option<Value>,
}Expand description
Create a new promotion
Fields§
§code: Option<String>§name: String§description: Option<String>§internal_notes: Option<String>§promotion_type: PromotionType§trigger: PromotionTrigger§target: PromotionTarget§stacking: StackingBehavior§percentage_off: Option<Decimal>§fixed_amount_off: Option<Decimal>§max_discount_amount: Option<Decimal>§buy_quantity: Option<i32>§get_quantity: Option<i32>§get_discount_percent: Option<Decimal>§tiers: Option<Vec<DiscountTier>>§bundle_product_ids: Option<Vec<ProductId>>§bundle_discount: Option<Decimal>§starts_at: Option<DateTime<Utc>>§ends_at: Option<DateTime<Utc>>§total_usage_limit: Option<i32>§per_customer_limit: Option<i32>§conditions: Option<Vec<CreatePromotionCondition>>§applicable_product_ids: Option<Vec<ProductId>>§applicable_category_ids: Option<Vec<Uuid>>§applicable_skus: Option<Vec<String>>§excluded_product_ids: Option<Vec<ProductId>>§excluded_category_ids: Option<Vec<Uuid>>§eligible_customer_ids: Option<Vec<CustomerId>>§eligible_customer_groups: Option<Vec<String>>§currency: Option<CurrencyCode>§priority: Option<i32>§metadata: Option<Value>Trait Implementations§
Source§impl Clone for CreatePromotion
impl Clone for CreatePromotion
Source§fn clone(&self) -> CreatePromotion
fn clone(&self) -> CreatePromotion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreatePromotion
impl Debug for CreatePromotion
Source§impl Default for CreatePromotion
impl Default for CreatePromotion
Source§fn default() -> CreatePromotion
fn default() -> CreatePromotion
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CreatePromotion
impl<'de> Deserialize<'de> for CreatePromotion
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreatePromotion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreatePromotion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CreatePromotion
impl Serialize for CreatePromotion
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for CreatePromotion
impl RefUnwindSafe for CreatePromotion
impl Send for CreatePromotion
impl Sync for CreatePromotion
impl Unpin for CreatePromotion
impl UnsafeUnpin for CreatePromotion
impl UnwindSafe for CreatePromotion
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
Mutably borrows from an owned value. Read more