from http import HTTPMethod

from edri.api.dataclass.api_event import api
from edri.dataclass.response import Response, response
from edri.events.api.group import Client


@response
class DocumentationResponse(Response):
    api_resources: dict


@api(url="/edri/docs", resource="edri-docs", method=HTTPMethod.GET, template="documentation.j2")
class EdriDocumentation(Client):
    """
    Serves the complete API documentation page.

    This event may provide a human-readable HTML representation of all available API endpoints,
    including their access methods (HTTP, WebSocket), parameters and cookies.

    The content is autogenerated and reflects real-time structure based on the current state of registered API resources.
    """
    response: DocumentationResponse
