# 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.foundation.collections
import winsdk.windows.networking
import winsdk.windows.storage.streams

class XboxLiveEndpointPairCreationBehaviors(enum.IntFlag):
    NONE = 0
    REEVALUATE_PATH = 0x1

class XboxLiveEndpointPairCreationStatus(enum.IntEnum):
    SUCCEEDED = 0
    NO_LOCAL_NETWORKS = 1
    NO_COMPATIBLE_NETWORK_PATHS = 2
    LOCAL_SYSTEM_NOT_AUTHORIZED = 3
    CANCELED = 4
    TIMED_OUT = 5
    REMOTE_SYSTEM_NOT_AUTHORIZED = 6
    REFUSED_DUE_TO_CONFIGURATION = 7
    UNEXPECTED_INTERNAL_ERROR = 8

class XboxLiveEndpointPairState(enum.IntEnum):
    INVALID = 0
    CREATING_OUTBOUND = 1
    CREATING_INBOUND = 2
    READY = 3
    DELETING_LOCALLY = 4
    REMOTE_ENDPOINT_TERMINATING = 5
    DELETED = 6

class XboxLiveNetworkAccessKind(enum.IntEnum):
    OPEN = 0
    MODERATE = 1
    STRICT = 2

class XboxLiveQualityOfServiceMeasurementStatus(enum.IntEnum):
    NOT_STARTED = 0
    IN_PROGRESS = 1
    IN_PROGRESS_WITH_PROVISIONAL_RESULTS = 2
    SUCCEEDED = 3
    NO_LOCAL_NETWORKS = 4
    NO_COMPATIBLE_NETWORK_PATHS = 5
    LOCAL_SYSTEM_NOT_AUTHORIZED = 6
    CANCELED = 7
    TIMED_OUT = 8
    REMOTE_SYSTEM_NOT_AUTHORIZED = 9
    REFUSED_DUE_TO_CONFIGURATION = 10
    UNEXPECTED_INTERNAL_ERROR = 11

class XboxLiveQualityOfServiceMetric(enum.IntEnum):
    AVERAGE_LATENCY_IN_MILLISECONDS = 0
    MIN_LATENCY_IN_MILLISECONDS = 1
    MAX_LATENCY_IN_MILLISECONDS = 2
    AVERAGE_OUTBOUND_BITS_PER_SECOND = 3
    MIN_OUTBOUND_BITS_PER_SECOND = 4
    MAX_OUTBOUND_BITS_PER_SECOND = 5
    AVERAGE_INBOUND_BITS_PER_SECOND = 6
    MIN_INBOUND_BITS_PER_SECOND = 7
    MAX_INBOUND_BITS_PER_SECOND = 8

class XboxLiveSocketKind(enum.IntEnum):
    NONE = 0
    DATAGRAM = 1
    STREAM = 2

Self = typing.TypeVar('Self')

class XboxLiveDeviceAddress(_winrt.Object):
    is_local: _winrt.Boolean
    is_valid: _winrt.Boolean
    network_access_kind: XboxLiveNetworkAccessKind
    max_snapshot_bytes_size: _winrt.UInt32
    @staticmethod
    def _from(obj: _winrt.Object) -> XboxLiveDeviceAddress: ...
    def compare(self, other_device_address: typing.Optional[XboxLiveDeviceAddress]) -> _winrt.Int32: ...
    @staticmethod
    def create_from_snapshot_base64(base64: str) -> typing.Optional[XboxLiveDeviceAddress]: ...
    @staticmethod
    def create_from_snapshot_buffer(buffer: typing.Optional[winsdk.windows.storage.streams.IBuffer]) -> typing.Optional[XboxLiveDeviceAddress]: ...
    @staticmethod
    def create_from_snapshot_bytes(buffer: typing.Sequence[_winrt.UInt8]) -> typing.Optional[XboxLiveDeviceAddress]: ...
    @staticmethod
    def get_local() -> typing.Optional[XboxLiveDeviceAddress]: ...
    def get_snapshot_as_base64(self) -> str: ...
    def get_snapshot_as_buffer(self) -> typing.Optional[winsdk.windows.storage.streams.IBuffer]: ...
    def get_snapshot_as_bytes(self, buffer_size: _winrt.UInt32) -> typing.Tuple[typing.List[_winrt.UInt8], _winrt.UInt32]: ...
    def add_snapshot_changed(self, handler: winsdk.windows.foundation.TypedEventHandler[XboxLiveDeviceAddress, _winrt.Object]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_snapshot_changed(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class XboxLiveEndpointPair(_winrt.Object):
    local_host_name: typing.Optional[winsdk.windows.networking.HostName]
    local_port: str
    remote_device_address: typing.Optional[XboxLiveDeviceAddress]
    remote_host_name: typing.Optional[winsdk.windows.networking.HostName]
    remote_port: str
    state: XboxLiveEndpointPairState
    template: typing.Optional[XboxLiveEndpointPairTemplate]
    @staticmethod
    def _from(obj: _winrt.Object) -> XboxLiveEndpointPair: ...
    def delete_async(self) -> typing.Optional[winsdk.windows.foundation.IAsyncAction]: ...
    @staticmethod
    def find_endpoint_pair_by_host_names_and_ports(local_host_name: typing.Optional[winsdk.windows.networking.HostName], local_port: str, remote_host_name: typing.Optional[winsdk.windows.networking.HostName], remote_port: str) -> typing.Optional[XboxLiveEndpointPair]: ...
    @staticmethod
    def find_endpoint_pair_by_socket_address_bytes(local_socket_address: typing.Sequence[_winrt.UInt8], remote_socket_address: typing.Sequence[_winrt.UInt8]) -> typing.Optional[XboxLiveEndpointPair]: ...
    def get_local_socket_address_bytes(self, socket_address_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    def get_remote_socket_address_bytes(self, socket_address_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    def add_state_changed(self, handler: winsdk.windows.foundation.TypedEventHandler[XboxLiveEndpointPair, XboxLiveEndpointPairStateChangedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_state_changed(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class XboxLiveEndpointPairCreationResult(_winrt.Object):
    device_address: typing.Optional[XboxLiveDeviceAddress]
    endpoint_pair: typing.Optional[XboxLiveEndpointPair]
    is_existing_path_evaluation: _winrt.Boolean
    status: XboxLiveEndpointPairCreationStatus
    @staticmethod
    def _from(obj: _winrt.Object) -> XboxLiveEndpointPairCreationResult: ...

class XboxLiveEndpointPairStateChangedEventArgs(_winrt.Object):
    new_state: XboxLiveEndpointPairState
    old_state: XboxLiveEndpointPairState
    @staticmethod
    def _from(obj: _winrt.Object) -> XboxLiveEndpointPairStateChangedEventArgs: ...

class XboxLiveEndpointPairTemplate(_winrt.Object):
    acceptor_bound_port_range_lower: _winrt.UInt16
    acceptor_bound_port_range_upper: _winrt.UInt16
    endpoint_pairs: typing.Optional[winsdk.windows.foundation.collections.IVectorView[XboxLiveEndpointPair]]
    initiator_bound_port_range_lower: _winrt.UInt16
    initiator_bound_port_range_upper: _winrt.UInt16
    name: str
    socket_kind: XboxLiveSocketKind
    templates: typing.Optional[winsdk.windows.foundation.collections.IVectorView[XboxLiveEndpointPairTemplate]]
    @staticmethod
    def _from(obj: _winrt.Object) -> XboxLiveEndpointPairTemplate: ...
    @typing.overload
    def create_endpoint_pair_async(self, device_address: typing.Optional[XboxLiveDeviceAddress]) -> winsdk.windows.foundation.IAsyncOperation[XboxLiveEndpointPairCreationResult]: ...
    @typing.overload
    def create_endpoint_pair_async(self, device_address: typing.Optional[XboxLiveDeviceAddress], behaviors: XboxLiveEndpointPairCreationBehaviors) -> winsdk.windows.foundation.IAsyncOperation[XboxLiveEndpointPairCreationResult]: ...
    @typing.overload
    def create_endpoint_pair_for_ports_async(self, device_address: typing.Optional[XboxLiveDeviceAddress], initiator_port: str, acceptor_port: str) -> winsdk.windows.foundation.IAsyncOperation[XboxLiveEndpointPairCreationResult]: ...
    @typing.overload
    def create_endpoint_pair_for_ports_async(self, device_address: typing.Optional[XboxLiveDeviceAddress], initiator_port: str, acceptor_port: str, behaviors: XboxLiveEndpointPairCreationBehaviors) -> winsdk.windows.foundation.IAsyncOperation[XboxLiveEndpointPairCreationResult]: ...
    @staticmethod
    def get_template_by_name(name: str) -> typing.Optional[XboxLiveEndpointPairTemplate]: ...
    def add_inbound_endpoint_pair_created(self, handler: winsdk.windows.foundation.TypedEventHandler[XboxLiveEndpointPairTemplate, XboxLiveInboundEndpointPairCreatedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_inbound_endpoint_pair_created(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class XboxLiveInboundEndpointPairCreatedEventArgs(_winrt.Object):
    endpoint_pair: typing.Optional[XboxLiveEndpointPair]
    @staticmethod
    def _from(obj: _winrt.Object) -> XboxLiveInboundEndpointPairCreatedEventArgs: ...

class XboxLiveQualityOfServiceMeasurement(_winrt.Object):
    timeout_in_milliseconds: _winrt.UInt32
    should_request_private_payloads: _winrt.Boolean
    number_of_probes_to_attempt: _winrt.UInt32
    device_addresses: typing.Optional[winsdk.windows.foundation.collections.IVector[XboxLiveDeviceAddress]]
    metric_results: typing.Optional[winsdk.windows.foundation.collections.IVectorView[XboxLiveQualityOfServiceMetricResult]]
    metrics: typing.Optional[winsdk.windows.foundation.collections.IVector[XboxLiveQualityOfServiceMetric]]
    number_of_results_pending: _winrt.UInt32
    private_payload_results: typing.Optional[winsdk.windows.foundation.collections.IVectorView[XboxLiveQualityOfServicePrivatePayloadResult]]
    published_private_payload: typing.Optional[winsdk.windows.storage.streams.IBuffer]
    max_simultaneous_probe_connections: _winrt.UInt32
    is_system_outbound_bandwidth_constrained: _winrt.Boolean
    is_system_inbound_bandwidth_constrained: _winrt.Boolean
    max_private_payload_size: _winrt.UInt32
    @staticmethod
    def _from(obj: _winrt.Object) -> XboxLiveQualityOfServiceMeasurement: ...
    def __new__(cls: typing.Type[XboxLiveQualityOfServiceMeasurement]) -> XboxLiveQualityOfServiceMeasurement:...
    @staticmethod
    def clear_private_payload() -> None: ...
    def get_metric_result(self, device_address: typing.Optional[XboxLiveDeviceAddress], metric: XboxLiveQualityOfServiceMetric) -> typing.Optional[XboxLiveQualityOfServiceMetricResult]: ...
    def get_metric_results_for_device(self, device_address: typing.Optional[XboxLiveDeviceAddress]) -> typing.Optional[winsdk.windows.foundation.collections.IVectorView[XboxLiveQualityOfServiceMetricResult]]: ...
    def get_metric_results_for_metric(self, metric: XboxLiveQualityOfServiceMetric) -> typing.Optional[winsdk.windows.foundation.collections.IVectorView[XboxLiveQualityOfServiceMetricResult]]: ...
    def get_private_payload_result(self, device_address: typing.Optional[XboxLiveDeviceAddress]) -> typing.Optional[XboxLiveQualityOfServicePrivatePayloadResult]: ...
    def measure_async(self) -> typing.Optional[winsdk.windows.foundation.IAsyncAction]: ...
    @staticmethod
    def publish_private_payload_bytes(payload: typing.Sequence[_winrt.UInt8]) -> None: ...

class XboxLiveQualityOfServiceMetricResult(_winrt.Object):
    device_address: typing.Optional[XboxLiveDeviceAddress]
    metric: XboxLiveQualityOfServiceMetric
    status: XboxLiveQualityOfServiceMeasurementStatus
    value: _winrt.UInt64
    @staticmethod
    def _from(obj: _winrt.Object) -> XboxLiveQualityOfServiceMetricResult: ...

class XboxLiveQualityOfServicePrivatePayloadResult(_winrt.Object):
    device_address: typing.Optional[XboxLiveDeviceAddress]
    status: XboxLiveQualityOfServiceMeasurementStatus
    value: typing.Optional[winsdk.windows.storage.streams.IBuffer]
    @staticmethod
    def _from(obj: _winrt.Object) -> XboxLiveQualityOfServicePrivatePayloadResult: ...

