pub struct Attributes {
Show 30 fields pub product_applicability: i32, pub offer_type: i32, pub generic_redemption_code: String, pub long_title: String, pub coupon_value_type: i32, pub promotion_destinations: Vec<i32>, pub item_id_inclusion: Vec<String>, pub brand_inclusion: Vec<String>, pub item_group_id_inclusion: Vec<String>, pub product_type_inclusion: Vec<String>, pub item_id_exclusion: Vec<String>, pub brand_exclusion: Vec<String>, pub item_group_id_exclusion: Vec<String>, pub product_type_exclusion: Vec<String>, pub minimum_purchase_amount: Option<Price>, pub minimum_purchase_quantity: i64, pub limit_quantity: i64, pub limit_value: Option<Price>, pub percent_off: i64, pub money_off_amount: Option<Price>, pub get_this_quantity_discounted: i64, pub free_gift_value: Option<Price>, pub free_gift_description: String, pub free_gift_item_id: String, pub promotion_effective_time_period: Option<Interval>, pub promotion_display_time_period: Option<Interval>, pub store_applicability: i32, pub store_codes_inclusion: Vec<String>, pub store_codes_exclusion: Vec<String>, pub promotion_url: String,
}
Expand description

Attributes.

Fields§

§product_applicability: i32

Required. Applicability of the promotion to either all products or only specific products.

§offer_type: i32

Required. Type of the promotion. Use this attribute to indicate whether or not customers need a coupon code to redeem your promotion.

§generic_redemption_code: String

Optional. Generic redemption code for the promotion. To be used with the offerType field and must meet the minimum requirements.

§long_title: String

Required. Long title for the promotion.

§coupon_value_type: i32

Required. The [coupon value type] (https://support.google.com/merchants/answer/13861986?ref_topic=13773355&sjid=17642868584668136159-NC) attribute to signal the type of promotion that you are running. Depending on type of the selected coupon value some attributes are required.

§promotion_destinations: Vec<i32>

Required. The list of destinations where the promotion applies to. If you don’t specify a destination by including a supported value in your data source, your promotion will display in Shopping ads and free listings by default.

You may have previously submitted the following values as destinations for your products: Shopping Actions, Surfaces across Google, Local surfaces across Google. To represent these values use FREE_LISTINGS, FREE_LOCAL_LISTINGS, LOCAL_INVENTORY_ADS. For more details see Promotion destination

§item_id_inclusion: Vec<String>

Optional. Product filter by item ID for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products.

§brand_inclusion: Vec<String>

Optional. Product filter by brand for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products.

§item_group_id_inclusion: Vec<String>

Optional. Product filter by item group ID for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability [product_applicability] attribute is set to specific_products.

§product_type_inclusion: Vec<String>

Optional. Product filter by product type for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products.

§item_id_exclusion: Vec<String>

Optional. Product filter by item ID exclusion for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products.

§brand_exclusion: Vec<String>

Optional. Product filter by brand exclusion for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products.

§item_group_id_exclusion: Vec<String>

Optional. Product filter by item group ID. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products. exclusion for the promotion.

§product_type_exclusion: Vec<String>

Optional. Product filter by product type exclusion for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products.

§minimum_purchase_amount: Option<Price>

Optional. Minimum purchase amount for the promotion.

§minimum_purchase_quantity: i64

Optional. Minimum purchase quantity for the promotion.

§limit_quantity: i64

Optional. Maximum purchase quantity for the promotion.

§limit_value: Option<Price>

Optional. Maximum product price for promotion.

§percent_off: i64

Optional. The percentage discount offered in the promotion.

§money_off_amount: Option<Price>

Optional. The money off amount offered in the promotion.

§get_this_quantity_discounted: i64

Optional. The number of items discounted in the promotion. The attribute is set when couponValueType is equal to buy_m_get_n_money_off or buy_m_get_n_percent_off.

§free_gift_value: Option<Price>

Optional. Free gift value for the promotion.

§free_gift_description: String

Optional. Free gift description for the promotion.

§free_gift_item_id: String

Optional. Free gift item ID for the promotion.

§promotion_effective_time_period: Option<Interval>

Required. TimePeriod representation of the promotion’s effective dates. This attribute specifies that the promotion can be tested on your online store during this time period.

§promotion_display_time_period: Option<Interval>

Optional. TimePeriod representation of the promotion’s display dates. This attribute specifies the date and time frame when the promotion will be live on Google.com and Shopping ads. If the display time period for promotion promotion_display_time_period attribute is not specified, the promotion effective time period promotion_effective_time_period determines the date and time frame when the promotion will be live on Google.com and Shopping ads.

§store_applicability: i32

Optional. Whether the promotion applies to all stores, or only specified stores. Local Inventory ads promotions throw an error if no store applicability is included. An INVALID_ARGUMENT error is thrown if store_applicability is set to ALL_STORES and store_codes_inclusion or score_code_exclusion is set to a value.

§store_codes_inclusion: Vec<String>

Optional. Store codes to include for the promotion. The store filter attributes only applies when the store_applicability attribute is set to specific_stores.

Store code (the store ID from your Business Profile) of the physical store the product is sold in. See the Local product inventory data specification for more information.

§store_codes_exclusion: Vec<String>

Optional. Store codes to exclude for the promotion. The store filter attributes only applies when the store_applicability attribute is set to specific_stores.

§promotion_url: String

Optional. URL to the page on the merchant’s site where the promotion shows. Local Inventory ads promotions throw an error if no promotion_url is included. URL is used to confirm that the promotion is valid and can be redeemed.

Implementations§

source§

impl Attributes

source

pub fn product_applicability(&self) -> ProductApplicability

Returns the enum value of product_applicability, or the default if the field is set to an invalid enum value.

source

pub fn set_product_applicability(&mut self, value: ProductApplicability)

Sets product_applicability to the provided enum value.

source

pub fn offer_type(&self) -> OfferType

Returns the enum value of offer_type, or the default if the field is set to an invalid enum value.

source

pub fn set_offer_type(&mut self, value: OfferType)

Sets offer_type to the provided enum value.

source

pub fn coupon_value_type(&self) -> CouponValueType

Returns the enum value of coupon_value_type, or the default if the field is set to an invalid enum value.

source

pub fn set_coupon_value_type(&mut self, value: CouponValueType)

Sets coupon_value_type to the provided enum value.

source

pub fn promotion_destinations( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<DestinationEnum>>

Returns an iterator which yields the valid enum values contained in promotion_destinations.

source

pub fn push_promotion_destinations(&mut self, value: DestinationEnum)

Appends the provided enum value to promotion_destinations.

source

pub fn store_applicability(&self) -> StoreApplicability

Returns the enum value of store_applicability, or the default if the field is set to an invalid enum value.

source

pub fn set_store_applicability(&mut self, value: StoreApplicability)

Sets store_applicability to the provided enum value.

Trait Implementations§

source§

impl Clone for Attributes

source§

fn clone(&self) -> Attributes

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Attributes

source§

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

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

impl Default for Attributes

source§

fn default() -> Self

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

impl Message for Attributes

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for Attributes

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Attributes

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

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

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

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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

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

§

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>,

§

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>,

§

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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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