from . import permissions as perm_mdl
from .const import GROUP_ID_ADMIN as GROUP_ID_ADMIN
from datetime import datetime, timedelta
from homeassistant.const import __version__ as __version__
from typing import Any, NamedTuple

TOKEN_TYPE_NORMAL: str
TOKEN_TYPE_SYSTEM: str
TOKEN_TYPE_LONG_LIVED_ACCESS_TOKEN: str

class Group:
    name: Union[str, None] = ...
    policy: perm_mdl.PolicyType = ...
    id: str = ...
    system_generated: bool = ...
    def __init__(self, name: Any, policy: Any, id: Any, system_generated: Any) -> None: ...
    def __lt__(self, other: Any) -> Any: ...
    def __le__(self, other: Any) -> Any: ...
    def __gt__(self, other: Any) -> Any: ...
    def __ge__(self, other: Any) -> Any: ...

class User:
    name: Union[str, None] = ...
    perm_lookup: perm_mdl.PermissionLookup = ...
    id: str = ...
    is_owner: bool = ...
    is_active: bool = ...
    system_generated: bool = ...
    groups: list[Group] = ...
    credentials: list[Credentials] = ...
    refresh_tokens: dict[str, RefreshToken] = ...
    _permissions: Union[perm_mdl.PolicyPermissions, None] = ...
    @property
    def permissions(self) -> perm_mdl.AbstractPermissions: ...
    @property
    def is_admin(self) -> bool: ...
    def invalidate_permission_cache(self) -> None: ...
    def __init__(self, name: Any, perm_lookup: Any, id: Any, is_owner: Any, is_active: Any, system_generated: Any, groups: Any, credentials: Any, refresh_tokens: Any, permissions: Any) -> None: ...
    def __lt__(self, other: Any) -> Any: ...
    def __le__(self, other: Any) -> Any: ...
    def __gt__(self, other: Any) -> Any: ...
    def __ge__(self, other: Any) -> Any: ...

class RefreshToken:
    user: User = ...
    client_id: Union[str, None] = ...
    access_token_expiration: timedelta = ...
    client_name: Union[str, None] = ...
    client_icon: Union[str, None] = ...
    token_type: str = ...
    id: str = ...
    created_at: datetime = ...
    token: str = ...
    jwt_key: str = ...
    last_used_at: Union[datetime, None] = ...
    last_used_ip: Union[str, None] = ...
    credential: Union[Credentials, None] = ...
    version: Union[str, None] = ...
    def __init__(self, user: Any, client_id: Any, access_token_expiration: Any, client_name: Any, client_icon: Any, token_type: Any, id: Any, created_at: Any, token: Any, jwt_key: Any, last_used_at: Any, last_used_ip: Any, credential: Any, version: Any) -> None: ...
    def __lt__(self, other: Any) -> Any: ...
    def __le__(self, other: Any) -> Any: ...
    def __gt__(self, other: Any) -> Any: ...
    def __ge__(self, other: Any) -> Any: ...

class Credentials:
    auth_provider_type: str = ...
    auth_provider_id: Union[str, None] = ...
    data: dict = ...
    id: str = ...
    is_new: bool = ...
    def __init__(self, auth_provider_type: Any, auth_provider_id: Any, data: Any, id: Any, is_new: Any) -> None: ...
    def __lt__(self, other: Any) -> Any: ...
    def __le__(self, other: Any) -> Any: ...
    def __gt__(self, other: Any) -> Any: ...
    def __ge__(self, other: Any) -> Any: ...

class UserMeta(NamedTuple):
    name: Union[str, None]
    is_active: bool
