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

import enum
import datetime
import sys
import types
import typing

import winsdk._winrt as _winrt
import winsdk.windows.foundation
import winsdk.windows.foundation.collections

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

Self = typing.TypeVar('Self')

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: typing.Optional[SystemUpdateLastErrorInfo]
    last_update_check_time: datetime.datetime
    last_update_install_time: datetime.datetime
    state: SystemUpdateManagerState
    user_active_hours_end: datetime.timedelta
    user_active_hours_max: _winrt.Int32
    user_active_hours_start: datetime.timedelta
    @staticmethod
    def _from(obj: _winrt.Object) -> SystemUpdateManager: ...
    @staticmethod
    def block_automatic_reboot_async(lock_id: str) -> winsdk.windows.foundation.IAsyncOperation[_winrt.Boolean]: ...
    @staticmethod
    def get_automatic_reboot_block_ids() -> typing.Optional[winsdk.windows.foundation.collections.IVectorView[str]]: ...
    @staticmethod
    def get_flight_ring() -> str: ...
    @staticmethod
    def get_update_items() -> typing.Optional[winsdk.windows.foundation.collections.IVectorView[SystemUpdateItem]]: ...
    @staticmethod
    def is_supported() -> _winrt.Boolean: ...
    @staticmethod
    def reboot_to_complete_install() -> None: ...
    @staticmethod
    def set_flight_ring(flight_ring: str) -> _winrt.Boolean: ...
    @staticmethod
    def start_cancel_updates() -> None: ...
    @staticmethod
    def start_install(action: SystemUpdateStartInstallAction) -> None: ...
    @staticmethod
    def try_set_user_active_hours(start: datetime.timedelta, end: datetime.timedelta) -> _winrt.Boolean: ...
    @staticmethod
    def unblock_automatic_reboot_async(lock_id: str) -> winsdk.windows.foundation.IAsyncOperation[_winrt.Boolean]: ...
    @staticmethod
    def add_state_changed(handler: winsdk.windows.foundation.EventHandler[_winrt.Object]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    @staticmethod
    def remove_state_changed(token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

