app.schemas.sources

Response models for source registrations and search facets.

Field names match the app.services.sources_view dataclasses they are built from (from_attributes=True); see app.schemas for the convention.

class app.schemas.sources.SourceOut(*, id, type, enabled, config_error, config_error_code, intake, published_ref, last_attempt_at, last_success_at, last_status, last_error, stale)

Bases: BaseModel

One source registration’s configuration and freshness.

model_config: ClassVar[ConfigDict] = {'from_attributes': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: str
type: str
enabled: bool
config_error: str | None
config_error_code: ConfigErrorCode | None
intake: list[IntakeKind]
published_ref: str
last_attempt_at: datetime | None
last_success_at: datetime | None
last_status: PollStatus
last_error: JsonValue
stale: bool
class app.schemas.sources.FacetProjectOut(*, project, count)

Bases: BaseModel

Record count of one project within a source.

model_config: ClassVar[ConfigDict] = {'from_attributes': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

project: str
count: int
class app.schemas.sources.FacetSourceOut(*, source_id, count, projects)

Bases: BaseModel

One source’s projects, for the filter select.

model_config: ClassVar[ConfigDict] = {'from_attributes': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

source_id: str
count: int
projects: list[FacetProjectOut]
class app.schemas.sources.FacetsOut(*, sources)

Bases: BaseModel

Filter options for the search UI.

model_config: ClassVar[ConfigDict] = {'from_attributes': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sources: list[FacetSourceOut]