# WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.9

import enum
import datetime
import sys
import types
import typing

import winsdk.system
import winsdk.windows.foundation
import winsdk.windows.foundation.collections
import winsdk.windows.networking.sockets
import winsdk.windows.security.credentials
import winsdk.windows.security.cryptography.certificates
import winsdk.windows.system
import winsdk.windows.web.http

class HttpCacheReadBehavior(enum.IntEnum):
    DEFAULT = 0
    MOST_RECENT = 1
    ONLY_FROM_CACHE = 2
    NO_CACHE = 3

class HttpCacheWriteBehavior(enum.IntEnum):
    DEFAULT = 0
    NO_CACHE = 1

class HttpCookieUsageBehavior(enum.IntEnum):
    DEFAULT = 0
    NO_COOKIES = 1

Self = typing.TypeVar('Self')

class HttpBaseProtocolFilter(winsdk.system.Object):
    use_proxy: winsdk.system.Boolean
    server_credential: typing.Optional[winsdk.windows.security.credentials.PasswordCredential]
    proxy_credential: typing.Optional[winsdk.windows.security.credentials.PasswordCredential]
    max_connections_per_server: winsdk.system.UInt32
    client_certificate: typing.Optional[winsdk.windows.security.cryptography.certificates.Certificate]
    automatic_decompression: winsdk.system.Boolean
    allow_u_i: winsdk.system.Boolean
    allow_auto_redirect: winsdk.system.Boolean
    cache_control: typing.Optional[HttpCacheControl]
    cookie_manager: typing.Optional[winsdk.windows.web.http.HttpCookieManager]
    ignorable_server_certificate_errors: typing.Optional[winsdk.windows.foundation.collections.IVector[winsdk.windows.security.cryptography.certificates.ChainValidationResult]]
    max_version: winsdk.windows.web.http.HttpVersion
    cookie_usage_behavior: HttpCookieUsageBehavior
    user: typing.Optional[winsdk.windows.system.User]
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, *args) -> None: ...
    @staticmethod
    def _from(obj: winsdk.system.Object) -> HttpBaseProtocolFilter: ...
    def __new__(cls: typing.Type[HttpBaseProtocolFilter]) -> HttpBaseProtocolFilter:...
    def clear_authentication_cache(self) -> None: ...
    def close(self) -> None: ...
    @staticmethod
    def create_for_user(user: typing.Optional[winsdk.windows.system.User]) -> typing.Optional[HttpBaseProtocolFilter]: ...
    def send_request_async(self, request: typing.Optional[winsdk.windows.web.http.HttpRequestMessage]) -> winsdk.windows.foundation.IAsyncOperationWithProgress[winsdk.windows.web.http.HttpResponseMessage, winsdk.windows.web.http.HttpProgress]: ...
    def add_server_custom_validation_requested(self, handler: winsdk.windows.foundation.TypedEventHandler[HttpBaseProtocolFilter, HttpServerCustomValidationRequestedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_server_custom_validation_requested(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class HttpCacheControl(winsdk.system.Object):
    write_behavior: HttpCacheWriteBehavior
    read_behavior: HttpCacheReadBehavior
    @staticmethod
    def _from(obj: winsdk.system.Object) -> HttpCacheControl: ...

class HttpServerCustomValidationRequestedEventArgs(winsdk.system.Object):
    request_message: typing.Optional[winsdk.windows.web.http.HttpRequestMessage]
    server_certificate: typing.Optional[winsdk.windows.security.cryptography.certificates.Certificate]
    server_certificate_error_severity: winsdk.windows.networking.sockets.SocketSslErrorSeverity
    server_certificate_errors: typing.Optional[winsdk.windows.foundation.collections.IVectorView[winsdk.windows.security.cryptography.certificates.ChainValidationResult]]
    server_intermediate_certificates: typing.Optional[winsdk.windows.foundation.collections.IVectorView[winsdk.windows.security.cryptography.certificates.Certificate]]
    @staticmethod
    def _from(obj: winsdk.system.Object) -> HttpServerCustomValidationRequestedEventArgs: ...
    def get_deferral(self) -> typing.Optional[winsdk.windows.foundation.Deferral]: ...
    def reject(self) -> None: ...

class IHttpFilter(winsdk.system.Object):
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, *args) -> None: ...
    @staticmethod
    def _from(obj: winsdk.system.Object) -> IHttpFilter: ...
    def close(self) -> None: ...
    def send_request_async(self, request: typing.Optional[winsdk.windows.web.http.HttpRequestMessage]) -> winsdk.windows.foundation.IAsyncOperationWithProgress[winsdk.windows.web.http.HttpResponseMessage, winsdk.windows.web.http.HttpProgress]: ...

