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 * The version of the OpenAPI document: 1.4.1
7 * Contact: devrel@onesignal.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct Purchase {
16 /// The unique identifier of the purchased item.
17 #[serde(rename = "sku")]
18 pub sku: String,
19 /// The amount, in USD, spent purchasing the item.
20 #[serde(rename = "amount")]
21 pub amount: String,
22 /// The 3-letter ISO 4217 currency code. Required for correct storage and conversion of amount.
23 #[serde(rename = "iso")]
24 pub iso: String,
25 #[serde(rename = "count", skip_serializing_if = "Option::is_none")]
26 pub count: Option<f32>,
27}
28
29impl Purchase {
30 pub fn new(sku: String, amount: String, iso: String) -> Purchase {
31 Purchase {
32 sku,
33 amount,
34 iso,
35 count: None,
36 }
37 }
38}
39
40