app_store_server_library/primitives/
consumption_request.rs

1use crate::primitives::serde_ext::{de_string_as_optional_uuid, ser_optional_uuid_as_string};
2use crate::primitives::account_tenure::AccountTenure;
3use crate::primitives::consumption_status::ConsumptionStatus;
4use crate::primitives::delivery_status::DeliveryStatus;
5use crate::primitives::lifetime_dollars_purchased::LifetimeDollarsPurchased;
6use crate::primitives::lifetime_dollars_refunded::LifetimeDollarsRefunded;
7use crate::primitives::platform::Platform;
8use crate::primitives::play_time::PlayTime;
9use crate::primitives::refund_preference::RefundPreference;
10use crate::primitives::user_status::UserStatus;
11use serde::{Deserialize, Serialize};
12use uuid::Uuid;
13
14/// The request body containing consumption information.
15///
16/// [ConsumptionRequest](https://developer.apple.com/documentation/appstoreserverapi/consumptionrequest)
17#[derive(Debug, Clone, Deserialize, Serialize, Hash)]
18#[serde(rename_all = "camelCase")]
19pub struct ConsumptionRequest {
20    /// A Boolean value that indicates whether the customer consented to provide consumption data to the App Store.
21    ///
22    /// [customerConsented](https://developer.apple.com/documentation/appstoreserverapi/customerconsented)
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub customer_consented: Option<bool>,
25
26    /// An integer that indicates the percentage, in milliunits, of the In-App Purchase the customer consumed.
27    ///
28    /// [consumptionPercentage](https://developer.apple.com/documentation/appstoreserverapi/consumptionpercentage)
29    #[serde(skip_serializing_if = "Option::is_none")]
30    pub consumption_percentage: Option<u32>,
31
32    /// A value that indicates whether the app successfully delivered an in-app purchase that works properly.
33    ///
34    /// [deliveryStatus](https://developer.apple.com/documentation/appstoreserverapi/deliverystatus)
35    pub delivery_status: Option<DeliveryStatus>,
36
37    /// A value that indicates your preference, based on your operational logic, as to whether Apple should grant the refund.
38    ///
39    /// [refundPreference](https://developer.apple.com/documentation/appstoreserverapi/refundpreference)
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub refund_preference: Option<RefundPreference>,
42
43    /// 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.
44    ///
45    /// [sampleContentProvided](https://developer.apple.com/documentation/appstoreserverapi/samplecontentprovided)
46    pub sample_content_provided: bool,
47}