#[non_exhaustive]pub struct WebhookEvent {
pub event_id: String,
pub event: WebhookEventName,
pub occurred_at: String,
pub payload_version: u32,
pub subscription_id: String,
pub changed_fields: Option<Vec<String>>,
pub data: Article,
/* private fields */
}Expand description
A verified webhook delivery in payload version 3.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.event_id: StringIdempotency key: the same on every retry of the same event. Dedupe on it.
event: WebhookEventNamearticle.created or article.updated (open).
occurred_at: StringWhen the event happened (stable across retries), as sent.
payload_version: u32Always 3.
subscription_id: StringThe webhook id.
changed_fields: Option<Vec<String>>Changed fields of an article.updated; None when the key is absent.
data: ArticleThe article.
Implementations§
Source§impl WebhookEvent
impl WebhookEvent
Sourcepub fn is_test(&self) -> bool
pub fn is_test(&self) -> bool
true for the dashboard test webhook (event_id starts with evt_test).
Sourcepub fn occurred_at_time(&self) -> Option<SystemTime>
pub fn occurred_at_time(&self) -> Option<SystemTime>
occurred_at parsed strictly.
Trait Implementations§
Source§impl Clone for WebhookEvent
impl Clone for WebhookEvent
Source§impl Debug for WebhookEvent
impl Debug for WebhookEvent
Source§impl PartialEq for WebhookEvent
impl PartialEq for WebhookEvent
impl StructuralPartialEq for WebhookEvent
Auto Trait Implementations§
impl Forget for WebhookEvent
impl Freeze for WebhookEventwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<Media>: Freeze,
PhantomData<Company>: Freeze,
PhantomData<EventTag>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
impl Move for WebhookEvent
impl RefUnwindSafe for WebhookEvent
impl Send for WebhookEvent
impl Sync for WebhookEvent
impl Unpin for WebhookEvent
impl UnsafeUnpin for WebhookEventwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Media>: UnsafeUnpin,
PhantomData<Company>: UnsafeUnpin,
PhantomData<EventTag>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
impl UnwindSafe for WebhookEvent
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