app-store-server-library 4.0.1

The Rust server library for the App Store Server API, App Store Server Notifications and Advanced Commerce API
Documentation
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>,
}