stripe/model/
notification_event_data.rs

1use serde::{Serialize, Deserialize};
2///
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct NotificationEventData {
5    ///Object containing the API resource relevant to the event. For example, an `invoice.created` event will have a full [invoice object](https://stripe.com/docs/api#invoice_object) as the value of the object key.
6    pub object: serde_json::Value,
7    ///Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). If an array attribute has any updated elements, this object contains the entire array. In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements.
8    #[serde(skip_serializing_if = "Option::is_none")]
9    pub previous_attributes: Option<serde_json::Value>,
10}
11impl std::fmt::Display for NotificationEventData {
12    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13        write!(f, "{}", serde_json::to_string(self).unwrap())
14    }
15}