# Generated by @docstream/fastapi-server-emitter
# Do not edit this file manually — regenerate with: tsp compile .
"""Service layer for Contexts operations.

Contains a Protocol interface defining the service contract and a stub
implementation that raises NotImplementedError for all methods.
"""
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


@runtime_checkable
class ContextsServiceService(Protocol):
    """Service interface for Contexts operations."""
    """Create a context — Create a new context with an optional renderer default and initial sources."""
    async def create_context(self, body: ContextCreate) -> ValidationError:
        ...
    """List contexts — List all contexts and their sources."""
    async def list_contexts(self) -> ContextList:
        ...
    """Get a context — Get a single context by id."""
    async def get_context(self, id: str) -> NotFoundError:
        ...
    """Update a context's renderer — Update the context-level renderer default. The `id` and `sources` fields are not writable via PATCH."""
    async def update_context(self, id: str, body: ContextUpdate) -> NotFoundError:
        ...
    """Delete a context — Delete a context. Idempotent: deleting a missing context returns 204."""
    async def delete_context(self, id: str) -> NotFoundError:
        ...
    """Add a source to a context — Add a source to a context. The server derives `slug` and rejects 409 if it collides."""
    async def add_source(self, id: str, body: SourceCreate) -> NotFoundError:
        ...
    """List sources in a context — List all sources belonging to a context."""
    async def list_sources(self, id: str) -> NotFoundError:
        ...
    """Get a source — Get a single source by slug within a context."""
    async def get_source(self, id: str, slug: str) -> NotFoundError:
        ...
    """Remove a source — Remove a source from a context. Idempotent: removing a missing source returns 204."""
    async def delete_source(self, id: str, slug: str) -> NotFoundError:
        ...
    """Force a context reload — Invalidate render caches for a context; the config watcher reconciles watchers."""
    async def reload_context(self, id: str) -> NotFoundError:
        ...


class ContextsServiceServiceStub:
    """Stub implementation of ContextsServiceService.

    All methods raise NotImplementedError. Replace with actual
    business logic by subclassing or monkey-patching.
"""
    """Create a context — Create a new context with an optional renderer default and initial sources."""
    async def create_context(self, body: ContextCreate) -> ValidationError:
        raise NotImplementedError(
            "Method create_context not yet implemented"
        )
    """List contexts — List all contexts and their sources."""
    async def list_contexts(self) -> ContextList:
        raise NotImplementedError(
            "Method list_contexts not yet implemented"
        )
    """Get a context — Get a single context by id."""
    async def get_context(self, id: str) -> NotFoundError:
        raise NotImplementedError(
            "Method get_context not yet implemented"
        )
    """Update a context's renderer — Update the context-level renderer default. The `id` and `sources` fields are not writable via PATCH."""
    async def update_context(self, id: str, body: ContextUpdate) -> NotFoundError:
        raise NotImplementedError(
            "Method update_context not yet implemented"
        )
    """Delete a context — Delete a context. Idempotent: deleting a missing context returns 204."""
    async def delete_context(self, id: str) -> NotFoundError:
        raise NotImplementedError(
            "Method delete_context not yet implemented"
        )
    """Add a source to a context — Add a source to a context. The server derives `slug` and rejects 409 if it collides."""
    async def add_source(self, id: str, body: SourceCreate) -> NotFoundError:
        raise NotImplementedError(
            "Method add_source not yet implemented"
        )
    """List sources in a context — List all sources belonging to a context."""
    async def list_sources(self, id: str) -> NotFoundError:
        raise NotImplementedError(
            "Method list_sources not yet implemented"
        )
    """Get a source — Get a single source by slug within a context."""
    async def get_source(self, id: str, slug: str) -> NotFoundError:
        raise NotImplementedError(
            "Method get_source not yet implemented"
        )
    """Remove a source — Remove a source from a context. Idempotent: removing a missing source returns 204."""
    async def delete_source(self, id: str, slug: str) -> NotFoundError:
        raise NotImplementedError(
            "Method delete_source not yet implemented"
        )
    """Force a context reload — Invalidate render caches for a context; the config watcher reconciles watchers."""
    async def reload_context(self, id: str) -> NotFoundError:
        raise NotImplementedError(
            "Method reload_context not yet implemented"
        )
