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

import enum
import datetime
import sys
import types
import typing

import winsdk.system
import winsdk.windows.foundation
import winsdk.windows.storage.streams

class DeviceAccessMode(enum.IntEnum):
    READ = 0
    WRITE = 1
    READ_WRITE = 2

class DeviceSharingMode(enum.IntEnum):
    SHARED = 0
    EXCLUSIVE = 1

class IOControlAccessMode(enum.IntEnum):
    ANY = 0
    READ = 1
    WRITE = 2
    READ_WRITE = 3

class IOControlBufferingMethod(enum.IntEnum):
    BUFFERED = 0
    DIRECT_INPUT = 1
    DIRECT_OUTPUT = 2
    NEITHER = 3

Self = typing.TypeVar('Self')

class CustomDevice(winsdk.system.Object):
    input_stream: typing.Optional[winsdk.windows.storage.streams.IInputStream]
    output_stream: typing.Optional[winsdk.windows.storage.streams.IOutputStream]
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> CustomDevice: ...
    @staticmethod
    def from_id_async(device_id: str, desired_access: DeviceAccessMode, sharing_mode: DeviceSharingMode, /) -> winsdk.windows.foundation.IAsyncOperation[CustomDevice]: ...
    @staticmethod
    def get_device_selector(class_guid: winsdk.system.Guid, /) -> str: ...
    def send_i_o_control_async(self, io_control_code: typing.Optional[IIOControlCode], input_buffer: typing.Optional[winsdk.windows.storage.streams.IBuffer], output_buffer: typing.Optional[winsdk.windows.storage.streams.IBuffer], /) -> winsdk.windows.foundation.IAsyncOperation[winsdk.system.UInt32]: ...
    def try_send_i_o_control_async(self, io_control_code: typing.Optional[IIOControlCode], input_buffer: typing.Optional[winsdk.windows.storage.streams.IBuffer], output_buffer: typing.Optional[winsdk.windows.storage.streams.IBuffer], /) -> winsdk.windows.foundation.IAsyncOperation[winsdk.system.Boolean]: ...

class IOControlCode(winsdk.system.Object):
    access_mode: IOControlAccessMode
    buffering_method: IOControlBufferingMethod
    control_code: winsdk.system.UInt32
    device_type: winsdk.system.UInt16
    function: winsdk.system.UInt16
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> IOControlCode: ...
    def __new__(cls: typing.Type[IOControlCode], device_type: winsdk.system.UInt16, function: winsdk.system.UInt16, access_mode: IOControlAccessMode, buffering_method: IOControlBufferingMethod) -> IOControlCode:...

class KnownDeviceTypes(winsdk.system.Object):
    unknown: typing.ClassVar[winsdk.system.UInt16]
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> KnownDeviceTypes: ...

class IIOControlCode(winsdk.system.Object):
    access_mode: IOControlAccessMode
    buffering_method: IOControlBufferingMethod
    control_code: winsdk.system.UInt32
    device_type: winsdk.system.UInt16
    function: winsdk.system.UInt16
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> IIOControlCode: ...

