# 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 powersource_api_fast.models.extra_models import TokenModel  # noqa: F401
from powersource_api_fast.models.fan_speed_api_cmd_response import FanSpeedApiCmdResponse
from powersource_api_fast.models.fan_speed_api_data import FanSpeedApiData
from powersource_api_fast.models.power_unit_api_cmd_response import PowerUnitApiCmdResponse
from powersource_api_fast.models.power_unit_api_data import PowerUnitApiData
from powersource_api_fast.models.switch_matrix_data import SwitchMatrixData
from powersource_api_fast.models.switch_matrix_response import SwitchMatrixResponse
from powersource_api_fast.models.system_api_info import SystemApiInfo


router = APIRouter(prefix="/v1")


@router.get(
    "/fan",
    responses={
        200: {"model": FanSpeedApiData, "description": "OK"},
    },
    tags=["powersource"],
    response_model_by_alias=True,
)
async def fan_get(
) -> FanSpeedApiData:
    ...


@router.post(
    "/fan",
    responses={
        200: {"model": FanSpeedApiCmdResponse, "description": "OK"},
    },
    tags=["powersource"],
    response_model_by_alias=True,
)
async def fan_post(
    fan_speed_1: int
 = Query(..., description="speed of fan 1")
,
    fan_speed_2: int
 = Query(..., description="speed of fan 2")
,
    fan_speed_3: int
 = Query(..., description="speed of fan 3")
,
) -> FanSpeedApiCmdResponse:
    """Set fan speed manually."""
    ...


@router.get(
    "/powerunits/{unitId}",
    responses={
        200: {"model": PowerUnitApiData, "description": "OK"},
        404: {"description": "Not Found"},
    },
    tags=["powersource"],
    response_model_by_alias=True,
)
async def powerunits_unit_id_get(
    unitId: int
 = Path(..., description="Id of the power unit", ge=0)
,
) -> PowerUnitApiData:
    """Returns data of a selected power unit"""
    ...


@router.post(
    "/powerunits/{unitId}",
    responses={
        200: {"model": PowerUnitApiCmdResponse, "description": "OK"},
    },
    tags=["powersource"],
    response_model_by_alias=True,
)
async def powerunits_unit_id_post(
    unitId: int
 = Path(..., description="Id of the power unit", ge=0)
,
    enable_ac: bool
 = Query(..., description="enable AC relay")
,
    enable_dc: bool
 = Query(..., description="enable DC output (enable pin for rectifiers)")
,
    voltage_cmd: int
 = Query(..., description="output voltage cmd [V]")
,
    current_cmd: int
 = Query(..., description="output current cmd [A]")
,
) -> PowerUnitApiCmdResponse:
    """Set a command to the power unit"""
    ...


@router.get(
    "/switchmatrix",
    responses={
        200: {"model": SwitchMatrixData, "description": "OK"},
    },
    tags=["powersource"],
    response_model_by_alias=True,
)
async def switchmatrix_get(
) -> SwitchMatrixData:
    """Get data of the switch matrix"""
    ...


@router.post(
    "/switchmatrix",
    responses={
        200: {"model": SwitchMatrixResponse, "description": "OK"},
    },
    tags=["powersource"],
    response_model_by_alias=True,
)
async def switchmatrix_post(
    enable_relay_pu0_pu1: bool
 = Query(..., description="enable power merge relay of PU0 and PU1")
,
    enable_relay_pu1_pu2: bool
 = Query(..., description="enable power merge relay of PU1 and PU2")
,
    enable_relay_pu0_pu2: bool
 = Query(..., description="enable power merge relay of PU0 and PU2")
,
) -> SwitchMatrixResponse:
    """set power merge relays"""
    ...


@router.get(
    "/system",
    responses={
        200: {"model": SystemApiInfo, "description": "OK"},
    },
    tags=["powersource"],
    response_model_by_alias=True,
)
async def system_get(
) -> SystemApiInfo:
    """Get static system information. This includes information about the device, the software and the configuration."""
    ...
