import logging
from .const import DATA_SDM as DATA_SDM, DOMAIN as DOMAIN, SDM_SCOPES as SDM_SCOPES
from homeassistant.core import HomeAssistant as HomeAssistant, callback as callback
from homeassistant.data_entry_flow import FlowResult as FlowResult
from homeassistant.exceptions import HomeAssistantError as HomeAssistantError
from homeassistant.helpers import config_entry_oauth2_flow as config_entry_oauth2_flow
from homeassistant.util.json import load_json as load_json
from typing import Any

DATA_FLOW_IMPL: str
_LOGGER: Any

def register_flow_implementation(hass: HomeAssistant, domain: str, name: str, gen_authorize_url: str, convert_code: str) -> None: ...

class NestAuthError(HomeAssistantError): ...
class CodeInvalid(NestAuthError): ...
class UnexpectedStateError(HomeAssistantError): ...

class NestFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler):
    DOMAIN: Any
    VERSION: int
    _reauth: bool
    def __init__(self) -> None: ...
    @classmethod
    def register_sdm_api(cls, hass: HomeAssistant) -> None: ...
    def is_sdm_api(self) -> bool: ...
    @property
    def logger(self) -> logging.Logger: ...
    @property
    def extra_authorize_data(self) -> dict[str, str]: ...
    async def async_oauth_create_entry(self, data: dict[str, Any]) -> FlowResult: ...
    async def async_step_reauth(self, user_input: Union[dict[str, Any], None] = ...) -> FlowResult: ...
    async def async_step_reauth_confirm(self, user_input: Union[dict[str, Any], None] = ...) -> FlowResult: ...
    async def async_step_user(self, user_input: Union[dict[str, Any], None] = ...) -> FlowResult: ...
    flow_impl: Any
    async def async_step_init(self, user_input: Union[dict[str, Any], None] = ...) -> FlowResult: ...
    async def async_step_link(self, user_input: Union[dict[str, Any], None] = ...) -> FlowResult: ...
    async def async_step_import(self, info: dict[str, Any]) -> FlowResult: ...
    def _entry_from_tokens(self, title: str, flow: dict[str, Any], tokens: Union[list[Any], dict[Any, Any]]) -> FlowResult: ...
