1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use params::{Identifiable, Metadata, Timestamp};
use resources::Currency;
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Coupon {
pub id: String,
pub object: String,
pub amount_off: Option<u64>,
pub created: Timestamp,
pub currency: Option<Currency>,
pub duration: String,
pub duration_in_months: Option<u64>,
pub livemode: bool,
pub max_redemptions: Option<u64>,
pub metadata: Metadata,
pub percent_off: u64,
pub redeem_by: Timestamp,
pub redeemed: u64,
pub valid: bool,
pub deleted: bool,
}
impl Identifiable for Coupon {
fn id(&self) -> &str {
&self.id
}
}