# WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.2

import enum
import sys
import types
import typing
import uuid

import winsdk._winrt as _winrt

try:
    import winsdk.windows.foundation
except Exception:
    pass

try:
    import winsdk.windows.foundation.collections
except Exception:
    pass

class SystemUpdateAttentionRequiredReason(enum.IntEnum):
    NONE = 0
    NETWORK_REQUIRED = 1
    INSUFFICIENT_DISK_SPACE = 2
    INSUFFICIENT_BATTERY = 3
    UPDATE_BLOCKED = 4

class SystemUpdateItemState(enum.IntEnum):
    NOT_STARTED = 0
    INITIALIZING = 1
    PREPARING = 2
    CALCULATING = 3
    DOWNLOADING = 4
    INSTALLING = 5
    COMPLETED = 6
    REBOOT_REQUIRED = 7
    ERROR = 8

class SystemUpdateManagerState(enum.IntEnum):
    IDLE = 0
    DETECTING = 1
    READY_TO_DOWNLOAD = 2
    DOWNLOADING = 3
    READY_TO_INSTALL = 4
    INSTALLING = 5
    REBOOT_REQUIRED = 6
    READY_TO_FINALIZE = 7
    FINALIZING = 8
    COMPLETED = 9
    ATTENTION_REQUIRED = 10
    ERROR = 11

class SystemUpdateStartInstallAction(enum.IntEnum):
    UP_TO_REBOOT = 0
    ALLOW_REBOOT = 1

class SystemUpdateItem(_winrt.Object):
    description: str
    download_progress: _winrt.Double
    extended_error: winsdk.windows.foundation.HResult
    id: str
    install_progress: _winrt.Double
    revision: _winrt.UInt32
    state: SystemUpdateItemState
    title: str
    @staticmethod
    def _from(obj: _winrt.Object) -> SystemUpdateItem: ...

class SystemUpdateLastErrorInfo(_winrt.Object):
    extended_error: winsdk.windows.foundation.HResult
    is_interactive: _winrt.Boolean
    state: SystemUpdateManagerState
    @staticmethod
    def _from(obj: _winrt.Object) -> SystemUpdateLastErrorInfo: ...

class SystemUpdateManager(_winrt.Object):
    attention_required_reason: SystemUpdateAttentionRequiredReason
    download_progress: _winrt.Double
    extended_error: winsdk.windows.foundation.HResult
    install_progress: _winrt.Double
    last_error_info: SystemUpdateLastErrorInfo
    last_update_check_time: winsdk.windows.foundation.DateTime
    last_update_install_time: winsdk.windows.foundation.DateTime
    state: SystemUpdateManagerState
    user_active_hours_end: winsdk.windows.foundation.TimeSpan
    user_active_hours_max: _winrt.Int32
    user_active_hours_start: winsdk.windows.foundation.TimeSpan
    @staticmethod
    def _from(obj: _winrt.Object) -> SystemUpdateManager: ...
    @typing.overload
    @staticmethod
    def block_automatic_reboot_async(lock_id: str) -> winsdk.windows.foundation.IAsyncOperation[_winrt.Boolean]: ...
    @typing.overload
    @staticmethod
    def get_automatic_reboot_block_ids() -> winsdk.windows.foundation.collections.IVectorView[str]: ...
    @typing.overload
    @staticmethod
    def get_flight_ring() -> str: ...
    @typing.overload
    @staticmethod
    def get_update_items() -> winsdk.windows.foundation.collections.IVectorView[SystemUpdateItem]: ...
    @typing.overload
    @staticmethod
    def is_supported() -> _winrt.Boolean: ...
    @typing.overload
    @staticmethod
    def reboot_to_complete_install() -> None: ...
    @typing.overload
    @staticmethod
    def set_flight_ring(flight_ring: str) -> _winrt.Boolean: ...
    @typing.overload
    @staticmethod
    def start_cancel_updates() -> None: ...
    @typing.overload
    @staticmethod
    def start_install(action: SystemUpdateStartInstallAction) -> None: ...
    @typing.overload
    @staticmethod
    def try_set_user_active_hours(start: winsdk.windows.foundation.TimeSpan, end: winsdk.windows.foundation.TimeSpan) -> _winrt.Boolean: ...
    @typing.overload
    @staticmethod
    def unblock_automatic_reboot_async(lock_id: str) -> winsdk.windows.foundation.IAsyncOperation[_winrt.Boolean]: ...
    @typing.overload
    @staticmethod
    def add_state_changed(handler: winsdk.windows.foundation.EventHandler[_winrt.Object]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    @typing.overload
    @staticmethod
    def remove_state_changed(token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

