# Generated by @docstream/fastapi-server-emitter
# Do not edit this file manually — regenerate with: tsp compile .
"""Repository Protocol interface for file-based data access.

Defines the data access contract for the Docstream API. Methods are
inferred from TypeSpec operations and grouped by domain.
"""
from __future__ import annotations


from typing import Protocol, runtime_checkable

from ..models.contexts import Context, ContextCreate, ContextList, ContextUpdate, Source, SourceCreate, SourceList
from ..models.errors import NotFoundError, ValidationError
from ..models.health import HealthResponse, ReadyResponse


@runtime_checkable
class Repository(Protocol):
    """File-system data access interface for the Docstream API.

    Provides read and write access to context, source, and renderer
    data stored as YAML files on disk. Implementations should
    be free of HTTP/pagination concerns — the service layer wraps these
    methods with validation, slug derivation, and renderer resolution.
"""

    # ── contexts ──
    """Add a source to a context"""
    async def add_source(self, id: str, data: SourceCreate) -> NotFoundError:
        ...
    """Create a context"""
    async def create_create_context(self, data: ContextCreate) -> ValidationError:
        ...
    """Force a context reload"""
    async def create_reload_context(self, id: str) -> NotFoundError:
        ...
    """Delete a context"""
    async def delete_delete_context(self, id: str) -> NotFoundError:
        ...
    """Remove a source"""
    async def delete_delete_source(self, id: str, slug: str) -> NotFoundError:
        ...
    """Get a context"""
    async def get_context_context(self, id: str) -> NotFoundError:
        ...
    """Get a source"""
    async def get_source_context(self, id: str, slug: str) -> NotFoundError:
        ...
    """List contexts"""
    async def list_contexts_context(self) -> ContextList:
        ...
    """List sources in a context"""
    async def list_sources_context(self, id: str) -> NotFoundError:
        ...
    """Update a context's renderer"""
    async def update_update_context(self, id: str, data: ContextUpdate) -> NotFoundError:
        ...

    # ── health ──
    """Health check"""
    async def health_health(self) -> HealthResponse:
        ...
    """Readiness check"""
    async def ready_health(self) -> ReadyResponse:
        ...
