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

import enum
import datetime
import sys
import types
import typing

import winsdk.system
import winsdk.windows.applicationmodel
import winsdk.windows.foundation
import winsdk.windows.foundation.collections
import winsdk.windows.system
import winsdk.windows.system.remotesystems

class AppServiceClosedStatus(enum.IntEnum):
    COMPLETED = 0
    CANCELED = 1
    RESOURCE_LIMITS_EXCEEDED = 2
    UNKNOWN = 3

class AppServiceConnectionStatus(enum.IntEnum):
    SUCCESS = 0
    APP_NOT_INSTALLED = 1
    APP_UNAVAILABLE = 2
    APP_SERVICE_UNAVAILABLE = 3
    UNKNOWN = 4
    REMOTE_SYSTEM_UNAVAILABLE = 5
    REMOTE_SYSTEM_NOT_SUPPORTED_BY_APP = 6
    NOT_AUTHORIZED = 7
    AUTHENTICATION_ERROR = 8
    NETWORK_NOT_AVAILABLE = 9
    DISABLED_BY_POLICY = 10
    WEB_SERVICE_UNAVAILABLE = 11

class AppServiceResponseStatus(enum.IntEnum):
    SUCCESS = 0
    FAILURE = 1
    RESOURCE_LIMITS_EXCEEDED = 2
    UNKNOWN = 3
    REMOTE_SYSTEM_UNAVAILABLE = 4
    MESSAGE_SIZE_TOO_LARGE = 5
    APP_UNAVAILABLE = 6
    AUTHENTICATION_ERROR = 7
    NETWORK_NOT_AVAILABLE = 8
    DISABLED_BY_POLICY = 9
    WEB_SERVICE_UNAVAILABLE = 10

class StatelessAppServiceResponseStatus(enum.IntEnum):
    SUCCESS = 0
    APP_NOT_INSTALLED = 1
    APP_UNAVAILABLE = 2
    APP_SERVICE_UNAVAILABLE = 3
    REMOTE_SYSTEM_UNAVAILABLE = 4
    REMOTE_SYSTEM_NOT_SUPPORTED_BY_APP = 5
    NOT_AUTHORIZED = 6
    RESOURCE_LIMITS_EXCEEDED = 7
    MESSAGE_SIZE_TOO_LARGE = 8
    FAILURE = 9
    UNKNOWN = 10
    AUTHENTICATION_ERROR = 11
    NETWORK_NOT_AVAILABLE = 12
    DISABLED_BY_POLICY = 13
    WEB_SERVICE_UNAVAILABLE = 14

Self = typing.TypeVar('Self')

class AppServiceCatalog(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> AppServiceCatalog: ...
    @staticmethod
    def find_app_service_providers_async(app_service_name: str, /) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.foundation.collections.IVectorView[winsdk.windows.applicationmodel.AppInfo]]: ...

class AppServiceClosedEventArgs(winsdk.system.Object):
    status: AppServiceClosedStatus
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> AppServiceClosedEventArgs: ...

class AppServiceConnection(winsdk.system.Object):
    package_family_name: str
    app_service_name: str
    user: typing.Optional[winsdk.windows.system.User]
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, *args) -> None: ...
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> AppServiceConnection: ...
    def __new__(cls: typing.Type[AppServiceConnection]) -> AppServiceConnection:...
    def close(self) -> None: ...
    def open_async(self) -> winsdk.windows.foundation.IAsyncOperation[AppServiceConnectionStatus]: ...
    def open_remote_async(self, remote_system_connection_request: typing.Optional[winsdk.windows.system.remotesystems.RemoteSystemConnectionRequest], /) -> winsdk.windows.foundation.IAsyncOperation[AppServiceConnectionStatus]: ...
    def send_message_async(self, message: typing.Optional[winsdk.windows.foundation.collections.ValueSet], /) -> winsdk.windows.foundation.IAsyncOperation[AppServiceResponse]: ...
    @staticmethod
    def send_stateless_message_async(connection: typing.Optional[AppServiceConnection], connection_request: typing.Optional[winsdk.windows.system.remotesystems.RemoteSystemConnectionRequest], message: typing.Optional[winsdk.windows.foundation.collections.ValueSet], /) -> winsdk.windows.foundation.IAsyncOperation[StatelessAppServiceResponse]: ...
    def add_request_received(self, handler: winsdk.windows.foundation.TypedEventHandler[AppServiceConnection, AppServiceRequestReceivedEventArgs], /) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_request_received(self, token: winsdk.windows.foundation.EventRegistrationToken, /) -> None: ...
    def add_service_closed(self, handler: winsdk.windows.foundation.TypedEventHandler[AppServiceConnection, AppServiceClosedEventArgs], /) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_service_closed(self, token: winsdk.windows.foundation.EventRegistrationToken, /) -> None: ...

class AppServiceDeferral(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> AppServiceDeferral: ...
    def complete(self) -> None: ...

class AppServiceRequest(winsdk.system.Object):
    message: typing.Optional[winsdk.windows.foundation.collections.ValueSet]
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> AppServiceRequest: ...
    def send_response_async(self, message: typing.Optional[winsdk.windows.foundation.collections.ValueSet], /) -> winsdk.windows.foundation.IAsyncOperation[AppServiceResponseStatus]: ...

class AppServiceRequestReceivedEventArgs(winsdk.system.Object):
    request: typing.Optional[AppServiceRequest]
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> AppServiceRequestReceivedEventArgs: ...
    def get_deferral(self) -> typing.Optional[AppServiceDeferral]: ...

class AppServiceResponse(winsdk.system.Object):
    message: typing.Optional[winsdk.windows.foundation.collections.ValueSet]
    status: AppServiceResponseStatus
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> AppServiceResponse: ...

class AppServiceTriggerDetails(winsdk.system.Object):
    app_service_connection: typing.Optional[AppServiceConnection]
    caller_package_family_name: str
    name: str
    is_remote_system_connection: winsdk.system.Boolean
    caller_remote_connection_token: str
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> AppServiceTriggerDetails: ...
    def check_caller_for_capability_async(self, capability_name: str, /) -> winsdk.windows.foundation.IAsyncOperation[winsdk.system.Boolean]: ...

class StatelessAppServiceResponse(winsdk.system.Object):
    message: typing.Optional[winsdk.windows.foundation.collections.ValueSet]
    status: StatelessAppServiceResponseStatus
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> StatelessAppServiceResponse: ...

