import voluptuous as vol
from .const import CONF_DEVICE_TOKEN as CONF_DEVICE_TOKEN, CONF_VOLUMES as CONF_VOLUMES, DEFAULT_PORT as DEFAULT_PORT, DEFAULT_PORT_SSL as DEFAULT_PORT_SSL, DEFAULT_SCAN_INTERVAL as DEFAULT_SCAN_INTERVAL, DEFAULT_TIMEOUT as DEFAULT_TIMEOUT, DEFAULT_USE_SSL as DEFAULT_USE_SSL, DEFAULT_VERIFY_SSL as DEFAULT_VERIFY_SSL, DOMAIN as DOMAIN, EXCEPTION_DETAILS as EXCEPTION_DETAILS
from homeassistant import exceptions as exceptions
from homeassistant.components import ssdp as ssdp
from homeassistant.config_entries import ConfigEntry as ConfigEntry, ConfigFlow as ConfigFlow, OptionsFlow as OptionsFlow
from homeassistant.const import CONF_DISKS as CONF_DISKS, CONF_HOST as CONF_HOST, CONF_MAC as CONF_MAC, CONF_NAME as CONF_NAME, CONF_PASSWORD as CONF_PASSWORD, CONF_PORT as CONF_PORT, CONF_SCAN_INTERVAL as CONF_SCAN_INTERVAL, CONF_SSL as CONF_SSL, CONF_TIMEOUT as CONF_TIMEOUT, CONF_USERNAME as CONF_USERNAME, CONF_VERIFY_SSL as CONF_VERIFY_SSL
from homeassistant.core import callback as callback
from homeassistant.data_entry_flow import FlowResult as FlowResult
from homeassistant.helpers.typing import DiscoveryInfoType as DiscoveryInfoType
from synology_dsm import SynologyDSM
from typing import Any

_LOGGER: Any
CONF_OTP_CODE: str

def _discovery_schema_with_defaults(discovery_info: DiscoveryInfoType) -> vol.Schema: ...
def _reauth_schema_with_defaults(user_input: dict[str, Any]) -> vol.Schema: ...
def _user_schema_with_defaults(user_input: dict[str, Any]) -> vol.Schema: ...
def _ordered_shared_schema(schema_input: dict[str, Any]) -> dict[Union[vol.Required, vol.Optional], Any]: ...

class SynologyDSMFlowHandler(ConfigFlow):
    VERSION: int
    @staticmethod
    def async_get_options_flow(config_entry: ConfigEntry) -> SynologyDSMOptionsFlowHandler: ...
    saved_user_input: Any
    discovered_conf: Any
    reauth_conf: Any
    reauth_reason: Any
    def __init__(self) -> None: ...
    async def _show_setup_form(self, user_input: Union[dict[str, Any], None] = ..., errors: Union[dict[str, str], None] = ...) -> FlowResult: ...
    async def async_step_user(self, user_input: Union[dict[str, Any], None] = ...) -> FlowResult: ...
    async def async_step_ssdp(self, discovery_info: DiscoveryInfoType) -> FlowResult: ...
    async def async_step_reauth(self, user_input: Union[dict[str, Any], None] = ...) -> FlowResult: ...
    async def async_step_link(self, user_input: dict[str, Any]) -> FlowResult: ...
    async def async_step_2sa(self, user_input: dict[str, Any], errors: Union[dict[str, str], None] = ...) -> FlowResult: ...
    def _mac_already_configured(self, mac: str) -> bool: ...

class SynologyDSMOptionsFlowHandler(OptionsFlow):
    config_entry: Any
    def __init__(self, config_entry: ConfigEntry) -> None: ...
    async def async_step_init(self, user_input: Union[dict[str, Any], None] = ...) -> FlowResult: ...

def _login_and_fetch_syno_info(api: SynologyDSM, otp_code: str) -> str: ...

class InvalidData(exceptions.HomeAssistantError): ...
