#[non_exhaustive]pub struct WebhookEvent {
pub id: String,
pub event_type: String,
pub source: String,
pub subject: Option<String>,
pub time: String,
pub specversion: String,
pub data: WebhookEventData,
pub raw_data: Value,
pub wellfriend: WebhookEventMeta,
pub extra: Object,
}Expand description
A verified webhook event (CloudEvents 1.0).
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.id: StringThe event id (evt_...), also sent as webhook-id. Deduplicate on it.
event_type: StringThe event type, for example com.wellfriend.document-operation.completed.v2.
source: StringThe workspace that produced the event (wellfriend://workspaces/ws_...).
subject: Option<String>The id of the resource the event is about.
time: StringWhen the event was recorded (RFC 3339).
specversion: StringAlways 1.0.
data: WebhookEventDataThe payload, typed by event type (Unknown for types this SDK version does not know).
raw_data: ValueThe payload as sent.
wellfriend: WebhookEventMetaOrdering metadata.
extra: ObjectFields this SDK version does not model.
Implementations§
Source§impl WebhookEvent
impl WebhookEvent
Sourcepub fn parse(payload: &[u8]) -> Result<Self>
pub fn parse(payload: &[u8]) -> Result<Self>
Parses an event body without verifying it. Use verify_webhook for deliveries.
Trait Implementations§
Source§impl Clone for WebhookEvent
impl Clone for WebhookEvent
Source§impl Debug for WebhookEvent
impl Debug for WebhookEvent
Source§impl<'de> Deserialize<'de> for WebhookEvent
impl<'de> Deserialize<'de> for WebhookEvent
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
Source§impl PartialEq for WebhookEvent
impl PartialEq for WebhookEvent
Source§impl Serialize for WebhookEvent
impl Serialize for WebhookEvent
impl StructuralPartialEq for WebhookEvent
Auto Trait Implementations§
impl Forget for WebhookEvent
impl Freeze for WebhookEvent
impl Move for WebhookEvent
impl RefUnwindSafe for WebhookEvent
impl Send for WebhookEvent
impl Sync for WebhookEvent
impl Unpin for WebhookEvent
impl UnsafeUnpin for WebhookEvent
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