Skip to main content

onesignal_rust_api/models/
purchase.rs

1/*
2 * OneSignal
3 *
4 * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5 *
6 * Contact: devrel@onesignal.com
7 * Generated by: https://openapi-generator.tech
8 */
9
10
11
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Purchase {
15    /// The unique identifier of the purchased item.
16    #[serde(rename = "sku")]
17    pub sku: String,
18    /// The amount, in USD, spent purchasing the item.
19    #[serde(rename = "amount")]
20    pub amount: String,
21    /// The 3-letter ISO 4217 currency code. Required for correct storage and conversion of amount.
22    #[serde(rename = "iso")]
23    pub iso: String,
24    #[serde(rename = "count", skip_serializing_if = "Option::is_none")]
25    pub count: Option<i32>,
26}
27
28impl Purchase {
29    pub fn new(sku: String, amount: String, iso: String) -> Purchase {
30        Purchase {
31            sku,
32            amount,
33            iso,
34            count: None,
35        }
36    }
37}
38
39