import typing, abc
from System.IO import FileInfo
from System.ComponentModel import INotifyPropertyChanged
from System import Guid, Array_1, ValueTuple_2
from System.Security import SecureString
from System.Collections.ObjectModel import ObservableCollection_1

class IAuthenticationService(typing.Protocol):
    @abc.abstractmethod
    def Authenticate(self, userManager: SimUsersManager, projectFile: FileInfo) -> SimUser: ...


class SimUser(INotifyPropertyChanged):
    def __init__(self, id: Guid, name: str, passwordHash: Array_1[int], encryptedEncryptionKey: Array_1[int], role: SimUserRole) -> None: ...
    @classmethod
    @property
    def DefaultUser(cls) -> SimUser: ...
    @classmethod
    @property
    def DefaultUserPassword(cls) -> SecureString: ...
    @property
    def EncryptedEncryptionKey(self) -> Array_1[int]: ...
    @EncryptedEncryptionKey.setter
    def EncryptedEncryptionKey(self, value: Array_1[int]) -> Array_1[int]: ...
    @property
    def Id(self) -> Guid: ...
    @Id.setter
    def Id(self, value: Guid) -> Guid: ...
    @property
    def Name(self) -> str: ...
    @Name.setter
    def Name(self, value: str) -> str: ...
    @property
    def PasswordHash(self) -> Array_1[int]: ...
    @PasswordHash.setter
    def PasswordHash(self, value: Array_1[int]) -> Array_1[int]: ...
    @property
    def Role(self) -> SimUserRole: ...
    @Role.setter
    def Role(self, value: SimUserRole) -> SimUserRole: ...


class SimUserRole(typing.SupportsInt):
    @typing.overload
    def __init__(self, value : int) -> None: ...
    @typing.overload
    def __init__(self, value : int, force_if_true: bool) -> None: ...
    def __int__(self) -> int: ...
    
    # Values:
    ADMINISTRATOR : SimUserRole # 0
    MODERATOR : SimUserRole # 1
    ENERGY_NETWORK_OPERATOR : SimUserRole # 2
    ENERGY_SUPPLIER : SimUserRole # 3
    BUILDING_DEVELOPER : SimUserRole # 4
    BUILDING_OPERATOR : SimUserRole # 5
    ARCHITECTURE : SimUserRole # 6
    FIRE_SAFETY : SimUserRole # 7
    BUILDING_PHYSICS : SimUserRole # 8
    MEP_HVAC : SimUserRole # 9
    PROCESS_MEASURING_CONTROL : SimUserRole # 10
    BUILDING_CONTRACTOR : SimUserRole # 11
    GUEST : SimUserRole # 12


class SimUsersManager(INotifyPropertyChanged):
    def __init__(self) -> None: ...
    @property
    def CurrentUser(self) -> SimUser: ...
    @CurrentUser.setter
    def CurrentUser(self, value: SimUser) -> SimUser: ...
    @property
    def EncryptionKey(self) -> Array_1[int]: ...
    @EncryptionKey.setter
    def EncryptionKey(self, value: Array_1[int]) -> Array_1[int]: ...
    @property
    def Users(self) -> ObservableCollection_1[SimUser]: ...
    @Users.setter
    def Users(self, value: ObservableCollection_1[SimUser]) -> ObservableCollection_1[SimUser]: ...
    def Clear(self) -> None: ...
    @staticmethod
    def DecryptEncryptionKey(encryptedKey: Array_1[int], password: Array_1[int]) -> Array_1[int]: ...
    def DecryptUserSecret(self, encryptedSecret: str) -> ValueTuple_2[str, bool]: ...
    def EncryptUserSecret(self, secret: str) -> str: ...
    # Skipped Authenticate due to it being static, abstract and generic.

    Authenticate : Authenticate_MethodGroup
    class Authenticate_MethodGroup:
        @typing.overload
        def __call__(self, name: str, password: SecureString) -> ValueTuple_2[SimUser, Array_1[int]]:...
        @typing.overload
        def __call__(self, user: SimUser, password: SecureString) -> bool:...
        @typing.overload
        def __call__(self, name: str, password: Array_1[int], isHashedPassword: bool = ...) -> SimUser:...
        @typing.overload
        def __call__(self, user: SimUser, password: Array_1[int], isHashedPassword: bool = ...) -> bool:...

    # Skipped EncryptEncryptionKey due to it being static, abstract and generic.

    EncryptEncryptionKey : EncryptEncryptionKey_MethodGroup
    class EncryptEncryptionKey_MethodGroup:
        @typing.overload
        def __call__(self, unencryptedKey: Array_1[int], password: Array_1[int]) -> Array_1[int]:...
        @typing.overload
        def __call__(self, unencryptedKey: Array_1[int], password: SecureString) -> Array_1[int]:...

    # Skipped HashPassword due to it being static, abstract and generic.

    HashPassword : HashPassword_MethodGroup
    class HashPassword_MethodGroup:
        @typing.overload
        def __call__(self, password: Array_1[int]) -> Array_1[int]:...
        @typing.overload
        def __call__(self, password: SecureString) -> Array_1[int]:...


