Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.1 KB
Raw Blame
"""
Cross-boundary data contracts for data_warehouse.

Frozen, framework-free dataclasses (``pydantic.dataclasses.dataclass`` — runtime type
validation on construction) describing the data_warehouse data crossing the product
boundary. ORM models are never returned across the boundary; the facade maps them to
these contracts.

data_warehouse's external surface is predominantly operational wiring (schedule/S3/
source-management ops, re-exported through ``facade.api`` and the other submodules), so
the contract-data surface here is intentionally small and grows as consumers migrate
from model objects to data reads.
"""

from pydantic.dataclasses import dataclass


@dataclass(frozen=True)
class TeamDataWarehouseConfig:
    """A team's data-warehouse configuration (the data-ops overview surface)."""

    team_id: int
    overview_dashboard_ids: list[int]


@dataclass(frozen=True)
class WebhookHogFunctionCreateResult:
    """Outcome of creating or updating the HogFunction that receives a source's webhook events."""

    hog_function_id: str | None = None
    webhook_url: str = ""
    error: str | None = None
    hog_function_created: bool = False