// This file is @generated by prost-build.
/// Attributes.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Attributes {
    /// Required. Applicability of the promotion to either all products or
    /// [only specific
    /// products](<https://support.google.com/merchants/answer/6396257?ref_topic=6396150&sjid=17642868584668136159-NC>).
    #[prost(enumeration = "ProductApplicability", tag = "1")]
    pub product_applicability: i32,
    /// Required.
    /// [Type](<https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// of the promotion. Use this attribute to indicate whether or not customers
    /// need a coupon code to redeem your promotion.
    #[prost(enumeration = "OfferType", tag = "2")]
    pub offer_type: i32,
    /// Optional. Generic redemption code for the promotion. To be used with the
    /// `offerType` field and must meet the [minimum
    /// requirements](<https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC>).
    #[prost(string, tag = "3")]
    pub generic_redemption_code: ::prost::alloc::string::String,
    /// Required. [Long
    /// title](<https://support.google.com/merchants/answer/13838102?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// for the promotion.
    #[prost(string, tag = "4")]
    pub long_title: ::prost::alloc::string::String,
    /// 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](<https://support.google.com/merchants/answer/6393006?ref_topic=7322920>).
    #[prost(enumeration = "CouponValueType", tag = "5")]
    pub coupon_value_type: i32,
    /// Required. The list of destinations (also known as [Marketing
    /// methods](<https://support.google.com/merchants/answer/15130232>)) 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](<https://support.google.com/merchants/answer/13837465?sjid=5155774230887277618-NC>)
    #[prost(
        enumeration = "super::super::super::r#type::destination::DestinationEnum",
        repeated,
        packed = "false",
        tag = "6"
    )]
    pub promotion_destinations: ::prost::alloc::vec::Vec<i32>,
    /// Optional. Product filter by [item
    /// ID](<https://support.google.com/merchants/answer/13861565?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// 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](<https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC>).
    #[prost(string, repeated, tag = "7")]
    pub item_id_inclusion: ::prost::alloc::vec::Vec<::prost::alloc::string::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](<https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC>).
    #[prost(string, repeated, tag = "8")]
    pub brand_inclusion: ::prost::alloc::vec::Vec<::prost::alloc::string::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](<https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC>).
    #[prost(string, repeated, tag = "9")]
    pub item_group_id_inclusion: ::prost::alloc::vec::Vec<
        ::prost::alloc::string::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](<https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC>).
    #[prost(string, repeated, tag = "10")]
    pub product_type_inclusion: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Optional. Product filter by [item ID
    /// exclusion](<https://support.google.com/merchants/answer/13863524?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// 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](<https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC>).
    #[prost(string, repeated, tag = "11")]
    pub item_id_exclusion: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Optional. Product filter by [brand
    /// exclusion](<https://support.google.com/merchants/answer/13861679?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// 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](<https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC>).
    #[prost(string, repeated, tag = "12")]
    pub brand_exclusion: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Optional. Product filter by [item group
    /// ID](<https://support.google.com/merchants/answer/13837298?ref_topic=13773355&sjid=17642868584668136159-NC>).
    /// The product filter attributes only applies when the products eligible for
    /// promotion product applicability `product_applicability` attribute is set to
    /// [specific_products](<https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC>).
    /// exclusion for the promotion.
    #[prost(string, repeated, tag = "13")]
    pub item_group_id_exclusion: ::prost::alloc::vec::Vec<
        ::prost::alloc::string::String,
    >,
    /// Optional. Product filter by [product type
    /// exclusion](<https://support.google.com/merchants/answer/13863746?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// 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](<https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC>).
    #[prost(string, repeated, tag = "14")]
    pub product_type_exclusion: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Optional. [Minimum purchase
    /// amount](<https://support.google.com/merchants/answer/13837705?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// for the promotion.
    #[prost(message, optional, tag = "15")]
    pub minimum_purchase_amount: ::core::option::Option<
        super::super::super::r#type::Price,
    >,
    #[prost(int64, tag = "16")]
    pub minimum_purchase_quantity: i64,
    /// Optional. [Maximum purchase
    /// quantity](<https://support.google.com/merchants/answer/13861564?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// for the promotion.
    #[prost(int64, tag = "17")]
    pub limit_quantity: i64,
    /// Optional. [Maximum product
    /// price](<https://support.google.com/merchants/answer/2906014>) for
    /// promotion.
    #[prost(message, optional, tag = "18")]
    pub limit_value: ::core::option::Option<super::super::super::r#type::Price>,
    /// Optional. The [percentage
    /// discount](<https://support.google.com/merchants/answer/13837404?sjid=17642868584668136159-NC>)
    /// offered in the promotion.
    #[prost(int64, tag = "19")]
    pub percent_off: i64,
    /// Optional. The [money off
    /// amount](<https://support.google.com/merchants/answer/13838101?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// offered in the promotion.
    #[prost(message, optional, tag = "20")]
    pub money_off_amount: ::core::option::Option<super::super::super::r#type::Price>,
    /// 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`.
    #[prost(int64, tag = "21")]
    pub get_this_quantity_discounted: i64,
    /// Optional. [Free gift
    /// value](<https://support.google.com/merchants/answer/13844477?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// for the promotion.
    #[prost(message, optional, tag = "22")]
    pub free_gift_value: ::core::option::Option<super::super::super::r#type::Price>,
    /// Optional. [Free gift
    /// description](<https://support.google.com/merchants/answer/13847245?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// for the promotion.
    #[prost(string, tag = "23")]
    pub free_gift_description: ::prost::alloc::string::String,
    /// Optional. [Free gift item
    /// ID](<https://support.google.com/merchants/answer/13857152?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// for the promotion.
    #[prost(string, tag = "24")]
    pub free_gift_item_id: ::prost::alloc::string::String,
    /// 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.
    #[prost(message, optional, tag = "25")]
    pub promotion_effective_time_period: ::core::option::Option<
        super::super::super::super::r#type::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.
    #[prost(message, optional, tag = "26")]
    pub promotion_display_time_period: ::core::option::Option<
        super::super::super::super::r#type::Interval,
    >,
    /// Optional. Whether the promotion applies to [all stores, or only specified
    /// stores](<https://support.google.com/merchants/answer/13857563?sjid=17642868584668136159-NC>).
    /// 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.
    #[prost(enumeration = "StoreApplicability", tag = "28")]
    pub store_applicability: i32,
    /// Optional. [Store codes to
    /// include](<https://support.google.com/merchants/answer/13857470?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// for the promotion. The store filter attributes only applies when the
    /// `store_applicability` attribute is set to
    /// [specific_stores](<https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC>).
    ///
    /// 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](<https://support.google.com/merchants/answer/3061342>) for
    /// more information.
    #[prost(string, repeated, tag = "29")]
    pub store_codes_inclusion: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Optional. [Store codes to
    /// exclude](<https://support.google.com/merchants/answer/13859586?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// for the promotion. The store filter attributes only applies when the
    /// `store_applicability` attribute is set to
    /// [specific_stores](<https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC>).
    #[prost(string, repeated, tag = "30")]
    pub store_codes_exclusion: ::prost::alloc::vec::Vec<::prost::alloc::string::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.
    #[prost(string, tag = "31")]
    pub promotion_url: ::prost::alloc::string::String,
}
/// The status of the promotion.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PromotionStatus {
    /// Output only. The intended destinations for the promotion.
    #[prost(message, repeated, tag = "1")]
    pub destination_statuses: ::prost::alloc::vec::Vec<
        promotion_status::DestinationStatus,
    >,
    /// Output only. A list of issues associated with the promotion.
    #[prost(message, repeated, tag = "2")]
    pub item_level_issues: ::prost::alloc::vec::Vec<promotion_status::ItemLevelIssue>,
    /// Output only. Date on which the promotion has been created
    /// in [ISO 8601](<http://en.wikipedia.org/wiki/ISO_8601>) format: Date, time,
    /// and offset, for example `2020-01-02T09:00:00+01:00` or
    /// `2020-01-02T09:00:00Z`
    #[prost(message, optional, tag = "3")]
    pub creation_date: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Date on which the promotion status has been last updated
    /// in [ISO 8601](<http://en.wikipedia.org/wiki/ISO_8601>) format: Date, time,
    /// and offset, for example `2020-01-02T09:00:00+01:00` or
    /// `2020-01-02T09:00:00Z`
    #[prost(message, optional, tag = "4")]
    pub last_update_date: ::core::option::Option<::prost_types::Timestamp>,
}
/// Nested message and enum types in `PromotionStatus`.
pub mod promotion_status {
    /// The status for the specified destination.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct DestinationStatus {
        /// Output only. The name of the promotion destination.
        #[prost(
            enumeration = "super::super::super::super::r#type::reporting_context::ReportingContextEnum",
            tag = "1"
        )]
        pub reporting_context: i32,
        /// Output only. The status for the specified destination.
        #[prost(enumeration = "destination_status::State", tag = "2")]
        pub status: i32,
    }
    /// Nested message and enum types in `DestinationStatus`.
    pub mod destination_status {
        /// The current state of the promotion.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum State {
            /// Unknown promotion state.
            Unspecified = 0,
            /// The promotion is under review.
            InReview = 1,
            /// The promotion is disapproved.
            Rejected = 2,
            /// The promotion is approved and active.
            Live = 3,
            /// The promotion is stopped by merchant.
            Stopped = 4,
            /// The promotion is no longer active.
            Expired = 5,
            /// The promotion is not stopped, and all reviews are approved, but the
            /// active date is in the future.
            Pending = 6,
        }
        impl State {
            /// String value of the enum field names used in the ProtoBuf definition.
            ///
            /// The values are not transformed in any way and thus are considered stable
            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
            pub fn as_str_name(&self) -> &'static str {
                match self {
                    Self::Unspecified => "STATE_UNSPECIFIED",
                    Self::InReview => "IN_REVIEW",
                    Self::Rejected => "REJECTED",
                    Self::Live => "LIVE",
                    Self::Stopped => "STOPPED",
                    Self::Expired => "EXPIRED",
                    Self::Pending => "PENDING",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                    "IN_REVIEW" => Some(Self::InReview),
                    "REJECTED" => Some(Self::Rejected),
                    "LIVE" => Some(Self::Live),
                    "STOPPED" => Some(Self::Stopped),
                    "EXPIRED" => Some(Self::Expired),
                    "PENDING" => Some(Self::Pending),
                    _ => None,
                }
            }
        }
    }
    /// The issue associated with the promotion.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct ItemLevelIssue {
        /// Output only. The error code of the issue.
        #[prost(string, tag = "1")]
        pub code: ::prost::alloc::string::String,
        /// Output only. How this issue affects serving of the promotion.
        #[prost(enumeration = "item_level_issue::Severity", tag = "2")]
        pub severity: i32,
        /// Output only. Whether the issue can be resolved by the merchant.
        #[prost(string, tag = "3")]
        pub resolution: ::prost::alloc::string::String,
        /// Output only. The attribute's name, if the issue is caused by a single
        /// attribute.
        #[prost(string, tag = "4")]
        pub attribute: ::prost::alloc::string::String,
        /// Output only. The destination the issue applies to.
        #[prost(
            enumeration = "super::super::super::super::r#type::reporting_context::ReportingContextEnum",
            tag = "5"
        )]
        pub reporting_context: i32,
        /// Output only. A short issue description in English.
        #[prost(string, tag = "6")]
        pub description: ::prost::alloc::string::String,
        /// Output only. A detailed issue description in English.
        #[prost(string, tag = "7")]
        pub detail: ::prost::alloc::string::String,
        /// Output only. The URL of a web page to help with resolving this issue.
        #[prost(string, tag = "8")]
        pub documentation: ::prost::alloc::string::String,
        /// Output only. List of country codes (ISO 3166-1 alpha-2) where issue
        /// applies to the offer.
        #[prost(string, repeated, tag = "9")]
        pub applicable_countries: ::prost::alloc::vec::Vec<
            ::prost::alloc::string::String,
        >,
    }
    /// Nested message and enum types in `ItemLevelIssue`.
    pub mod item_level_issue {
        /// The severity of the issue.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum Severity {
            /// Not specified.
            Unspecified = 0,
            /// This issue represents a warning and does not have a direct affect
            /// on the promotion.
            NotImpacted = 1,
            /// The promotion is demoted and most likely have limited performance
            /// in search results
            Demoted = 2,
            /// Issue disapproves the promotion.
            Disapproved = 3,
        }
        impl Severity {
            /// String value of the enum field names used in the ProtoBuf definition.
            ///
            /// The values are not transformed in any way and thus are considered stable
            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
            pub fn as_str_name(&self) -> &'static str {
                match self {
                    Self::Unspecified => "SEVERITY_UNSPECIFIED",
                    Self::NotImpacted => "NOT_IMPACTED",
                    Self::Demoted => "DEMOTED",
                    Self::Disapproved => "DISAPPROVED",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "SEVERITY_UNSPECIFIED" => Some(Self::Unspecified),
                    "NOT_IMPACTED" => Some(Self::NotImpacted),
                    "DEMOTED" => Some(Self::Demoted),
                    "DISAPPROVED" => Some(Self::Disapproved),
                    _ => None,
                }
            }
        }
    }
}
/// Which product or list of products the promotion applies to.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProductApplicability {
    /// Which products the promotion applies to is unknown.
    Unspecified = 0,
    /// Applicable to all products.
    AllProducts = 1,
    /// Applicable to only a single product or list of products.
    SpecificProducts = 2,
}
impl ProductApplicability {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "PRODUCT_APPLICABILITY_UNSPECIFIED",
            Self::AllProducts => "ALL_PRODUCTS",
            Self::SpecificProducts => "SPECIFIC_PRODUCTS",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PRODUCT_APPLICABILITY_UNSPECIFIED" => Some(Self::Unspecified),
            "ALL_PRODUCTS" => Some(Self::AllProducts),
            "SPECIFIC_PRODUCTS" => Some(Self::SpecificProducts),
            _ => None,
        }
    }
}
/// Store codes or list of store codes the promotion applies to. Only for
/// Local inventory ads promotions.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StoreApplicability {
    /// Which store codes the promotion applies to is unknown.
    Unspecified = 0,
    /// Promotion applies to all stores.
    AllStores = 1,
    /// Promotion applies to only the specified stores.
    SpecificStores = 2,
}
impl StoreApplicability {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "STORE_APPLICABILITY_UNSPECIFIED",
            Self::AllStores => "ALL_STORES",
            Self::SpecificStores => "SPECIFIC_STORES",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "STORE_APPLICABILITY_UNSPECIFIED" => Some(Self::Unspecified),
            "ALL_STORES" => Some(Self::AllStores),
            "SPECIFIC_STORES" => Some(Self::SpecificStores),
            _ => None,
        }
    }
}
/// Offer type of a promotion.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OfferType {
    /// Unknown offer type.
    Unspecified = 0,
    /// Offer type without a code.
    NoCode = 1,
    /// Offer type with a code. Generic redemption code for the promotion is
    /// required when `offerType` = `GENERIC_CODE`.
    GenericCode = 2,
}
impl OfferType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "OFFER_TYPE_UNSPECIFIED",
            Self::NoCode => "NO_CODE",
            Self::GenericCode => "GENERIC_CODE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "OFFER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "NO_CODE" => Some(Self::NoCode),
            "GENERIC_CODE" => Some(Self::GenericCode),
            _ => None,
        }
    }
}
/// Channel of a promotion.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RedemptionChannel {
    /// Indicates that the channel is unspecified.
    Unspecified = 0,
    /// Indicates that the channel is in store.
    /// This is same as `local` channel used for `products`.
    InStore = 1,
    /// Indicates that the channel is online.
    Online = 2,
}
impl RedemptionChannel {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "REDEMPTION_CHANNEL_UNSPECIFIED",
            Self::InStore => "IN_STORE",
            Self::Online => "ONLINE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "REDEMPTION_CHANNEL_UNSPECIFIED" => Some(Self::Unspecified),
            "IN_STORE" => Some(Self::InStore),
            "ONLINE" => Some(Self::Online),
            _ => None,
        }
    }
}
/// [Coupon value
/// type](<https://support.google.com/merchants/answer/13861986>)
/// of a promotion.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CouponValueType {
    /// Indicates that the coupon value type is unspecified.
    Unspecified = 0,
    /// Money off coupon value type.
    MoneyOff = 1,
    /// Percent off coupon value type.
    PercentOff = 2,
    /// Buy M quantity, get N money off coupon value type.
    /// `minimum_purchase_quantity` and `get_this_quantity_discounted` must be
    /// present. `money_off_amount` must also be present.
    BuyMGetNMoneyOff = 3,
    /// Buy M quantity, get N percent off coupon value type.
    /// `minimum_purchase_quantity` and `get_this_quantity_discounted` must be
    /// present. `percent_off_percentage` must also be present.
    BuyMGetNPercentOff = 4,
    /// Buy M quantity, get money off. `minimum_purchase_quantity` and
    /// `money_off_amount` must be present.
    BuyMGetMoneyOff = 5,
    /// Buy M quantity, get money off. `minimum_purchase_quantity` and
    /// `percent_off_percentage` must be present.
    BuyMGetPercentOff = 6,
    /// Free gift with description only.
    FreeGift = 7,
    /// Free gift with monetary value.
    FreeGiftWithValue = 8,
    /// Free gift with item ID.
    FreeGiftWithItemId = 9,
    /// Standard free shipping coupon value type. Only available for online
    /// promotions.
    FreeShippingStandard = 10,
    /// Overnight free shipping coupon value type. Only available for online
    /// promotions.
    FreeShippingOvernight = 11,
    /// Two day free shipping coupon value type. Only available for online
    /// promotions.
    FreeShippingTwoDay = 12,
}
impl CouponValueType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "COUPON_VALUE_TYPE_UNSPECIFIED",
            Self::MoneyOff => "MONEY_OFF",
            Self::PercentOff => "PERCENT_OFF",
            Self::BuyMGetNMoneyOff => "BUY_M_GET_N_MONEY_OFF",
            Self::BuyMGetNPercentOff => "BUY_M_GET_N_PERCENT_OFF",
            Self::BuyMGetMoneyOff => "BUY_M_GET_MONEY_OFF",
            Self::BuyMGetPercentOff => "BUY_M_GET_PERCENT_OFF",
            Self::FreeGift => "FREE_GIFT",
            Self::FreeGiftWithValue => "FREE_GIFT_WITH_VALUE",
            Self::FreeGiftWithItemId => "FREE_GIFT_WITH_ITEM_ID",
            Self::FreeShippingStandard => "FREE_SHIPPING_STANDARD",
            Self::FreeShippingOvernight => "FREE_SHIPPING_OVERNIGHT",
            Self::FreeShippingTwoDay => "FREE_SHIPPING_TWO_DAY",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "COUPON_VALUE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "MONEY_OFF" => Some(Self::MoneyOff),
            "PERCENT_OFF" => Some(Self::PercentOff),
            "BUY_M_GET_N_MONEY_OFF" => Some(Self::BuyMGetNMoneyOff),
            "BUY_M_GET_N_PERCENT_OFF" => Some(Self::BuyMGetNPercentOff),
            "BUY_M_GET_MONEY_OFF" => Some(Self::BuyMGetMoneyOff),
            "BUY_M_GET_PERCENT_OFF" => Some(Self::BuyMGetPercentOff),
            "FREE_GIFT" => Some(Self::FreeGift),
            "FREE_GIFT_WITH_VALUE" => Some(Self::FreeGiftWithValue),
            "FREE_GIFT_WITH_ITEM_ID" => Some(Self::FreeGiftWithItemId),
            "FREE_SHIPPING_STANDARD" => Some(Self::FreeShippingStandard),
            "FREE_SHIPPING_OVERNIGHT" => Some(Self::FreeShippingOvernight),
            "FREE_SHIPPING_TWO_DAY" => Some(Self::FreeShippingTwoDay),
            _ => None,
        }
    }
}
/// Represents a promotion. See the following articles for more details.
///
/// Required promotion input attributes to pass data validation checks are
/// primarily defined below:
///
/// * [Promotions data
///   specification](<https://support.google.com/merchants/answer/2906014>)
/// * [Local promotions data
///   specification](<https://support.google.com/merchants/answer/10146130>)
///
/// After inserting, updating a promotion input, it may take several minutes
/// before the final promotion can be retrieved.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Promotion {
    /// Identifier. The name of the promotion.
    /// Format: `accounts/{account}/promotions/{promotion}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. The user provided promotion ID to uniquely identify the
    /// promotion. Follow [minimum
    /// requirements](<https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements>)
    /// to prevent promotion disapprovals.
    #[prost(string, tag = "2")]
    pub promotion_id: ::prost::alloc::string::String,
    /// Required. The two-letter [ISO
    /// 639-1](<http://en.wikipedia.org/wiki/ISO_639-1>) language code for the
    /// promotion.
    ///
    /// Promotions is only for [selected
    /// languages](<https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=>).
    #[prost(string, tag = "3")]
    pub content_language: ::prost::alloc::string::String,
    /// Required. The target country used as part of the unique identifier.
    /// Represented as a [CLDR territory
    /// code](<https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml>).
    ///
    /// Promotions are only available in selected
    /// countries, [Free Listings and Shopping
    /// ads](<https://support.google.com/merchants/answer/4588460>) [Local Inventory
    /// ads](<https://support.google.com/merchants/answer/10146326>)
    #[prost(string, tag = "4")]
    pub target_country: ::prost::alloc::string::String,
    /// Required. [Redemption
    /// channel](<https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC>)
    /// for the promotion. At least one channel is required.
    #[prost(enumeration = "RedemptionChannel", repeated, packed = "false", tag = "5")]
    pub redemption_channel: ::prost::alloc::vec::Vec<i32>,
    /// Output only. The primary data source of the promotion.
    #[prost(string, tag = "6")]
    pub data_source: ::prost::alloc::string::String,
    /// Optional. A list of promotion attributes.
    #[prost(message, optional, tag = "7")]
    pub attributes: ::core::option::Option<Attributes>,
    /// 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.
    #[prost(message, repeated, tag = "8")]
    pub custom_attributes: ::prost::alloc::vec::Vec<
        super::super::super::r#type::CustomAttribute,
    >,
    /// Output only. The [status of a
    /// promotion](<https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC>),
    /// data validation issues, that is, information about a promotion computed
    /// asynchronously.
    #[prost(message, optional, tag = "9")]
    pub promotion_status: ::core::option::Option<PromotionStatus>,
    /// 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.
    #[prost(int64, optional, tag = "10")]
    pub version_number: ::core::option::Option<i64>,
}
/// Request message for the `InsertPromotion` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InsertPromotionRequest {
    /// Required. The account where the promotion will be inserted.
    /// Format: accounts/{account}
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The promotion to insert.
    #[prost(message, optional, tag = "2")]
    pub promotion: ::core::option::Option<Promotion>,
    /// Required. The data source of the
    /// [promotion](<https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC>)
    /// Format:
    /// `accounts/{account}/dataSources/{datasource}`.
    #[prost(string, tag = "3")]
    pub data_source: ::prost::alloc::string::String,
}
/// Request message for the `GetPromotion` method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetPromotionRequest {
    /// Required. The name of the promotion to retrieve.
    /// Format: `accounts/{account}/promotions/{promotions}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for the `ListPromotions` method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListPromotionsRequest {
    /// Required. The account to list processed promotions for.
    /// Format: `accounts/{account}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of promotions to return. The service may
    /// return fewer than this value. The maximum value is 250; values above 250
    /// will be coerced to 250. If unspecified, the maximum number of promotions
    /// will be returned.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous `ListPromotions` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListPromotions` must
    /// match the call that provided the page token.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response message for the `ListPromotions` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPromotionsResponse {
    /// The processed promotions from the specified account.
    #[prost(message, repeated, tag = "1")]
    pub promotions: ::prost::alloc::vec::Vec<Promotion>,
    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod promotions_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service to manage promotions for products.
    #[derive(Debug, Clone)]
    pub struct PromotionsServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl PromotionsServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> PromotionsServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> PromotionsServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            PromotionsServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Inserts a promotion for your Merchant Center account. If the promotion
        /// already exists, then it updates the promotion instead.
        pub async fn insert_promotion(
            &mut self,
            request: impl tonic::IntoRequest<super::InsertPromotionRequest>,
        ) -> std::result::Result<tonic::Response<super::Promotion>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.shopping.merchant.promotions.v1.PromotionsService/InsertPromotion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.promotions.v1.PromotionsService",
                        "InsertPromotion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Retrieves the promotion from your Merchant Center account.
        ///
        /// After inserting or updating a promotion input, it may take several
        /// minutes before the updated promotion can be retrieved.
        pub async fn get_promotion(
            &mut self,
            request: impl tonic::IntoRequest<super::GetPromotionRequest>,
        ) -> std::result::Result<tonic::Response<super::Promotion>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.shopping.merchant.promotions.v1.PromotionsService/GetPromotion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.promotions.v1.PromotionsService",
                        "GetPromotion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists the promotions in your Merchant Center account. The
        /// response might contain fewer items than specified by `pageSize`. Rely on
        /// `pageToken` to determine if there are more items to be requested.
        ///
        /// After inserting or updating a promotion, it may take several minutes before
        /// the updated processed promotion can be retrieved.
        pub async fn list_promotions(
            &mut self,
            request: impl tonic::IntoRequest<super::ListPromotionsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListPromotionsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.shopping.merchant.promotions.v1.PromotionsService/ListPromotions",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.promotions.v1.PromotionsService",
                        "ListPromotions",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
