# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from typing import Callable
from enum import Enum

# Public interface file for the pymsalruntime

class Response_Status(Enum):
    Status_Unexpected: int
    Status_Reserved: int
    Status_InteractionRequired: int
    Status_NoNetwork: int
    Status_NetworkTemporarilyUnavailable: int
    Status_ServerTemporarilyUnavailable: int
    Status_ApiContractViolation: int
    Status_UserCanceled: int
    Status_ApplicationCanceled: int
    Status_IncorrectConfiguration: int
    Status_InsufficientBuffer: int
    Status_AuthorityUntrusted: int
    Status_UserSwitch: int
    Status_AccountUnusable: int
    Status_UserDataRemovalRequired: int
    Status_KeyNotFound: int
    Status_AccountNotFound: int
    Status_TransientError: int
    Status_AccountSwitch: int
    Status_RequiredBrokerMissing: int
    Status_DeviceNotRegistered: int
    Status_FallbackToNativeMsal: int

class LogLevel(Enum):
    TRACE: int
    DEBUG: int
    INFO: int
    WARNING: int
    ERROR: int
    FATAL: int

class SsoPolicyType(Enum):
    Unknown: int
    PermissionRequired: int
    AlwaysAllowed: int
    Error: int

class MSALRuntimeLogCallbackHandle:
    def release_logging_callback(self) -> None: ...

class MSALRuntimeAsyncHandle:
    def cancel_async_operation(self) -> None: ...

class MSALRuntimeError:
    def get_status(self) -> str: ...
    def get_error_code(self) -> int: ...
    def get_tag(self) -> int: ...
    def get_context(self) -> str: ...

class MSALRuntimeAccount:
    def get_account_id(self) -> str: ...
    def get_home_account_id(self) -> str: ...
    def get_environment(self) -> str: ...
    def get_realm(self) -> str: ...
    def get_local_account_id(self) -> str: ...
    def get_user_name(self) -> str: ...
    def get_given_name(self) -> str: ...
    def get_family_name(self) -> str: ...
    def get_middle_name(self) -> str: ...
    def get_display_name(self) -> str: ...
    def get_additional_fields_json(self) -> str: ...
    def get_home_environment(self) -> str: ...
    def get_client_info(self) -> str: ...

class MSALRuntimeAuthParameters:
    def set_requested_scopes(self, scopes: list[str]) -> None: ...
    def set_redirect_uri(self, redirect_uri: str) -> None: ...
    def set_decoded_claims(self, claims: str) -> None: ...
    def set_access_token_to_renew(self, access_token: str) -> None: ...
    def set_pop_params(self, http_method: str, uri_host: str, uri_path: str, nonce: str) -> None: ...
    def set_additional_parameter(self, key: str, value: str) -> None: ...

class MSALRuntimeAuthResult:
    def get_account(self) -> MSALRuntimeAccount: ...
    def get_id_token(self) -> str: ...
    def get_raw_id_token(self) -> str: ...
    def get_access_token(self) -> str: ...
    def get_granted_scopes(self) -> list[str]: ...
    def get_authorization_header(self) -> str: ...
    def is_pop_authorization(self) -> bool: ...
    def get_access_token_expiry_time(self) -> int: ...
    def get_error(self) -> MSALRuntimeError: ...
    def get_telemetry_data(self) -> dict[str, str]: ...

class MSALRuntimeSignOutResult:
    def get_error(self) -> MSALRuntimeError: ...
    def get_telemetry_data(self) -> dict[str, str]: ...

class MSALRuntimeReadAccountResult:
    def get_account(self) -> MSALRuntimeAccount: ...
    def get_error(self) -> MSALRuntimeError: ...
    def get_telemetry_data(self) -> dict[str, str]: ...

class MSALRuntimeDiscoverAccountsResult:
    def get_accounts(self) -> list[MSALRuntimeAccount]: ...
    def get_error(self) -> MSALRuntimeError: ...
    def get_telemetry_data(self) -> dict[str, str]: ...

def read_account_by_id(
    accountid: str,
    correlationId: str,
    callback: Callable[[MSALRuntimeReadAccountResult], None],
) -> MSALRuntimeAsyncHandle: ...
def signin(
    parentWindowHandle: int,
    auth_params: MSALRuntimeAuthParameters,
    correlationId: str,
    accountHint: str,
    callback: Callable[[MSALRuntimeAuthResult], None],
) -> MSALRuntimeAsyncHandle: ...
def signin_silently(
    auth_params: MSALRuntimeAuthParameters,
    correlationId: str,
    callback: Callable[[MSALRuntimeAuthResult], None],
) -> MSALRuntimeAsyncHandle: ...
def signin_interactively(
    parentWindowHandle: int,
    auth_params: MSALRuntimeAuthParameters,
    correlationId: str,
    accountHint: str,
    callback: Callable[[MSALRuntimeAuthResult], None],
) -> MSALRuntimeAsyncHandle: ...
def signout_silently(
    clientId: str,
    correlationId: str,
    account: MSALRuntimeAccount,
    callback: Callable[[MSALRuntimeSignOutResult], None],
) -> MSALRuntimeAsyncHandle: ...
def discover_accounts(
    clientId: str,
    correlationId: str,
    callback: Callable[[MSALRuntimeDiscoverAccountsResult], None],
) -> MSALRuntimeAsyncHandle: ...
def acquire_token_silently(
    auth_params: MSALRuntimeAuthParameters,
    correlationId: str,
    account: MSALRuntimeAccount,
    callback: Callable[[MSALRuntimeAuthResult], None],
) -> MSALRuntimeAsyncHandle: ...
def acquire_token_interactively(
    parentWindowHandle: int,
    auth_params: MSALRuntimeAuthParameters,
    correlationId: str,
    account: MSALRuntimeAccount,
    callback: Callable[[MSALRuntimeAuthResult], None],
) -> MSALRuntimeAsyncHandle: ...
def register_logging_callback(
    callback: Callable[[str, LogLevel], None],
) -> MSALRuntimeLogCallbackHandle: ...
def set_is_pii_enabled(enabled: int) -> None: ...
def get_console_window() -> int: ...
def get_desktop_window() -> int: ...
def get_sso_policy() -> int: ...
