app_store_server_library/models/consumption_request.rs
1use serde::{Deserialize, Serialize};
2
3use crate::models::delivery_status::DeliveryStatus;
4use crate::models::refund_preference::RefundPreference;
5
6/// The request body containing consumption information.
7///
8/// [ConsumptionRequest](https://developer.apple.com/documentation/appstoreserverapi/consumptionrequest)
9#[derive(Debug, Clone, Deserialize, Serialize, Hash)]
10#[serde(rename_all = "camelCase")]
11pub struct ConsumptionRequest {
12 /// A Boolean value that indicates whether the customer consented to provide consumption data to the App Store.
13 ///
14 /// [customerConsented](https://developer.apple.com/documentation/appstoreserverapi/customerconsented)
15 pub customer_consented: bool,
16
17 /// An integer that indicates the percentage, in milliunits, of the In-App Purchase the customer consumed.
18 ///
19 /// [consumptionPercentage](https://developer.apple.com/documentation/appstoreserverapi/consumptionpercentage)
20 #[serde(skip_serializing_if = "Option::is_none")]
21 pub consumption_percentage: Option<u32>,
22
23 /// A value that indicates whether the app successfully delivered an in-app purchase that works properly.
24 ///
25 /// [deliveryStatus](https://developer.apple.com/documentation/appstoreserverapi/deliverystatus)
26 pub delivery_status: DeliveryStatus,
27
28 /// A value that indicates your preference, based on your operational logic, as to whether Apple should grant the refund.
29 ///
30 /// [refundPreference](https://developer.apple.com/documentation/appstoreserverapi/refundpreference)
31 #[serde(skip_serializing_if = "Option::is_none")]
32 pub refund_preference: Option<RefundPreference>,
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: bool,
38}