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

from fastapi import (
    APIRouter,
    Depends,
    Path,
)
from generated.example.asset_event_list_output import AssetEventListOutput
from generated.example.asset_output import AssetOutput
from generated.example.redirect import Redirect
from generated.project_api.project_api.api_response import dispatch_api_response
from generated.project_api.project_api.app_services import ApiServices, get_api_services
from generated.project_api.project_api.operation_bindings import OPERATION_HTTP_BINDINGS
from pydantic import Field  # noqa: F401

router = APIRouter()


@router.get(
    "/projects/{projectId}/assets/{assetId}",
    responses={
        200: {"description": "Response"},
    },
    response_model_by_alias=True,
)
async def get_project_asset(
    services: Annotated[ApiServices, Depends(get_api_services)],
    project_id: str = Path(..., alias="projectId"),
    asset_id: str = Path(..., alias="assetId"),
) -> AssetOutput:
    return dispatch_api_response(
        await services.project_assets_api.get_project_asset(project_id=project_id, asset_id=asset_id),
        OPERATION_HTTP_BINDINGS["get_project_asset"],
    )


@router.get(
    "/projects/{projectId}/assets/{assetId}/content",
    responses={
        302: {"description": "Response"},
    },
    response_model_by_alias=True,
)
async def get_project_asset_content(
    services: Annotated[ApiServices, Depends(get_api_services)],
    project_id: str = Path(..., alias="projectId"),
    asset_id: str = Path(..., alias="assetId"),
) -> Redirect:
    return dispatch_api_response(
        await services.project_assets_api.get_project_asset_content(project_id=project_id, asset_id=asset_id),
        OPERATION_HTTP_BINDINGS["get_project_asset_content"],
    )


@router.get(
    "/projects/{projectId}/assets/{assetId}/events",
    responses={
        200: {"description": "Response"},
    },
    response_model_by_alias=True,
)
async def list_asset_events(
    services: Annotated[ApiServices, Depends(get_api_services)],
    project_id: str = Path(..., alias="projectId"),
    asset_id: str = Path(..., alias="assetId"),
) -> AssetEventListOutput:
    return dispatch_api_response(
        await services.project_assets_api.list_asset_events(project_id=project_id, asset_id=asset_id),
        OPERATION_HTTP_BINDINGS["list_asset_events"],
    )
