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

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

try:
    import winsdk.windows.networking.connectivity
except Exception:
    pass

try:
    import winsdk.windows.networking.sockets
except Exception:
    pass

class DnssdRegistrationStatus(enum.IntEnum):
    SUCCESS = 0
    INVALID_SERVICE_NAME = 1
    SERVER_ERROR = 2
    SECURITY_ERROR = 3

class DnssdServiceWatcherStatus(enum.IntEnum):
    CREATED = 0
    STARTED = 1
    ENUMERATION_COMPLETED = 2
    STOPPING = 3
    STOPPED = 4
    ABORTED = 5

class DnssdRegistrationResult(winsdk.windows.foundation.IStringable, _winrt.Object):
    has_instance_name_changed: _winrt.Boolean
    ip_address: winsdk.windows.networking.HostName
    status: DnssdRegistrationStatus
    @staticmethod
    def _from(obj: _winrt.Object) -> DnssdRegistrationResult: ...
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def to_string(self) -> str: ...

class DnssdServiceInstance(winsdk.windows.foundation.IStringable, _winrt.Object):
    weight: _winrt.UInt16
    priority: _winrt.UInt16
    port: _winrt.UInt16
    host_name: winsdk.windows.networking.HostName
    dnssd_service_instance_name: str
    text_attributes: winsdk.windows.foundation.collections.IMap[str, str]
    @staticmethod
    def _from(obj: _winrt.Object) -> DnssdServiceInstance: ...
    @typing.overload
    def __init__(self, dnssd_service_instance_name: str, host_name: winsdk.windows.networking.HostName, port: _winrt.UInt16) -> None: ...
    @typing.overload
    def register_datagram_socket_async(self, socket: winsdk.windows.networking.sockets.DatagramSocket) -> winsdk.windows.foundation.IAsyncOperation[DnssdRegistrationResult]: ...
    @typing.overload
    def register_datagram_socket_async(self, socket: winsdk.windows.networking.sockets.DatagramSocket, adapter: winsdk.windows.networking.connectivity.NetworkAdapter) -> winsdk.windows.foundation.IAsyncOperation[DnssdRegistrationResult]: ...
    @typing.overload
    def register_stream_socket_listener_async(self, socket: winsdk.windows.networking.sockets.StreamSocketListener) -> winsdk.windows.foundation.IAsyncOperation[DnssdRegistrationResult]: ...
    @typing.overload
    def register_stream_socket_listener_async(self, socket: winsdk.windows.networking.sockets.StreamSocketListener, adapter: winsdk.windows.networking.connectivity.NetworkAdapter) -> winsdk.windows.foundation.IAsyncOperation[DnssdRegistrationResult]: ...
    @typing.overload
    def to_string(self) -> str: ...

class DnssdServiceInstanceCollection(winsdk.windows.foundation.collections.IVectorView[DnssdServiceInstance], winsdk.windows.foundation.collections.IIterable[DnssdServiceInstance], _winrt.Object):
    size: _winrt.UInt32
    @staticmethod
    def _from(obj: _winrt.Object) -> DnssdServiceInstanceCollection: ...
    @typing.overload
    def first(self) -> winsdk.windows.foundation.collections.IIterator[DnssdServiceInstance]: ...
    @typing.overload
    def get_at(self, index: _winrt.UInt32) -> DnssdServiceInstance: ...
    @typing.overload
    def get_many(self, start_index: _winrt.UInt32, items_size: _winrt.UInt32) -> typing.Tuple[_winrt.UInt32, typing.List[DnssdServiceInstance]]: ...
    @typing.overload
    def index_of(self, value: DnssdServiceInstance) -> typing.Tuple[_winrt.Boolean, _winrt.UInt32]: ...

class DnssdServiceWatcher(_winrt.Object):
    status: DnssdServiceWatcherStatus
    @staticmethod
    def _from(obj: _winrt.Object) -> DnssdServiceWatcher: ...
    @typing.overload
    def start(self) -> None: ...
    @typing.overload
    def stop(self) -> None: ...
    @typing.overload
    def add_added(self, handler: winsdk.windows.foundation.TypedEventHandler[DnssdServiceWatcher, DnssdServiceInstance]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    @typing.overload
    def remove_added(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...
    @typing.overload
    def add_enumeration_completed(self, handler: winsdk.windows.foundation.TypedEventHandler[DnssdServiceWatcher, _winrt.Object]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    @typing.overload
    def remove_enumeration_completed(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...
    @typing.overload
    def add_stopped(self, handler: winsdk.windows.foundation.TypedEventHandler[DnssdServiceWatcher, _winrt.Object]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    @typing.overload
    def remove_stopped(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

