"""Compact, immutable references returned by authenticated content lookups.""" from datetime import date from typing import Annotated, Literal from pydantic import BaseModel, ConfigDict, Field, StringConstraints ContentId = Annotated[str, StringConstraints(strip_whitespace=True, min_length=1, max_length=200)] PodcastId = Annotated[str, StringConstraints(pattern=r"^(daily|report):\S.{0,199}$")] class ContentReference(BaseModel): model_config = ConfigDict(frozen=True) id: ContentId title: str = Field(min_length=1, max_length=2000) date: date class ReportReference(ContentReference): has_podcast: bool class PodcastReference(ContentReference): id: PodcastId kind: Literal["daily", "report"] class ConversationContent(BaseModel): model_config = ConfigDict(frozen=True) report: ReportReference | None = None podcast: PodcastReference | None = None unavailable: bool = False class ContentSelection(BaseModel): model_config = ConfigDict(extra="forbid") kind: Literal["report", "podcast"] id: Annotated[str, StringConstraints(strip_whitespace=True, min_length=1, max_length=207)] class SelectContentRequest(BaseModel): model_config = ConfigDict(extra="forbid") request: ContentSelection