Struct google_api_proto::google::shopping::merchant::promotions::v1beta::Promotion
source · pub struct Promotion {
pub name: String,
pub promotion_id: String,
pub content_language: String,
pub target_country: String,
pub redemption_channel: Vec<i32>,
pub data_source: String,
pub attributes: Option<Attributes>,
pub custom_attributes: Vec<CustomAttribute>,
pub promotion_status: Option<PromotionStatus>,
pub version_number: Option<i64>,
}
Expand description
Represents a promotion. See the following articles for more details.
Required promotion input attributes to pass data validation checks are primarily defined below:
After inserting, updating a promotion input, it may take several minutes before the final promotion can be retrieved.
Fields§
§name: String
Identifier. The name of the promotion.
Format: accounts/{account}/promotions/{promotion}
promotion_id: String
Required. The user provided promotion ID to uniquely identify the promotion. Follow minimum requirements to prevent promotion disapprovals.
content_language: String
Required. The two-letter ISO 639-1 language code for the promotion.
Promotions is only for selected languages.
target_country: String
Required. The target country used as part of the unique identifier. Represented as a CLDR territory code.
Promotions are only available in selected countries, Free Listings and Shopping ads Local Inventory ads
redemption_channel: Vec<i32>
Required. Redemption channel for the promotion. At least one channel is required.
data_source: String
Output only. The primary data source of the promotion.
attributes: Option<Attributes>
Optional. A list of promotion attributes.
custom_attributes: Vec<CustomAttribute>
Optional. A list of custom (merchant-provided) attributes. It can also be
used for submitting any attribute of the data specification in its generic
form (for example,
{ "name": "size type", "value": "regular" }
).
This is useful for submitting attributes not explicitly exposed by the
API.
promotion_status: Option<PromotionStatus>
Output only. The status of a promotion, data validation issues, that is, information about a promotion computed asynchronously.
version_number: Option<i64>
Optional. Represents the existing version (freshness) of the promotion, which can be used to preserve the right order when multiple updates are done at the same time.
If set, the insertion is prevented when version number is lower than
the current version number of the existing promotion. Re-insertion (for
example, promotion refresh after 30 days) can be performed with the current
version_number
.
If the operation is prevented, the aborted exception will be thrown.
Implementations§
source§impl Promotion
impl Promotion
sourcepub fn redemption_channel(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<RedemptionChannel>>
pub fn redemption_channel( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<RedemptionChannel>>
Returns an iterator which yields the valid enum values contained in redemption_channel
.
sourcepub fn push_redemption_channel(&mut self, value: RedemptionChannel)
pub fn push_redemption_channel(&mut self, value: RedemptionChannel)
Appends the provided enum value to redemption_channel
.
sourcepub fn version_number(&self) -> i64
pub fn version_number(&self) -> i64
Returns the value of version_number
, or the default value if version_number
is unset.
Trait Implementations§
source§impl Message for Promotion
impl Message for Promotion
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
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(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
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(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Promotion
impl PartialEq for Promotion
impl StructuralPartialEq for Promotion
Auto Trait Implementations§
impl Freeze for Promotion
impl RefUnwindSafe for Promotion
impl Send for Promotion
impl Sync for Promotion
impl Unpin for Promotion
impl UnwindSafe for Promotion
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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