# 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.system.diagnostics
import winsdk.windows.web.http

class HttpDiagnosticRequestInitiator(enum.IntEnum):
    PARSED_ELEMENT = 0
    SCRIPT = 1
    IMAGE = 2
    LINK = 3
    STYLE = 4
    XML_HTTP_REQUEST = 5
    MEDIA = 6
    HTML_DOWNLOAD = 7
    PREFETCH = 8
    OTHER = 9
    CROSS_ORIGIN_PRE_FLIGHT = 10
    FETCH = 11
    BEACON = 12

Self = typing.TypeVar('Self')

class HttpDiagnosticProvider(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> HttpDiagnosticProvider: ...
    @staticmethod
    def create_from_process_diagnostic_info(process_diagnostic_info: typing.Optional[winsdk.windows.system.diagnostics.ProcessDiagnosticInfo]) -> typing.Optional[HttpDiagnosticProvider]: ...
    def start(self) -> None: ...
    def stop(self) -> None: ...
    def add_request_response_completed(self, handler: winsdk.windows.foundation.TypedEventHandler[HttpDiagnosticProvider, HttpDiagnosticProviderRequestResponseCompletedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_request_response_completed(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...
    def add_request_sent(self, handler: winsdk.windows.foundation.TypedEventHandler[HttpDiagnosticProvider, HttpDiagnosticProviderRequestSentEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_request_sent(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...
    def add_response_received(self, handler: winsdk.windows.foundation.TypedEventHandler[HttpDiagnosticProvider, HttpDiagnosticProviderResponseReceivedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_response_received(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class HttpDiagnosticProviderRequestResponseCompletedEventArgs(_winrt.Object):
    activity_id: _winrt.Guid
    initiator: HttpDiagnosticRequestInitiator
    process_id: _winrt.UInt32
    requested_uri: typing.Optional[winsdk.windows.foundation.Uri]
    source_locations: typing.Optional[winsdk.windows.foundation.collections.IVectorView[HttpDiagnosticSourceLocation]]
    thread_id: _winrt.UInt32
    timestamps: typing.Optional[HttpDiagnosticProviderRequestResponseTimestamps]
    @staticmethod
    def _from(obj: _winrt.Object) -> HttpDiagnosticProviderRequestResponseCompletedEventArgs: ...

class HttpDiagnosticProviderRequestResponseTimestamps(_winrt.Object):
    cache_checked_timestamp: typing.Optional[typing.Optional[datetime.datetime]]
    connection_completed_timestamp: typing.Optional[typing.Optional[datetime.datetime]]
    connection_initiated_timestamp: typing.Optional[typing.Optional[datetime.datetime]]
    name_resolved_timestamp: typing.Optional[typing.Optional[datetime.datetime]]
    request_completed_timestamp: typing.Optional[typing.Optional[datetime.datetime]]
    request_sent_timestamp: typing.Optional[typing.Optional[datetime.datetime]]
    response_completed_timestamp: typing.Optional[typing.Optional[datetime.datetime]]
    response_received_timestamp: typing.Optional[typing.Optional[datetime.datetime]]
    ssl_negotiated_timestamp: typing.Optional[typing.Optional[datetime.datetime]]
    @staticmethod
    def _from(obj: _winrt.Object) -> HttpDiagnosticProviderRequestResponseTimestamps: ...

class HttpDiagnosticProviderRequestSentEventArgs(_winrt.Object):
    activity_id: _winrt.Guid
    initiator: HttpDiagnosticRequestInitiator
    message: typing.Optional[winsdk.windows.web.http.HttpRequestMessage]
    process_id: _winrt.UInt32
    source_locations: typing.Optional[winsdk.windows.foundation.collections.IVectorView[HttpDiagnosticSourceLocation]]
    thread_id: _winrt.UInt32
    timestamp: datetime.datetime
    @staticmethod
    def _from(obj: _winrt.Object) -> HttpDiagnosticProviderRequestSentEventArgs: ...

class HttpDiagnosticProviderResponseReceivedEventArgs(_winrt.Object):
    activity_id: _winrt.Guid
    message: typing.Optional[winsdk.windows.web.http.HttpResponseMessage]
    timestamp: datetime.datetime
    @staticmethod
    def _from(obj: _winrt.Object) -> HttpDiagnosticProviderResponseReceivedEventArgs: ...

class HttpDiagnosticSourceLocation(_winrt.Object):
    column_number: _winrt.UInt64
    line_number: _winrt.UInt64
    source_uri: typing.Optional[winsdk.windows.foundation.Uri]
    @staticmethod
    def _from(obj: _winrt.Object) -> HttpDiagnosticSourceLocation: ...

