|
| 1 | +use serde::{Deserialize, Serialize}; |
| 2 | +use uuid::Uuid; |
| 3 | +use crate::primitives::account_tenure::AccountTenure; |
| 4 | +use crate::primitives::consumption_status::ConsumptionStatus; |
| 5 | +use crate::primitives::delivery_status::DeliveryStatus; |
| 6 | +use crate::primitives::lifetime_dollars_purchased::LifetimeDollarsPurchased; |
| 7 | +use crate::primitives::lifetime_dollars_refunded::LifetimeDollarsRefunded; |
| 8 | +use crate::primitives::platform::Platform; |
| 9 | +use crate::primitives::play_time::PlayTime; |
| 10 | +use crate::primitives::user_status::UserStatus; |
| 11 | + |
| 12 | +/// The request body containing consumption information. |
| 13 | +/// |
| 14 | +/// [ConsumptionRequest](https://developer.apple.com/documentation/appstoreserverapi/consumptionrequest) |
| 15 | +#[derive(Debug, Deserialize, Serialize, Hash)] |
| 16 | +pub struct ConsumptionRequest { |
| 17 | + /// A Boolean value that indicates whether the customer consented to provide consumption data to the App Store. |
| 18 | + /// |
| 19 | + /// [customerConsented](https://developer.apple.com/documentation/appstoreserverapi/customerconsented) |
| 20 | + #[serde(rename = "customerConsented")] |
| 21 | + pub customer_consented: Option<bool>, |
| 22 | + |
| 23 | + /// A value that indicates the extent to which the customer consumed the in-app purchase. |
| 24 | + /// |
| 25 | + /// [consumptionStatus](https://developer.apple.com/documentation/appstoreserverapi/consumptionstatus) |
| 26 | + #[serde(rename = "consumptionStatus")] |
| 27 | + pub consumption_status: Option<ConsumptionStatus>, |
| 28 | + |
| 29 | + /// A value that indicates the platform on which the customer consumed the in-app purchase. |
| 30 | + /// |
| 31 | + /// [platform](https://developer.apple.com/documentation/appstoreserverapi/platform) |
| 32 | + pub platform: Option<Platform>, |
| 33 | + |
| 34 | + /// A Boolean value that indicates whether you provided, prior to its purchase, a free sample or trial of the content, or information about its functionality. |
| 35 | + /// |
| 36 | + /// [sampleContentProvided](https://developer.apple.com/documentation/appstoreserverapi/samplecontentprovided) |
| 37 | + #[serde(rename = "sampleContentProvided")] |
| 38 | + pub sample_content_provided: Option<bool>, |
| 39 | + |
| 40 | + /// A value that indicates whether the app successfully delivered an in-app purchase that works properly. |
| 41 | + /// |
| 42 | + /// [deliveryStatus](https://developer.apple.com/documentation/appstoreserverapi/deliverystatus) |
| 43 | + #[serde(rename = "deliveryStatus")] |
| 44 | + pub delivery_status: Option<DeliveryStatus>, |
| 45 | + |
| 46 | + /// The UUID that an app optionally generates to map a customer’s in-app purchase with its resulting App Store transaction. |
| 47 | + /// |
| 48 | + /// [appAccountToken](https://developer.apple.com/documentation/appstoreserverapi/appaccounttoken) |
| 49 | + #[serde(rename = "appAccountToken")] |
| 50 | + pub app_account_token: Option<Uuid>, |
| 51 | + |
| 52 | + /// The age of the customer’s account. |
| 53 | + /// |
| 54 | + /// [accountTenure](https://developer.apple.com/documentation/appstoreserverapi/accounttenure) |
| 55 | + #[serde(rename = "accountTenure")] |
| 56 | + pub account_tenure: Option<AccountTenure>, |
| 57 | + |
| 58 | + /// A value that indicates the amount of time that the customer used the app. |
| 59 | + /// |
| 60 | + /// [playTime](https://developer.apple.com/documentation/appstoreserverapi/playtime) |
| 61 | + #[serde(rename = "playTime")] |
| 62 | + pub play_time: Option<PlayTime>, |
| 63 | + |
| 64 | + /// A value that indicates the total amount, in USD, of refunds the customer has received, in your app, across all platforms. |
| 65 | + /// |
| 66 | + /// [lifetimeDollarsRefunded](https://developer.apple.com/documentation/appstoreserverapi/lifetimedollarsrefunded) |
| 67 | + #[serde(rename = "lifetimeDollarsRefunded")] |
| 68 | + pub lifetime_dollars_refunded: Option<LifetimeDollarsRefunded>, |
| 69 | + |
| 70 | + /// A value that indicates the total amount, in USD, of in-app purchases the customer has made in your app, across all platforms. |
| 71 | + /// |
| 72 | + /// [lifetimeDollarsPurchased](https://developer.apple.com/documentation/appstoreserverapi/lifetimedollarspurchased) |
| 73 | + #[serde(rename = "lifetimeDollarsPurchased")] |
| 74 | + pub lifetime_dollars_purchased: Option<LifetimeDollarsPurchased>, |
| 75 | + |
| 76 | + /// The status of the customer’s account. |
| 77 | + /// |
| 78 | + /// [userStatus](https://developer.apple.com/documentation/appstoreserverapi/userstatus) |
| 79 | + #[serde(rename = "userStatus")] |
| 80 | + pub user_status: Option<UserStatus>, |
| 81 | +} |
0 commit comments