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