Represents a parsed, verified webhook event delivered by the Shade platform. The data field should be typed as the corresponding resource model rather than a raw dict.
Proposed Steps:
- Create
src/shade/models/webhook.py.
- Fields:
id, type: str, data: Any, created_at: datetime, livemode: bool.
- Add a
WebhookEventType constants class.
- The
Webhook.construct_event() method populates data with the typed model.
Acceptance Criteria:
WebhookEvent.from_dict(raw_payload) populates all fields.
event.livemode correctly reflects the event origin.
event.data is the raw dict at model level; typed model coercion happens in the resource layer.
Represents a parsed, verified webhook event delivered by the Shade platform. The
datafield should be typed as the corresponding resource model rather than a raw dict.Proposed Steps:
src/shade/models/webhook.py.id,type: str,data: Any,created_at: datetime,livemode: bool.WebhookEventTypeconstants class.Webhook.construct_event()method populatesdatawith the typed model.Acceptance Criteria:
WebhookEvent.from_dict(raw_payload)populates all fields.event.livemodecorrectly reflects the event origin.event.datais the raw dict at model level; typed model coercion happens in the resource layer.