#[non_exhaustive]pub struct WebhookEventPayload {
pub id: String,
pub event_type: EventType,
pub created_at: u64,
pub project_id: String,
pub actor: Option<Actor>,
pub severity: Option<EventSeverity>,
pub title: Option<String>,
pub description: Option<String>,
pub resource: Option<EventResource>,
pub facts: Vec<EventFact>,
/* private fields */
}Expand description
The JSON body of a webhook delivery: the event in the same shape as an Event from the
events feed. Read it with crate::construct_webhook_event, which checks the fields’ types
first; json returns the body as received, including fields this SDK version
does not model.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringThe event ID; deduplicate deliveries with it.
event_type: EventTypeThe event type (type on the wire).
created_at: u64Milliseconds since the Unix epoch.
project_id: StringThe owning project.
actor: Option<Actor>Who caused the event. CalmLens sends it with every delivery; None only for a body
without one.
severity: Option<EventSeverity>The severity.
title: Option<String>The title.
description: Option<String>The description, or None when the event has none.
resource: Option<EventResource>The asset, membership or API key the event is about, and the event’s place in that
resource’s sequence; None for an event about no resource. Deliveries can arrive out of
order: see crate::is_newer_event.
facts: Vec<EventFact>The event’s facts.
Implementations§
Source§impl WebhookEventPayload
impl WebhookEventPayload
Sourcepub fn from_event(event: &Event) -> Self
pub fn from_event(event: &Event) -> Self
The delivery body CalmLens sends for event, e.g. to test a webhook handler.
Trait Implementations§
Source§impl Clone for WebhookEventPayload
impl Clone for WebhookEventPayload
Source§impl Debug for WebhookEventPayload
impl Debug for WebhookEventPayload
Source§impl Default for WebhookEventPayload
impl Default for WebhookEventPayload
Source§impl<'de> Deserialize<'de> for WebhookEventPayload
impl<'de> Deserialize<'de> for WebhookEventPayload
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>,
Source§impl EventFacts for WebhookEventPayload
impl EventFacts for WebhookEventPayload
Source§fn event_facts(&self) -> &[EventFact]
fn event_facts(&self) -> &[EventFact]
Source§impl PartialEq for WebhookEventPayload
impl PartialEq for WebhookEventPayload
Source§impl ResourceEvent for WebhookEventPayload
impl ResourceEvent for WebhookEventPayload
Source§fn event_resource(&self) -> Option<&EventResource>
fn event_resource(&self) -> Option<&EventResource>
None for an event about no resource.