# 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.storage
except Exception:
    pass

try:
    import winsdk.windows.storage.streams
except Exception:
    pass

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

class UserDataAvailability(enum.IntEnum):
    ALWAYS = 0
    AFTER_FIRST_UNLOCK = 1
    WHILE_UNLOCKED = 2

class UserDataBufferUnprotectStatus(enum.IntEnum):
    SUCCEEDED = 0
    UNAVAILABLE = 1

class UserDataStorageItemProtectionStatus(enum.IntEnum):
    SUCCEEDED = 0
    NOT_PROTECTABLE = 1
    DATA_UNAVAILABLE = 2

class UserDataAvailabilityStateChangedEventArgs(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> UserDataAvailabilityStateChangedEventArgs: ...
    @typing.overload
    def get_deferral(self) -> winsdk.windows.foundation.Deferral: ...

class UserDataBufferUnprotectResult(_winrt.Object):
    status: UserDataBufferUnprotectStatus
    unprotected_buffer: winsdk.windows.storage.streams.IBuffer
    @staticmethod
    def _from(obj: _winrt.Object) -> UserDataBufferUnprotectResult: ...

class UserDataProtectionManager(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> UserDataProtectionManager: ...
    @typing.overload
    def get_storage_item_protection_info_async(self, storage_item: winsdk.windows.storage.IStorageItem) -> winsdk.windows.foundation.IAsyncOperation[UserDataStorageItemProtectionInfo]: ...
    @typing.overload
    def is_continued_data_availability_expected(self, availability: UserDataAvailability) -> _winrt.Boolean: ...
    @typing.overload
    def protect_buffer_async(self, unprotected_buffer: winsdk.windows.storage.streams.IBuffer, availability: UserDataAvailability) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.storage.streams.IBuffer]: ...
    @typing.overload
    def protect_storage_item_async(self, storage_item: winsdk.windows.storage.IStorageItem, availability: UserDataAvailability) -> winsdk.windows.foundation.IAsyncOperation[UserDataStorageItemProtectionStatus]: ...
    @typing.overload
    @staticmethod
    def try_get_default() -> UserDataProtectionManager: ...
    @typing.overload
    @staticmethod
    def try_get_for_user(user: winsdk.windows.system.User) -> UserDataProtectionManager: ...
    @typing.overload
    def unprotect_buffer_async(self, protected_buffer: winsdk.windows.storage.streams.IBuffer) -> winsdk.windows.foundation.IAsyncOperation[UserDataBufferUnprotectResult]: ...
    @typing.overload
    def add_data_availability_state_changed(self, handler: winsdk.windows.foundation.TypedEventHandler[UserDataProtectionManager, UserDataAvailabilityStateChangedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    @typing.overload
    def remove_data_availability_state_changed(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class UserDataStorageItemProtectionInfo(_winrt.Object):
    availability: UserDataAvailability
    @staticmethod
    def _from(obj: _winrt.Object) -> UserDataStorageItemProtectionInfo: ...

