# 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.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(_winrt.Object):
    input_stream: typing.Optional[winsdk.windows.storage.streams.IInputStream]
    output_stream: typing.Optional[winsdk.windows.storage.streams.IOutputStream]
    @staticmethod
    def _from(obj: _winrt.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: _winrt.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[_winrt.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[_winrt.Boolean]: ...

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

class KnownDeviceTypes(_winrt.Object):
    unknown: _winrt.UInt16
    @staticmethod
    def _from(obj: _winrt.Object) -> KnownDeviceTypes: ...

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

