# Generated by smithplates HTTP codegen. Do not edit.
from typing import Annotated

from fastapi import (
    APIRouter,
    Depends,
)
from generated.example.event_api.api_response import dispatch_api_response
from generated.example.event_api.app_services import ApiServices, get_api_services
from generated.example.event_api.operation_bindings import OPERATION_HTTP_BINDINGS
from generated.example.event_list import EventList
from pydantic import Field  # noqa: F401

router = APIRouter()


@router.get(
    "/events",
    responses={
        200: {"description": "Response"},
    },
    response_model_by_alias=True,
)
async def list_events(
    services: Annotated[ApiServices, Depends(get_api_services)],
) -> EventList:
    return dispatch_api_response(
        await services.events_api.list_events(),
        OPERATION_HTTP_BINDINGS["list_events"],
    )
