pub struct PromotionAsset {
pub promotion_target: String,
pub discount_modifier: i32,
pub redemption_start_date: String,
pub redemption_end_date: String,
pub occasion: i32,
pub language_code: String,
pub start_date: String,
pub end_date: String,
pub ad_schedule_targets: Vec<AdScheduleInfo>,
pub discount_type: Option<DiscountType>,
pub promotion_trigger: Option<PromotionTrigger>,
}
Expand description
A Promotion asset.
Fields§
§promotion_target: String
Required. A freeform description of what the promotion is targeting.
discount_modifier: i32
A modifier for qualification of the discount.
redemption_start_date: String
Start date of when the promotion is eligible to be redeemed, in yyyy-MM-dd format.
redemption_end_date: String
Last date of when the promotion is eligible to be redeemed, in yyyy-MM-dd format.
occasion: i32
The occasion the promotion was intended for. If an occasion is set, the redemption window will need to fall within the date range associated with the occasion.
language_code: String
The language of the promotion. Represented as BCP 47 language tag.
start_date: String
Start date of when this asset is effective and can begin serving, in yyyy-MM-dd format.
end_date: String
Last date of when this asset is effective and still serving, in yyyy-MM-dd format.
ad_schedule_targets: Vec<AdScheduleInfo>
List of non-overlapping schedules specifying all time intervals for which the asset may serve. There can be a maximum of 6 schedules per day, 42 in total.
discount_type: Option<DiscountType>
Discount type, can be percentage off or amount off.
promotion_trigger: Option<PromotionTrigger>
Promotion trigger. Can be by promotion code or promo by eligible order amount.
Implementations§
Source§impl PromotionAsset
impl PromotionAsset
Sourcepub fn discount_modifier(&self) -> PromotionExtensionDiscountModifier
pub fn discount_modifier(&self) -> PromotionExtensionDiscountModifier
Returns the enum value of discount_modifier
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_discount_modifier(
&mut self,
value: PromotionExtensionDiscountModifier,
)
pub fn set_discount_modifier( &mut self, value: PromotionExtensionDiscountModifier, )
Sets discount_modifier
to the provided enum value.
Sourcepub fn occasion(&self) -> PromotionExtensionOccasion
pub fn occasion(&self) -> PromotionExtensionOccasion
Returns the enum value of occasion
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_occasion(&mut self, value: PromotionExtensionOccasion)
pub fn set_occasion(&mut self, value: PromotionExtensionOccasion)
Sets occasion
to the provided enum value.
Trait Implementations§
Source§impl Clone for PromotionAsset
impl Clone for PromotionAsset
Source§fn clone(&self) -> PromotionAsset
fn clone(&self) -> PromotionAsset
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PromotionAsset
impl Debug for PromotionAsset
Source§impl Default for PromotionAsset
impl Default for PromotionAsset
Source§impl Message for PromotionAsset
impl Message for PromotionAsset
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.Source§impl PartialEq for PromotionAsset
impl PartialEq for PromotionAsset
impl StructuralPartialEq for PromotionAsset
Auto Trait Implementations§
impl Freeze for PromotionAsset
impl RefUnwindSafe for PromotionAsset
impl Send for PromotionAsset
impl Sync for PromotionAsset
impl Unpin for PromotionAsset
impl UnwindSafe for PromotionAsset
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request