Skip to main content

app_store_server_library/models/
notification_data.rs

1use serde::{Deserialize, Serialize};
2
3use crate::models::app_store_environment::Environment;
4use crate::models::consumption_request_reason::ConsumptionRequestReason;
5use crate::models::status::Status;
6
7/// The app metadata and the signed renewal and transaction information.
8///
9/// [data](https://developer.apple.com/documentation/appstoreservernotifications/data)
10#[derive(Debug, Clone, Deserialize, Serialize, Hash)]
11pub struct Data {
12    /// The server environment that the notification applies to, either sandbox or production.
13    ///
14    /// [environment](https://developer.apple.com/documentation/appstoreservernotifications/environment)
15    pub environment: Option<Environment>,
16
17    /// The unique identifier of an app in the App Store.
18    ///
19    /// [appAppleId](https://developer.apple.com/documentation/appstoreservernotifications/appappleid)
20    #[serde(rename = "appAppleId")]
21    pub app_apple_id: Option<i64>,
22
23    /// The bundle identifier of an app.
24    ///
25    /// [bundleId](https://developer.apple.com/documentation/appstoreserverapi/bundleid)
26    #[serde(rename = "bundleId")]
27    pub bundle_id: Option<String>,
28
29    /// The version of the build that identifies an iteration of the bundle.
30    ///
31    /// [bundleVersion](https://developer.apple.com/documentation/appstoreservernotifications/bundleversion)
32    #[serde(rename = "bundleVersion")]
33    pub bundle_version: Option<String>,
34
35    /// Transaction information signed by the App Store, in JSON Web Signature (JWS) format.
36    ///
37    /// [JWSTransaction](https://developer.apple.com/documentation/appstoreserverapi/jwstransaction)
38    #[serde(rename = "signedTransactionInfo")]
39    pub signed_transaction_info: Option<String>,
40
41    /// Subscription renewal information, signed by the App Store, in JSON Web Signature (JWS) format.
42    ///
43    /// [JWSRenewalInfo](https://developer.apple.com/documentation/appstoreserverapi/jwsrenewalinfo)
44    #[serde(rename = "signedRenewalInfo")]
45    pub signed_renewal_info: Option<String>,
46
47    /// The status of an auto-renewable subscription at the time the App Store signs the notification.
48    ///
49    /// [JWSRenewalInfo](https://developer.apple.com/documentation/appstoreservernotifications/status)
50    #[serde(rename = "status")]
51    pub status: Option<Status>,
52
53    /// The reason the customer requested the refund.
54    ///
55    /// [consumptionRequestReason](https://developer.apple.com/documentation/appstoreservernotifications/consumptionrequestreason)
56    #[serde(rename = "consumptionRequestReason")]
57    pub consumption_request_reason: Option<ConsumptionRequestReason>,
58}