# coding: utf-8

from typing import Dict, List  # noqa: F401

from fastapi import (  # noqa: F401
    APIRouter,
    Body,
    Cookie,
    Depends,
    Form,
    Header,
    Path,
    Query,
    Response,
    Security,
    status,
)

from ecp4_msi_api_fast.models.extra_models import TokenModel  # noqa: F401
from ecp4_msi_api_fast.models.error_response import ErrorResponse
from ecp4_msi_api_fast.models.msi import Msi
from ecp4_msi_api_fast.models.msi_control import MsiControl


router = APIRouter(prefix="http://localhost:9292/v1")


@router.get(
    "/can/{canId}/msi",
    responses={
        200: {"model": Msi, "description": "MSI data retrieved successfully"},
        400: {"model": ErrorResponse, "description": "Bad Request - Invalid input or missing parameters"},
        404: {"model": ErrorResponse, "description": "Bad Request - Entity was not found"},
        500: {"model": ErrorResponse, "description": "Internal Server Error - Unexpected server issue"},
    },
    tags=["msi"],
    summary="Retrieve MSI data for a CAN node",
    response_model_by_alias=True,
)
async def get_msi_data(
    canId: str
 = Path(..., description="Unique identifier for the CAN node.")
,
) -> Msi:
    """Get MSI data for a specific node identified by the CAN ID."""
    ...


@router.post(
    "/can/{canId}/msi",
    responses={
        200: {"model": MsiControl, "description": "MSI data updated successfully"},
        400: {"model": ErrorResponse, "description": "Bad Request - Invalid input or missing parameters"},
        404: {"model": ErrorResponse, "description": "Bad Request - Entity was not found"},
        500: {"model": ErrorResponse, "description": "Internal Server Error - Unexpected server issue"},
    },
    tags=["msi"],
    summary="Update MSI data for a CAN node",
    response_model_by_alias=True,
)
async def update_msi_data(
    canId: str
 = Path(..., description="Unique identifier for the CAN node.")
,
    msi_control: MsiControl
 = Body(..., description="")
,
) -> MsiControl:
    """Modify the MSI data for a specific CAN node."""
    ...
