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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
use crate::primitives::notification_type_v2::NotificationTypeV2;
use crate::primitives::subtype::Subtype;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use serde_with::formats::Flexible;
use serde_with::TimestampMilliSeconds;
/// The request body for notification history.
///
/// [NotificationHistoryRequest](https://developer.apple.com/documentation/appstoreserverapi/notificationhistoryrequest)
#[serde_with::serde_as]
#[derive(Debug, Clone, Deserialize, Serialize, Hash, PartialEq, Eq)]
pub struct NotificationHistoryRequest {
/// The start date of the timespan for the requested App Store Server Notification history records.
/// The startDate needs to precede the endDate. Choose a startDate that’s within the past 180 days from the current date.
///
/// [startDate](https://developer.apple.com/documentation/appstoreserverapi/startdate)
#[serde(rename = "startDate")]
#[serde_as(as = "Option<TimestampMilliSeconds<i64, Flexible>>")]
pub start_date: Option<DateTime<Utc>>,
/// The end date of the timespan for the requested App Store Server Notification history records.
/// Choose an endDate that’s later than the startDate. If you choose an endDate in the future, the endpoint automatically uses the current date as the endDate.
///
/// [endDate](https://developer.apple.com/documentation/appstoreserverapi/enddate)
#[serde(rename = "endDate")]
#[serde_as(as = "Option<TimestampMilliSeconds<i64, Flexible>>")]
pub end_date: Option<DateTime<Utc>>,
/// A notification type. Provide this field to limit the notification history records to those with this one notification type.
/// For a list of notifications types, see notificationType.
/// Include either the transactionId or the notificationType in your query, but not both.
///
/// [notificationType](https://developer.apple.com/documentation/appstoreserverapi/notificationtype)
#[serde(rename = "notificationType")]
pub notification_type: Option<NotificationTypeV2>,
/// A notification subtype. Provide this field to limit the notification history records to those with this one notification subtype.
/// For a list of subtypes, see subtype. If you specify a notificationSubtype, you need to also specify its related notificationType.
///
/// [notificationSubtype](https://developer.apple.com/documentation/appstoreserverapi/notificationsubtype)
#[serde(rename = "notificationSubtype")]
pub notification_subtype: Option<Subtype>,
/// The transaction identifier, which may be an original transaction identifier, of any transaction belonging to the customer.
/// Provide this field to limit the notification history request to this one customer.
/// Include either the transactionId or the notificationType in your query, but not both.
///
/// [transactionId](https://developer.apple.com/documentation/appstoreserverapi/transactionid)
#[serde(rename = "transactionId")]
pub transaction_id: Option<String>,
/// A Boolean value you set to true to request only the notifications that haven’t reached your server successfully.
/// The response also includes notifications that the App Store server is currently retrying to send to your server.
///
/// [onlyFailures](https://developer.apple.com/documentation/appstoreserverapi/onlyfailures)
#[serde(rename = "onlyFailures")]
pub only_failures: Option<bool>,
}