Skip to content

Commit

Permalink
Merge pull request arlyon#407 from hzargar2/previous_attributes
Browse files Browse the repository at this point in the history
Added attribute for previous event object
  • Loading branch information
arlyon authored Jul 7, 2023
2 parents 1bdb37a + 8aaccbe commit aa1c50e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/resources/webhook_events.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use std::collections::HashMap;

use chrono::Utc;
#[cfg(feature = "webhook-events")]
use hmac::{Hmac, Mac};
use serde::{Deserialize, Serialize};
use serde_json::Value;
#[cfg(feature = "webhook-events")]
use sha2::Sha256;
use smart_default::SmartDefault;
Expand Down Expand Up @@ -413,7 +416,8 @@ impl std::fmt::Display for EventType {
#[derive(Clone, Debug, Deserialize, Serialize, Default)]
pub struct NotificationEventData {
pub object: EventObject,
// previous_attributes: ...
#[serde(skip_serializing_if = "Option::is_none")]
pub previous_attributes: Option<HashMap<String, Value>>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
Expand Down Expand Up @@ -538,7 +542,6 @@ struct Signature<'r> {
#[cfg(feature = "webhook-events")]
impl<'r> Signature<'r> {
fn parse(raw: &'r str) -> Result<Signature<'r>, WebhookError> {
use std::collections::HashMap;
let headers: HashMap<&str, &str> = raw
.split(',')
.map(|header| {
Expand Down

0 comments on commit aa1c50e

Please sign in to comment.