stripe/model/
promotion_codes_resource_restrictions.rs

1use serde::{Serialize, Deserialize};
2///
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct PromotionCodesResourceRestrictions {
5    ///Promotion code restrictions defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
6    #[serde(skip_serializing_if = "Option::is_none")]
7    pub currency_options: Option<serde_json::Value>,
8    ///A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices
9    pub first_time_transaction: bool,
10    ///Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work).
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub minimum_amount: Option<i64>,
13    ///Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub minimum_amount_currency: Option<String>,
16}
17impl std::fmt::Display for PromotionCodesResourceRestrictions {
18    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19        write!(f, "{}", serde_json::to_string(self).unwrap())
20    }
21}