pub struct WebhookNotification {
pub id: String,
pub grant_id: String,
pub application_id: String,
pub trigger: String,
pub timestamp: i64,
pub data: Value,
pub calendar_id: Option<String>,
pub master_event_id: Option<String>,
}Expand description
Webhook notification payload.
This is the payload sent by Nylas to your webhook URL when an event occurs.
§Example
let payload = r#"{
"id": "notif_123",
"grant_id": "grant_456",
"application_id": "app_789",
"trigger": "message.created",
"timestamp": 1609459200,
"data": {"id": "msg_abc", "subject": "Hello"}
}"#;
let notification: WebhookNotification = serde_json::from_str(payload).unwrap();
assert_eq!(notification.trigger, "message.created");Fields§
§id: StringUnique notification ID.
grant_id: StringGrant ID that triggered this notification.
application_id: StringApplication ID.
trigger: StringTrigger type (e.g., “message.created”).
timestamp: i64Unix timestamp when event occurred.
data: ValueEvent data payload.
calendar_id: Option<String>Calendar ID (for calendar/event triggers).
master_event_id: Option<String>Master event ID (for recurring event triggers).
Trait Implementations§
Source§impl Clone for WebhookNotification
impl Clone for WebhookNotification
Source§fn clone(&self) -> WebhookNotification
fn clone(&self) -> WebhookNotification
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WebhookNotification
impl Debug for WebhookNotification
Source§impl<'de> Deserialize<'de> for WebhookNotification
impl<'de> Deserialize<'de> for WebhookNotification
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for WebhookNotification
Source§impl PartialEq for WebhookNotification
impl PartialEq for WebhookNotification
Source§fn eq(&self, other: &WebhookNotification) -> bool
fn eq(&self, other: &WebhookNotification) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for WebhookNotification
impl Serialize for WebhookNotification
impl StructuralPartialEq for WebhookNotification
Auto Trait Implementations§
impl Freeze for WebhookNotification
impl RefUnwindSafe for WebhookNotification
impl Send for WebhookNotification
impl Sync for WebhookNotification
impl Unpin for WebhookNotification
impl UnsafeUnpin for WebhookNotification
impl UnwindSafe for WebhookNotification
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more