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)]
17#[serde(rename_all = "camelCase")]
18pub struct ConsumptionRequest {
19    /// A Boolean value that indicates whether the customer consented to provide consumption data to the App Store.
20    ///
21    /// [customerConsented](https://developer.apple.com/documentation/appstoreserverapi/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    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    pub sample_content_provided: Option<bool>,
38
39    /// A value that indicates whether the app successfully delivered an in-app purchase that works properly.
40    ///
41    /// [deliveryStatus](https://developer.apple.com/documentation/appstoreserverapi/deliverystatus)
42    pub delivery_status: Option<DeliveryStatus>,
43
44    /// The UUID that an app optionally generates to map a customer's in-app purchase with its resulting App Store transaction.
45    ///
46    /// [appAccountToken](https://developer.apple.com/documentation/appstoreserverapi/appaccounttoken)
47    #[serde(skip_serializing_if = "Option::is_none")]
48    pub app_account_token: Option<Uuid>,
49
50    /// The age of the customer’s account.
51    ///
52    /// [accountTenure](https://developer.apple.com/documentation/appstoreserverapi/accounttenure)
53    pub account_tenure: Option<AccountTenure>,
54
55    /// A value that indicates the amount of time that the customer used the app.
56    ///
57    /// [playTime](https://developer.apple.com/documentation/appstoreserverapi/playtime)
58    pub play_time: Option<PlayTime>,
59
60    /// A value that indicates the total amount, in USD, of refunds the customer has received, in your app, across all platforms.
61    ///
62    /// [lifetimeDollarsRefunded](https://developer.apple.com/documentation/appstoreserverapi/lifetimedollarsrefunded)
63    pub lifetime_dollars_refunded: Option<LifetimeDollarsRefunded>,
64
65    /// A value that indicates the total amount, in USD, of in-app purchases the customer has made in your app, across all platforms.
66    ///
67    /// [lifetimeDollarsPurchased](https://developer.apple.com/documentation/appstoreserverapi/lifetimedollarspurchased)
68    pub lifetime_dollars_purchased: Option<LifetimeDollarsPurchased>,
69
70    /// The status of the customer’s account.
71    ///
72    /// [userStatus](https://developer.apple.com/documentation/appstoreserverapi/userstatus)
73    pub user_status: Option<UserStatus>,
74
75    /// A value that indicates your preference, based on your operational logic, as to whether Apple should grant the refund.
76    ///
77    /// [refundPreference](https://developer.apple.com/documentation/appstoreserverapi/refundpreference)
78    pub refund_preference: Option<RefundPreference>,
79}