# 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.security.credentials
import winsdk.windows.system
import winsdk.windows.ui
import winsdk.windows.ui.shell

class UserActivityState(enum.IntEnum):
    NEW = 0
    PUBLISHED = 1

Self = typing.TypeVar('Self')

class UserActivity(winsdk.system.Object):
    fallback_uri: typing.Optional[winsdk.windows.foundation.Uri]
    content_uri: typing.Optional[winsdk.windows.foundation.Uri]
    content_type: str
    content_info: typing.Optional[IUserActivityContentInfo]
    activation_uri: typing.Optional[winsdk.windows.foundation.Uri]
    activity_id: str
    state: UserActivityState
    visual_elements: typing.Optional[UserActivityVisualElements]
    is_roamable: winsdk.system.Boolean
    @staticmethod
    def _from(obj: winsdk.system.Object) -> UserActivity: ...
    def __new__(cls: typing.Type[UserActivity], activity_id: str) -> UserActivity:...
    def create_session(self) -> typing.Optional[UserActivitySession]: ...
    def save_async(self) -> winsdk.windows.foundation.IAsyncAction: ...
    def to_json(self) -> str: ...
    @staticmethod
    def to_json_array(activities: typing.Iterable[UserActivity]) -> str: ...
    @staticmethod
    def try_parse_from_json(json: str) -> typing.Optional[UserActivity]: ...
    @staticmethod
    def try_parse_from_json_array(json: str) -> typing.Optional[winsdk.windows.foundation.collections.IVector[UserActivity]]: ...

class UserActivityAttribution(winsdk.system.Object):
    icon_uri: typing.Optional[winsdk.windows.foundation.Uri]
    alternate_text: str
    add_image_query: winsdk.system.Boolean
    @staticmethod
    def _from(obj: winsdk.system.Object) -> UserActivityAttribution: ...
    @typing.overload
    def __new__(cls: typing.Type[UserActivityAttribution], icon_uri: typing.Optional[winsdk.windows.foundation.Uri]) -> UserActivityAttribution:...
    @typing.overload
    def __new__(cls: typing.Type[UserActivityAttribution]) -> UserActivityAttribution:...

class UserActivityChannel(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object) -> UserActivityChannel: ...
    def delete_activity_async(self, activity_id: str) -> winsdk.windows.foundation.IAsyncAction: ...
    def delete_all_activities_async(self) -> winsdk.windows.foundation.IAsyncAction: ...
    @staticmethod
    def disable_auto_session_creation() -> None: ...
    @staticmethod
    def get_default() -> typing.Optional[UserActivityChannel]: ...
    @staticmethod
    def get_for_user(user: typing.Optional[winsdk.windows.system.User]) -> typing.Optional[UserActivityChannel]: ...
    def get_or_create_user_activity_async(self, activity_id: str) -> winsdk.windows.foundation.IAsyncOperation[UserActivity]: ...
    def get_recent_user_activities_async(self, max_unique_activities: winsdk.system.Int32) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.foundation.collections.IVector[UserActivitySessionHistoryItem]]: ...
    def get_session_history_items_for_user_activity_async(self, activity_id: str, start_time: datetime.datetime) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.foundation.collections.IVector[UserActivitySessionHistoryItem]]: ...
    @staticmethod
    def try_get_for_web_account(account: typing.Optional[winsdk.windows.security.credentials.WebAccount]) -> typing.Optional[UserActivityChannel]: ...

class UserActivityContentInfo(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object) -> UserActivityContentInfo: ...
    @staticmethod
    def from_json(value: str) -> typing.Optional[UserActivityContentInfo]: ...
    def to_json(self) -> str: ...

class UserActivityRequest(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object) -> UserActivityRequest: ...
    def set_user_activity(self, activity: typing.Optional[UserActivity]) -> None: ...

class UserActivityRequestManager(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object) -> UserActivityRequestManager: ...
    @staticmethod
    def get_for_current_view() -> typing.Optional[UserActivityRequestManager]: ...
    def add_user_activity_requested(self, handler: winsdk.windows.foundation.TypedEventHandler[UserActivityRequestManager, UserActivityRequestedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_user_activity_requested(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class UserActivityRequestedEventArgs(winsdk.system.Object):
    request: typing.Optional[UserActivityRequest]
    @staticmethod
    def _from(obj: winsdk.system.Object) -> UserActivityRequestedEventArgs: ...
    def get_deferral(self) -> typing.Optional[winsdk.windows.foundation.Deferral]: ...

class UserActivitySession(winsdk.system.Object):
    activity_id: str
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, *args) -> None: ...
    @staticmethod
    def _from(obj: winsdk.system.Object) -> UserActivitySession: ...
    def close(self) -> None: ...

class UserActivitySessionHistoryItem(winsdk.system.Object):
    end_time: typing.Optional[typing.Optional[datetime.datetime]]
    start_time: datetime.datetime
    user_activity: typing.Optional[UserActivity]
    @staticmethod
    def _from(obj: winsdk.system.Object) -> UserActivitySessionHistoryItem: ...

class UserActivityVisualElements(winsdk.system.Object):
    display_text: str
    description: str
    content: typing.Optional[winsdk.windows.ui.shell.IAdaptiveCard]
    background_color: winsdk.windows.ui.Color
    attribution: typing.Optional[UserActivityAttribution]
    attribution_display_text: str
    @staticmethod
    def _from(obj: winsdk.system.Object) -> UserActivityVisualElements: ...

class IUserActivityContentInfo(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object) -> IUserActivityContentInfo: ...
    def to_json(self) -> str: ...

