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