Skip to content

Implement WebhookEvent model #42

Description

@codebestia

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions