1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use serde_with::formats::Flexible;
use serde_with::TimestampMilliSeconds;
use crate::models::auto_renew_status::AutoRenewStatus;
use crate::models::renewal_billing_plan_type::RenewalBillingPlanType;
/// Information about a subscription renewal commitment.
///
/// [RenewalCommitmentInfo](https://developer.apple.com/documentation/appstoreserverapi/renewalcommitmentinfo)
#[serde_with::serde_as]
#[derive(Debug, Clone, Deserialize, Serialize, Hash)]
#[serde(rename_all = "camelCase")]
pub struct RenewalCommitmentInfo {
/// The product identifier of the subscription to which the user commits.
///
/// [commitmentAutoRenewProductId](https://developer.apple.com/documentation/appstoreserverapi/commitmentautorenewproductid)
pub commitment_auto_renew_product_id: Option<String>,
/// The renewal status of the subscription.
///
/// [commitmentAutoRenewStatus](https://developer.apple.com/documentation/appstoreserverapi/commitmentautorenewstatus)
pub commitment_auto_renew_status: Option<AutoRenewStatus>,
/// The billing plan type for the renewal commitment.
///
/// [commitmentRenewalBillingPlanType](https://developer.apple.com/documentation/appstoreserverapi/commitmentrenewalbillingplantype)
pub commitment_renewal_billing_plan_type: Option<RenewalBillingPlanType>,
/// The UNIX time, in milliseconds, when the renewal commitment expires.
///
/// [commitmentRenewalDate](https://developer.apple.com/documentation/appstoreserverapi/commitmentrenewaldate)
#[serde_as(as = "Option<TimestampMilliSeconds<String, Flexible>>")]
pub commitment_renewal_date: Option<DateTime<Utc>>,
/// The price of the renewal commitment.
///
/// [commitmentRenewalPrice](https://developer.apple.com/documentation/appstoreserverapi/commitmentrenewalprice)
pub commitment_renewal_price: Option<i64>,
}