# WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1

import datetime
import sys
import types
import typing
import uuid as _uuid
from builtins import property as _property

import winrt._winrt
import winrt.system
import winrt.windows.applicationmodel.appservice
import winrt.windows.foundation
import winrt.windows.foundation.collections
import winrt.windows.networking.sockets
import winrt.windows.web.http

from winrt.windows.system.diagnostics.deviceportal import DevicePortalConnectionClosedReason

Self = typing.TypeVar('Self')

@typing.final
class DevicePortalConnection_Static(type):
    def get_for_app_service_connection(cls, app_service_connection: typing.Optional[winrt.windows.applicationmodel.appservice.AppServiceConnection], /) -> typing.Optional[DevicePortalConnection]: ...

@typing.final
class DevicePortalConnection(winrt.system.Object, metaclass=DevicePortalConnection_Static):
    @staticmethod
    def _from(obj: winrt.system.Object, /) -> DevicePortalConnection: ...
    @typing.overload
    def get_server_message_web_socket_for_request(self, request: typing.Optional[winrt.windows.web.http.HttpRequestMessage], /) -> typing.Optional[winrt.windows.networking.sockets.ServerMessageWebSocket]: ...
    @typing.overload
    def get_server_message_web_socket_for_request(self, request: typing.Optional[winrt.windows.web.http.HttpRequestMessage], message_type: winrt.windows.networking.sockets.SocketMessageType, protocol: str, /) -> typing.Optional[winrt.windows.networking.sockets.ServerMessageWebSocket]: ...
    @typing.overload
    def get_server_message_web_socket_for_request(self, request: typing.Optional[winrt.windows.web.http.HttpRequestMessage], message_type: winrt.windows.networking.sockets.SocketMessageType, protocol: str, outbound_buffer_size_in_bytes: winrt.system.UInt32, max_message_size: winrt.system.UInt32, receive_mode: winrt.windows.networking.sockets.MessageWebSocketReceiveMode, /) -> typing.Optional[winrt.windows.networking.sockets.ServerMessageWebSocket]: ...
    @typing.overload
    def get_server_stream_web_socket_for_request(self, request: typing.Optional[winrt.windows.web.http.HttpRequestMessage], /) -> typing.Optional[winrt.windows.networking.sockets.ServerStreamWebSocket]: ...
    @typing.overload
    def get_server_stream_web_socket_for_request(self, request: typing.Optional[winrt.windows.web.http.HttpRequestMessage], protocol: str, outbound_buffer_size_in_bytes: winrt.system.UInt32, no_delay: bool, /) -> typing.Optional[winrt.windows.networking.sockets.ServerStreamWebSocket]: ...
    def add_closed(self, handler: winrt.windows.foundation.TypedEventHandler[DevicePortalConnection, DevicePortalConnectionClosedEventArgs], /) -> winrt.windows.foundation.EventRegistrationToken: ...
    def remove_closed(self, token: winrt.windows.foundation.EventRegistrationToken, /) -> None: ...
    def add_request_received(self, handler: winrt.windows.foundation.TypedEventHandler[DevicePortalConnection, DevicePortalConnectionRequestReceivedEventArgs], /) -> winrt.windows.foundation.EventRegistrationToken: ...
    def remove_request_received(self, token: winrt.windows.foundation.EventRegistrationToken, /) -> None: ...

@typing.final
class DevicePortalConnectionClosedEventArgs(winrt.system.Object):
    @staticmethod
    def _from(obj: winrt.system.Object, /) -> DevicePortalConnectionClosedEventArgs: ...
    @_property
    def reason(self) -> DevicePortalConnectionClosedReason: ...

@typing.final
class DevicePortalConnectionRequestReceivedEventArgs(winrt.system.Object):
    @staticmethod
    def _from(obj: winrt.system.Object, /) -> DevicePortalConnectionRequestReceivedEventArgs: ...
    def get_deferral(self) -> typing.Optional[winrt.windows.foundation.Deferral]: ...
    @_property
    def request_message(self) -> typing.Optional[winrt.windows.web.http.HttpRequestMessage]: ...
    @_property
    def response_message(self) -> typing.Optional[winrt.windows.web.http.HttpResponseMessage]: ...
    @_property
    def is_web_socket_upgrade_request(self) -> bool: ...
    @_property
    def web_socket_protocols_requested(self) -> typing.Optional[winrt.windows.foundation.collections.IVectorView[str]]: ...

