"""
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.

GENERATED FILE - DO NOT EDIT MANUALLY
This file is generated by generate_handlers.py based on activity_config.py

To regenerate, run:
uv run generate-activity-handlers
"""

from abc import ABC, abstractmethod
from logging import Logger
from typing import Awaitable, Callable, Optional, Union, overload

from microsoft.teams.api import InvokeResponse
from microsoft.teams.api.activities import (
    Activity,
    AdaptiveCardInvokeActivity,
    CommandResultActivity,
    CommandSendActivity,
    ConfigFetchInvokeActivity,
    ConfigSubmitInvokeActivity,
    ConversationUpdateActivity,
    EndOfConversationActivity,
    EventActivity,
    ExecuteActionInvokeActivity,
    FileConsentInvokeActivity,
    HandoffActionInvokeActivity,
    HandoffActivity,
    InstalledActivity,
    InstallUpdateActivity,
    InvokeActivity,
    MeetingEndEventActivity,
    MeetingParticipantJoinEventActivity,
    MeetingParticipantLeaveEventActivity,
    MeetingStartEventActivity,
    MessageActivity,
    MessageDeleteActivity,
    MessageExtensionAnonQueryLinkInvokeActivity,
    MessageExtensionCardButtonClickedInvokeActivity,
    MessageExtensionFetchTaskInvokeActivity,
    MessageExtensionQueryInvokeActivity,
    MessageExtensionQueryLinkInvokeActivity,
    MessageExtensionQuerySettingUrlInvokeActivity,
    MessageExtensionSelectItemInvokeActivity,
    MessageExtensionSettingInvokeActivity,
    MessageExtensionSubmitActionInvokeActivity,
    MessageReactionActivity,
    MessageSubmitActionInvokeActivity,
    MessageUpdateActivity,
    ReadReceiptEventActivity,
    SignInTokenExchangeInvokeActivity,
    SignInVerifyStateInvokeActivity,
    TabFetchInvokeActivity,
    TabSubmitInvokeActivity,
    TaskFetchInvokeActivity,
    TaskSubmitInvokeActivity,
    TraceActivity,
    TypingActivity,
    UninstalledActivity,
)
from microsoft.teams.api.models.invoke_response import (
    AdaptiveCardInvokeResponse,
    ConfigInvokeResponse,
    MessagingExtensionActionInvokeResponse,
    MessagingExtensionInvokeResponse,
    TabInvokeResponse,
    TaskModuleInvokeResponse,
    TokenExchangeInvokeResponseType,
)

from .activity_context import ActivityContext
from .activity_route_configs import ACTIVITY_ROUTES
from .router import ActivityRouter
from .type_validation import validate_handler_type


class GeneratedActivityHandlerMixin(ABC):
    """Mixin class providing typed activity handler registration methods."""

    @property
    @abstractmethod
    def router(self) -> ActivityRouter:
        """The activity router instance. Must be implemented by the concrete class."""
        pass

    @property
    @abstractmethod
    def logger(self) -> Logger:
        """The logger instance used by the app."""
        pass

    @overload
    def on_message(
        self, handler: Callable[[ActivityContext[MessageActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MessageActivity]], Awaitable[None]]: ...

    @overload
    def on_message(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MessageActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MessageActivity]], Awaitable[None]],
    ]: ...

    def on_message(
        self, handler: Optional[Callable[[ActivityContext[MessageActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[MessageActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MessageActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MessageActivity]], Awaitable[None]]
    ):
        """Register a message activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MessageActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MessageActivity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, MessageActivity, "on_message", "MessageActivity")
            config = ACTIVITY_ROUTES["message"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_delete(
        self, handler: Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]: ...

    @overload
    def on_message_delete(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]],
    ]: ...

    def on_message_delete(
        self, handler: Optional[Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]
    ):
        """Register a message_delete activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, MessageDeleteActivity, "on_message_delete", "MessageDeleteActivity"
            )
            config = ACTIVITY_ROUTES["message_delete"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_soft_delete_message(
        self, handler: Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]: ...

    @overload
    def on_soft_delete_message(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]],
    ]: ...

    def on_soft_delete_message(
        self, handler: Optional[Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]
    ):
        """Register a soft_delete_message activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MessageDeleteActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, MessageDeleteActivity, "on_soft_delete_message", "MessageDeleteActivity"
            )
            config = ACTIVITY_ROUTES["soft_delete_message"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_reaction(
        self, handler: Callable[[ActivityContext[MessageReactionActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MessageReactionActivity]], Awaitable[None]]: ...

    @overload
    def on_message_reaction(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MessageReactionActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MessageReactionActivity]], Awaitable[None]],
    ]: ...

    def on_message_reaction(
        self, handler: Optional[Callable[[ActivityContext[MessageReactionActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[MessageReactionActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MessageReactionActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MessageReactionActivity]], Awaitable[None]]
    ):
        """Register a message_reaction activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MessageReactionActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MessageReactionActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, MessageReactionActivity, "on_message_reaction", "MessageReactionActivity"
            )
            config = ACTIVITY_ROUTES["message_reaction"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_update(
        self, handler: Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_message_update(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_message_update(
        self, handler: Optional[Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]
    ):
        """Register a message_update activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, MessageUpdateActivity, "on_message_update", "MessageUpdateActivity"
            )
            config = ACTIVITY_ROUTES["message_update"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_undelete_message(
        self, handler: Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_undelete_message(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_undelete_message(
        self, handler: Optional[Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]
    ):
        """Register a undelete_message activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, MessageUpdateActivity, "on_undelete_message", "MessageUpdateActivity"
            )
            config = ACTIVITY_ROUTES["undelete_message"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_edit_message(
        self, handler: Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_edit_message(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_edit_message(
        self, handler: Optional[Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]
    ):
        """Register a edit_message activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MessageUpdateActivity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, MessageUpdateActivity, "on_edit_message", "MessageUpdateActivity")
            config = ACTIVITY_ROUTES["edit_message"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_command(
        self, handler: Callable[[ActivityContext[CommandSendActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[CommandSendActivity]], Awaitable[None]]: ...

    @overload
    def on_command(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[CommandSendActivity]], Awaitable[None]]],
        Callable[[ActivityContext[CommandSendActivity]], Awaitable[None]],
    ]: ...

    def on_command(
        self, handler: Optional[Callable[[ActivityContext[CommandSendActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[CommandSendActivity]], Awaitable[None]]],
            Callable[[ActivityContext[CommandSendActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[CommandSendActivity]], Awaitable[None]]
    ):
        """Register a command activity handler."""

        def decorator(
            func: Callable[[ActivityContext[CommandSendActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[CommandSendActivity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, CommandSendActivity, "on_command", "CommandSendActivity")
            config = ACTIVITY_ROUTES["command"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_command_result(
        self, handler: Callable[[ActivityContext[CommandResultActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[CommandResultActivity]], Awaitable[None]]: ...

    @overload
    def on_command_result(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[CommandResultActivity]], Awaitable[None]]],
        Callable[[ActivityContext[CommandResultActivity]], Awaitable[None]],
    ]: ...

    def on_command_result(
        self, handler: Optional[Callable[[ActivityContext[CommandResultActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[CommandResultActivity]], Awaitable[None]]],
            Callable[[ActivityContext[CommandResultActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[CommandResultActivity]], Awaitable[None]]
    ):
        """Register a command_result activity handler."""

        def decorator(
            func: Callable[[ActivityContext[CommandResultActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[CommandResultActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, CommandResultActivity, "on_command_result", "CommandResultActivity"
            )
            config = ACTIVITY_ROUTES["command_result"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_conversation_update(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_conversation_update(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_conversation_update(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a conversation_update activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_conversation_update", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["conversation_update"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_channel_created(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_channel_created(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_channel_created(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a channel_created activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_channel_created", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["channel_created"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_channel_deleted(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_channel_deleted(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_channel_deleted(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a channel_deleted activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_channel_deleted", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["channel_deleted"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_channel_renamed(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_channel_renamed(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_channel_renamed(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a channel_renamed activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_channel_renamed", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["channel_renamed"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_channel_restored(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_channel_restored(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_channel_restored(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a channel_restored activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_channel_restored", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["channel_restored"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_team_archived(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_team_archived(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_team_archived(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a team_archived activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_team_archived", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["team_archived"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_team_deleted(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_team_deleted(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_team_deleted(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a team_deleted activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_team_deleted", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["team_deleted"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_team_hard_deleted(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_team_hard_deleted(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_team_hard_deleted(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a team_hard_deleted activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_team_hard_deleted", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["team_hard_deleted"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_team_renamed(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_team_renamed(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_team_renamed(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a team_renamed activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_team_renamed", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["team_renamed"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_team_restored(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_team_restored(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_team_restored(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a team_restored activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_team_restored", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["team_restored"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_team_unarchived(
        self, handler: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_team_unarchived(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_team_unarchived(
        self, handler: Optional[Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]
    ):
        """Register a team_unarchived activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ConversationUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ConversationUpdateActivity, "on_team_unarchived", "ConversationUpdateActivity"
            )
            config = ACTIVITY_ROUTES["team_unarchived"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_end_of_conversation(
        self, handler: Callable[[ActivityContext[EndOfConversationActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[EndOfConversationActivity]], Awaitable[None]]: ...

    @overload
    def on_end_of_conversation(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[EndOfConversationActivity]], Awaitable[None]]],
        Callable[[ActivityContext[EndOfConversationActivity]], Awaitable[None]],
    ]: ...

    def on_end_of_conversation(
        self, handler: Optional[Callable[[ActivityContext[EndOfConversationActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[EndOfConversationActivity]], Awaitable[None]]],
            Callable[[ActivityContext[EndOfConversationActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[EndOfConversationActivity]], Awaitable[None]]
    ):
        """Register a end_of_conversation activity handler."""

        def decorator(
            func: Callable[[ActivityContext[EndOfConversationActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[EndOfConversationActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, EndOfConversationActivity, "on_end_of_conversation", "EndOfConversationActivity"
            )
            config = ACTIVITY_ROUTES["end_of_conversation"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_event(
        self, handler: Callable[[ActivityContext[EventActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[EventActivity]], Awaitable[None]]: ...

    @overload
    def on_event(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[EventActivity]], Awaitable[None]]],
        Callable[[ActivityContext[EventActivity]], Awaitable[None]],
    ]: ...

    def on_event(
        self, handler: Optional[Callable[[ActivityContext[EventActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[EventActivity]], Awaitable[None]]],
            Callable[[ActivityContext[EventActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[EventActivity]], Awaitable[None]]
    ):
        """Register a event activity handler."""

        def decorator(
            func: Callable[[ActivityContext[EventActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[EventActivity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, EventActivity, "on_event", "EventActivity")
            config = ACTIVITY_ROUTES["event"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_read_receipt(
        self, handler: Callable[[ActivityContext[ReadReceiptEventActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[ReadReceiptEventActivity]], Awaitable[None]]: ...

    @overload
    def on_read_receipt(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ReadReceiptEventActivity]], Awaitable[None]]],
        Callable[[ActivityContext[ReadReceiptEventActivity]], Awaitable[None]],
    ]: ...

    def on_read_receipt(
        self, handler: Optional[Callable[[ActivityContext[ReadReceiptEventActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[ReadReceiptEventActivity]], Awaitable[None]]],
            Callable[[ActivityContext[ReadReceiptEventActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[ReadReceiptEventActivity]], Awaitable[None]]
    ):
        """Register a read_receipt activity handler."""

        def decorator(
            func: Callable[[ActivityContext[ReadReceiptEventActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[ReadReceiptEventActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, ReadReceiptEventActivity, "on_read_receipt", "ReadReceiptEventActivity"
            )
            config = ACTIVITY_ROUTES["read_receipt"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_meeting_start(
        self, handler: Callable[[ActivityContext[MeetingStartEventActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MeetingStartEventActivity]], Awaitable[None]]: ...

    @overload
    def on_meeting_start(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MeetingStartEventActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MeetingStartEventActivity]], Awaitable[None]],
    ]: ...

    def on_meeting_start(
        self, handler: Optional[Callable[[ActivityContext[MeetingStartEventActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[MeetingStartEventActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MeetingStartEventActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MeetingStartEventActivity]], Awaitable[None]]
    ):
        """Register a meeting_start activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MeetingStartEventActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MeetingStartEventActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, MeetingStartEventActivity, "on_meeting_start", "MeetingStartEventActivity"
            )
            config = ACTIVITY_ROUTES["meeting_start"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_meeting_end(
        self, handler: Callable[[ActivityContext[MeetingEndEventActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MeetingEndEventActivity]], Awaitable[None]]: ...

    @overload
    def on_meeting_end(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MeetingEndEventActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MeetingEndEventActivity]], Awaitable[None]],
    ]: ...

    def on_meeting_end(
        self, handler: Optional[Callable[[ActivityContext[MeetingEndEventActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[MeetingEndEventActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MeetingEndEventActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MeetingEndEventActivity]], Awaitable[None]]
    ):
        """Register a meeting_end activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MeetingEndEventActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MeetingEndEventActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, MeetingEndEventActivity, "on_meeting_end", "MeetingEndEventActivity"
            )
            config = ACTIVITY_ROUTES["meeting_end"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_meeting_participant_join(
        self, handler: Callable[[ActivityContext[MeetingParticipantJoinEventActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MeetingParticipantJoinEventActivity]], Awaitable[None]]: ...

    @overload
    def on_meeting_participant_join(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MeetingParticipantJoinEventActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MeetingParticipantJoinEventActivity]], Awaitable[None]],
    ]: ...

    def on_meeting_participant_join(
        self,
        handler: Optional[Callable[[ActivityContext[MeetingParticipantJoinEventActivity]], Awaitable[None]]] = None,
    ) -> (
        Callable[
            [Callable[[ActivityContext[MeetingParticipantJoinEventActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MeetingParticipantJoinEventActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MeetingParticipantJoinEventActivity]], Awaitable[None]]
    ):
        """Register a meeting_participant_join activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MeetingParticipantJoinEventActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MeetingParticipantJoinEventActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger,
                func,
                MeetingParticipantJoinEventActivity,
                "on_meeting_participant_join",
                "MeetingParticipantJoinEventActivity",
            )
            config = ACTIVITY_ROUTES["meeting_participant_join"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_meeting_participant_leave(
        self, handler: Callable[[ActivityContext[MeetingParticipantLeaveEventActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[MeetingParticipantLeaveEventActivity]], Awaitable[None]]: ...

    @overload
    def on_meeting_participant_leave(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MeetingParticipantLeaveEventActivity]], Awaitable[None]]],
        Callable[[ActivityContext[MeetingParticipantLeaveEventActivity]], Awaitable[None]],
    ]: ...

    def on_meeting_participant_leave(
        self,
        handler: Optional[Callable[[ActivityContext[MeetingParticipantLeaveEventActivity]], Awaitable[None]]] = None,
    ) -> (
        Callable[
            [Callable[[ActivityContext[MeetingParticipantLeaveEventActivity]], Awaitable[None]]],
            Callable[[ActivityContext[MeetingParticipantLeaveEventActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[MeetingParticipantLeaveEventActivity]], Awaitable[None]]
    ):
        """Register a meeting_participant_leave activity handler."""

        def decorator(
            func: Callable[[ActivityContext[MeetingParticipantLeaveEventActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[MeetingParticipantLeaveEventActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger,
                func,
                MeetingParticipantLeaveEventActivity,
                "on_meeting_participant_leave",
                "MeetingParticipantLeaveEventActivity",
            )
            config = ACTIVITY_ROUTES["meeting_participant_leave"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_config_open(
        self,
        handler: Callable[
            [ActivityContext[ConfigFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[ConfigFetchInvokeActivity]],
        Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
    ]: ...

    @overload
    def on_config_open(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[ConfigFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[ConfigFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
        ],
    ]: ...

    def on_config_open(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[ConfigFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[ConfigFetchInvokeActivity]],
                    Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
                ]
            ],
            Callable[
                [ActivityContext[ConfigFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[ConfigFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
        ]
    ):
        """Register a config.open activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[ConfigFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[ConfigFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger, func, ConfigFetchInvokeActivity, "on_config_open", "ConfigFetchInvokeActivity"
            )
            config = ACTIVITY_ROUTES["config.open"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_config_submit(
        self,
        handler: Callable[
            [ActivityContext[ConfigSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[ConfigSubmitInvokeActivity]],
        Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
    ]: ...

    @overload
    def on_config_submit(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[ConfigSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[ConfigSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
        ],
    ]: ...

    def on_config_submit(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[ConfigSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[ConfigSubmitInvokeActivity]],
                    Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
                ]
            ],
            Callable[
                [ActivityContext[ConfigSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[ConfigSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
        ]
    ):
        """Register a config.submit activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[ConfigSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[ConfigSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[ConfigInvokeResponse], ConfigInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger, func, ConfigSubmitInvokeActivity, "on_config_submit", "ConfigSubmitInvokeActivity"
            )
            config = ACTIVITY_ROUTES["config.submit"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_file_consent(
        self,
        handler: Callable[[ActivityContext[FileConsentInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
    ) -> Callable[[ActivityContext[FileConsentInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]: ...

    @overload
    def on_file_consent(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[FileConsentInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]],
        Callable[[ActivityContext[FileConsentInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
    ]: ...

    def on_file_consent(
        self,
        handler: Optional[
            Callable[[ActivityContext[FileConsentInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]
        ] = None,
    ) -> (
        Callable[
            [Callable[[ActivityContext[FileConsentInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]],
            Callable[[ActivityContext[FileConsentInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
        ]
        | Callable[[ActivityContext[FileConsentInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]
    ):
        """Register a file.consent activity handler."""

        def decorator(
            func: Callable[[ActivityContext[FileConsentInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
        ) -> Callable[[ActivityContext[FileConsentInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]:
            validate_handler_type(
                self.logger, func, FileConsentInvokeActivity, "on_file_consent", "FileConsentInvokeActivity"
            )
            config = ACTIVITY_ROUTES["file.consent"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_execute(
        self,
        handler: Callable[[ActivityContext[ExecuteActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
    ) -> Callable[[ActivityContext[ExecuteActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]: ...

    @overload
    def on_message_execute(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[ExecuteActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]],
        Callable[[ActivityContext[ExecuteActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
    ]: ...

    def on_message_execute(
        self,
        handler: Optional[
            Callable[[ActivityContext[ExecuteActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]
        ] = None,
    ) -> (
        Callable[
            [Callable[[ActivityContext[ExecuteActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]],
            Callable[[ActivityContext[ExecuteActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
        ]
        | Callable[[ActivityContext[ExecuteActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]
    ):
        """Register a message.execute activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[ExecuteActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
            ],
        ) -> Callable[[ActivityContext[ExecuteActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]:
            validate_handler_type(
                self.logger, func, ExecuteActionInvokeActivity, "on_message_execute", "ExecuteActionInvokeActivity"
            )
            config = ACTIVITY_ROUTES["message.execute"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_ext_query_link(
        self,
        handler: Callable[
            [ActivityContext[MessageExtensionQueryLinkInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[MessageExtensionQueryLinkInvokeActivity]],
        Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
    ]: ...

    @overload
    def on_message_ext_query_link(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[MessageExtensionQueryLinkInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[MessageExtensionQueryLinkInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ]: ...

    def on_message_ext_query_link(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[MessageExtensionQueryLinkInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[MessageExtensionQueryLinkInvokeActivity]],
                    Awaitable[
                        Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]
                    ],
                ]
            ],
            Callable[
                [ActivityContext[MessageExtensionQueryLinkInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[MessageExtensionQueryLinkInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]
    ):
        """Register a message.ext.query-link activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[MessageExtensionQueryLinkInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[MessageExtensionQueryLinkInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger,
                func,
                MessageExtensionQueryLinkInvokeActivity,
                "on_message_ext_query_link",
                "MessageExtensionQueryLinkInvokeActivity",
            )
            config = ACTIVITY_ROUTES["message.ext.query-link"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_ext_anon_query_link(
        self,
        handler: Callable[
            [ActivityContext[MessageExtensionAnonQueryLinkInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[MessageExtensionAnonQueryLinkInvokeActivity]],
        Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
    ]: ...

    @overload
    def on_message_ext_anon_query_link(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[MessageExtensionAnonQueryLinkInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[MessageExtensionAnonQueryLinkInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ]: ...

    def on_message_ext_anon_query_link(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[MessageExtensionAnonQueryLinkInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[MessageExtensionAnonQueryLinkInvokeActivity]],
                    Awaitable[
                        Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]
                    ],
                ]
            ],
            Callable[
                [ActivityContext[MessageExtensionAnonQueryLinkInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[MessageExtensionAnonQueryLinkInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]
    ):
        """Register a message.ext.anon-query-link activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[MessageExtensionAnonQueryLinkInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[MessageExtensionAnonQueryLinkInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger,
                func,
                MessageExtensionAnonQueryLinkInvokeActivity,
                "on_message_ext_anon_query_link",
                "MessageExtensionAnonQueryLinkInvokeActivity",
            )
            config = ACTIVITY_ROUTES["message.ext.anon-query-link"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_ext_query(
        self,
        handler: Callable[
            [ActivityContext[MessageExtensionQueryInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[MessageExtensionQueryInvokeActivity]],
        Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
    ]: ...

    @overload
    def on_message_ext_query(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[MessageExtensionQueryInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[MessageExtensionQueryInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ]: ...

    def on_message_ext_query(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[MessageExtensionQueryInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[MessageExtensionQueryInvokeActivity]],
                    Awaitable[
                        Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]
                    ],
                ]
            ],
            Callable[
                [ActivityContext[MessageExtensionQueryInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[MessageExtensionQueryInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]
    ):
        """Register a message.ext.query activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[MessageExtensionQueryInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[MessageExtensionQueryInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger,
                func,
                MessageExtensionQueryInvokeActivity,
                "on_message_ext_query",
                "MessageExtensionQueryInvokeActivity",
            )
            config = ACTIVITY_ROUTES["message.ext.query"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_ext_select_item(
        self,
        handler: Callable[
            [ActivityContext[MessageExtensionSelectItemInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[MessageExtensionSelectItemInvokeActivity]],
        Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
    ]: ...

    @overload
    def on_message_ext_select_item(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[MessageExtensionSelectItemInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[MessageExtensionSelectItemInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ]: ...

    def on_message_ext_select_item(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[MessageExtensionSelectItemInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[MessageExtensionSelectItemInvokeActivity]],
                    Awaitable[
                        Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]
                    ],
                ]
            ],
            Callable[
                [ActivityContext[MessageExtensionSelectItemInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[MessageExtensionSelectItemInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]
    ):
        """Register a message.ext.select-item activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[MessageExtensionSelectItemInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[MessageExtensionSelectItemInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger,
                func,
                MessageExtensionSelectItemInvokeActivity,
                "on_message_ext_select_item",
                "MessageExtensionSelectItemInvokeActivity",
            )
            config = ACTIVITY_ROUTES["message.ext.select-item"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_ext_submit(
        self,
        handler: Callable[
            [ActivityContext[MessageExtensionSubmitActionInvokeActivity]],
            Awaitable[
                Union[InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse]
            ],
        ],
    ) -> Callable[
        [ActivityContext[MessageExtensionSubmitActionInvokeActivity]],
        Awaitable[
            Union[InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse]
        ],
    ]: ...

    @overload
    def on_message_ext_submit(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[MessageExtensionSubmitActionInvokeActivity]],
                Awaitable[
                    Union[
                        InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse
                    ]
                ],
            ]
        ],
        Callable[
            [ActivityContext[MessageExtensionSubmitActionInvokeActivity]],
            Awaitable[
                Union[InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse]
            ],
        ],
    ]: ...

    def on_message_ext_submit(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[MessageExtensionSubmitActionInvokeActivity]],
                Awaitable[
                    Union[
                        InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse
                    ]
                ],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[MessageExtensionSubmitActionInvokeActivity]],
                    Awaitable[
                        Union[
                            InvokeResponse[MessagingExtensionActionInvokeResponse],
                            MessagingExtensionActionInvokeResponse,
                        ]
                    ],
                ]
            ],
            Callable[
                [ActivityContext[MessageExtensionSubmitActionInvokeActivity]],
                Awaitable[
                    Union[
                        InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse
                    ]
                ],
            ],
        ]
        | Callable[
            [ActivityContext[MessageExtensionSubmitActionInvokeActivity]],
            Awaitable[
                Union[InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse]
            ],
        ]
    ):
        """Register a message.ext.submit activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[MessageExtensionSubmitActionInvokeActivity]],
                Awaitable[
                    Union[
                        InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse
                    ]
                ],
            ],
        ) -> Callable[
            [ActivityContext[MessageExtensionSubmitActionInvokeActivity]],
            Awaitable[
                Union[InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse]
            ],
        ]:
            validate_handler_type(
                self.logger,
                func,
                MessageExtensionSubmitActionInvokeActivity,
                "on_message_ext_submit",
                "MessageExtensionSubmitActionInvokeActivity",
            )
            config = ACTIVITY_ROUTES["message.ext.submit"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_ext_open(
        self,
        handler: Callable[
            [ActivityContext[MessageExtensionFetchTaskInvokeActivity]],
            Awaitable[
                Union[InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse]
            ],
        ],
    ) -> Callable[
        [ActivityContext[MessageExtensionFetchTaskInvokeActivity]],
        Awaitable[
            Union[InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse]
        ],
    ]: ...

    @overload
    def on_message_ext_open(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[MessageExtensionFetchTaskInvokeActivity]],
                Awaitable[
                    Union[
                        InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse
                    ]
                ],
            ]
        ],
        Callable[
            [ActivityContext[MessageExtensionFetchTaskInvokeActivity]],
            Awaitable[
                Union[InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse]
            ],
        ],
    ]: ...

    def on_message_ext_open(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[MessageExtensionFetchTaskInvokeActivity]],
                Awaitable[
                    Union[
                        InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse
                    ]
                ],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[MessageExtensionFetchTaskInvokeActivity]],
                    Awaitable[
                        Union[
                            InvokeResponse[MessagingExtensionActionInvokeResponse],
                            MessagingExtensionActionInvokeResponse,
                        ]
                    ],
                ]
            ],
            Callable[
                [ActivityContext[MessageExtensionFetchTaskInvokeActivity]],
                Awaitable[
                    Union[
                        InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse
                    ]
                ],
            ],
        ]
        | Callable[
            [ActivityContext[MessageExtensionFetchTaskInvokeActivity]],
            Awaitable[
                Union[InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse]
            ],
        ]
    ):
        """Register a message.ext.open activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[MessageExtensionFetchTaskInvokeActivity]],
                Awaitable[
                    Union[
                        InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse
                    ]
                ],
            ],
        ) -> Callable[
            [ActivityContext[MessageExtensionFetchTaskInvokeActivity]],
            Awaitable[
                Union[InvokeResponse[MessagingExtensionActionInvokeResponse], MessagingExtensionActionInvokeResponse]
            ],
        ]:
            validate_handler_type(
                self.logger,
                func,
                MessageExtensionFetchTaskInvokeActivity,
                "on_message_ext_open",
                "MessageExtensionFetchTaskInvokeActivity",
            )
            config = ACTIVITY_ROUTES["message.ext.open"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_ext_query_settings_url(
        self,
        handler: Callable[
            [ActivityContext[MessageExtensionQuerySettingUrlInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[MessageExtensionQuerySettingUrlInvokeActivity]],
        Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
    ]: ...

    @overload
    def on_message_ext_query_settings_url(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[MessageExtensionQuerySettingUrlInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[MessageExtensionQuerySettingUrlInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ]: ...

    def on_message_ext_query_settings_url(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[MessageExtensionQuerySettingUrlInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[MessageExtensionQuerySettingUrlInvokeActivity]],
                    Awaitable[
                        Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]
                    ],
                ]
            ],
            Callable[
                [ActivityContext[MessageExtensionQuerySettingUrlInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[MessageExtensionQuerySettingUrlInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]
    ):
        """Register a message.ext.query-settings-url activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[MessageExtensionQuerySettingUrlInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[MessageExtensionQuerySettingUrlInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger,
                func,
                MessageExtensionQuerySettingUrlInvokeActivity,
                "on_message_ext_query_settings_url",
                "MessageExtensionQuerySettingUrlInvokeActivity",
            )
            config = ACTIVITY_ROUTES["message.ext.query-settings-url"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_ext_setting(
        self,
        handler: Callable[
            [ActivityContext[MessageExtensionSettingInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[MessageExtensionSettingInvokeActivity]],
        Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
    ]: ...

    @overload
    def on_message_ext_setting(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[MessageExtensionSettingInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[MessageExtensionSettingInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ],
    ]: ...

    def on_message_ext_setting(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[MessageExtensionSettingInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[MessageExtensionSettingInvokeActivity]],
                    Awaitable[
                        Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]
                    ],
                ]
            ],
            Callable[
                [ActivityContext[MessageExtensionSettingInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[MessageExtensionSettingInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]
    ):
        """Register a message.ext.setting activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[MessageExtensionSettingInvokeActivity]],
                Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[MessageExtensionSettingInvokeActivity]],
            Awaitable[Union[InvokeResponse[MessagingExtensionInvokeResponse], MessagingExtensionInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger,
                func,
                MessageExtensionSettingInvokeActivity,
                "on_message_ext_setting",
                "MessageExtensionSettingInvokeActivity",
            )
            config = ACTIVITY_ROUTES["message.ext.setting"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_ext_card_button_clicked(
        self,
        handler: Callable[
            [ActivityContext[MessageExtensionCardButtonClickedInvokeActivity]],
            Awaitable[Union[InvokeResponse[None], None]],
        ],
    ) -> Callable[
        [ActivityContext[MessageExtensionCardButtonClickedInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
    ]: ...

    @overload
    def on_message_ext_card_button_clicked(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[MessageExtensionCardButtonClickedInvokeActivity]],
                Awaitable[Union[InvokeResponse[None], None]],
            ]
        ],
        Callable[
            [ActivityContext[MessageExtensionCardButtonClickedInvokeActivity]],
            Awaitable[Union[InvokeResponse[None], None]],
        ],
    ]: ...

    def on_message_ext_card_button_clicked(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[MessageExtensionCardButtonClickedInvokeActivity]],
                Awaitable[Union[InvokeResponse[None], None]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[MessageExtensionCardButtonClickedInvokeActivity]],
                    Awaitable[Union[InvokeResponse[None], None]],
                ]
            ],
            Callable[
                [ActivityContext[MessageExtensionCardButtonClickedInvokeActivity]],
                Awaitable[Union[InvokeResponse[None], None]],
            ],
        ]
        | Callable[
            [ActivityContext[MessageExtensionCardButtonClickedInvokeActivity]],
            Awaitable[Union[InvokeResponse[None], None]],
        ]
    ):
        """Register a message.ext.card-button-clicked activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[MessageExtensionCardButtonClickedInvokeActivity]],
                Awaitable[Union[InvokeResponse[None], None]],
            ],
        ) -> Callable[
            [ActivityContext[MessageExtensionCardButtonClickedInvokeActivity]],
            Awaitable[Union[InvokeResponse[None], None]],
        ]:
            validate_handler_type(
                self.logger,
                func,
                MessageExtensionCardButtonClickedInvokeActivity,
                "on_message_ext_card_button_clicked",
                "MessageExtensionCardButtonClickedInvokeActivity",
            )
            config = ACTIVITY_ROUTES["message.ext.card-button-clicked"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_dialog_open(
        self,
        handler: Callable[
            [ActivityContext[TaskFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[TaskFetchInvokeActivity]],
        Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
    ]: ...

    @overload
    def on_dialog_open(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[TaskFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[TaskFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
        ],
    ]: ...

    def on_dialog_open(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[TaskFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[TaskFetchInvokeActivity]],
                    Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
                ]
            ],
            Callable[
                [ActivityContext[TaskFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[TaskFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
        ]
    ):
        """Register a dialog.open activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[TaskFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[TaskFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger, func, TaskFetchInvokeActivity, "on_dialog_open", "TaskFetchInvokeActivity"
            )
            config = ACTIVITY_ROUTES["dialog.open"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_dialog_submit(
        self,
        handler: Callable[
            [ActivityContext[TaskSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[TaskSubmitInvokeActivity]],
        Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
    ]: ...

    @overload
    def on_dialog_submit(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[TaskSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[TaskSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
        ],
    ]: ...

    def on_dialog_submit(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[TaskSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[TaskSubmitInvokeActivity]],
                    Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
                ]
            ],
            Callable[
                [ActivityContext[TaskSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[TaskSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
        ]
    ):
        """Register a dialog.submit activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[TaskSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[TaskSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[TaskModuleInvokeResponse], TaskModuleInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger, func, TaskSubmitInvokeActivity, "on_dialog_submit", "TaskSubmitInvokeActivity"
            )
            config = ACTIVITY_ROUTES["dialog.submit"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_tab_open(
        self,
        handler: Callable[
            [ActivityContext[TabFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[TabFetchInvokeActivity]],
        Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
    ]: ...

    @overload
    def on_tab_open(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[TabFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[TabFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
        ],
    ]: ...

    def on_tab_open(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[TabFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[TabFetchInvokeActivity]],
                    Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
                ]
            ],
            Callable[
                [ActivityContext[TabFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[TabFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
        ]
    ):
        """Register a tab.open activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[TabFetchInvokeActivity]],
                Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[TabFetchInvokeActivity]],
            Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
        ]:
            validate_handler_type(self.logger, func, TabFetchInvokeActivity, "on_tab_open", "TabFetchInvokeActivity")
            config = ACTIVITY_ROUTES["tab.open"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_tab_submit(
        self,
        handler: Callable[
            [ActivityContext[TabSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[TabSubmitInvokeActivity]],
        Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
    ]: ...

    @overload
    def on_tab_submit(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[TabSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[TabSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
        ],
    ]: ...

    def on_tab_submit(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[TabSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[TabSubmitInvokeActivity]],
                    Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
                ]
            ],
            Callable[
                [ActivityContext[TabSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[TabSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
        ]
    ):
        """Register a tab.submit activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[TabSubmitInvokeActivity]],
                Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[TabSubmitInvokeActivity]],
            Awaitable[Union[InvokeResponse[TabInvokeResponse], TabInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger, func, TabSubmitInvokeActivity, "on_tab_submit", "TabSubmitInvokeActivity"
            )
            config = ACTIVITY_ROUTES["tab.submit"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_message_submit(
        self,
        handler: Callable[
            [ActivityContext[MessageSubmitActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
        ],
    ) -> Callable[
        [ActivityContext[MessageSubmitActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
    ]: ...

    @overload
    def on_message_submit(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[MessageSubmitActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]],
        Callable[[ActivityContext[MessageSubmitActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
    ]: ...

    def on_message_submit(
        self,
        handler: Optional[
            Callable[[ActivityContext[MessageSubmitActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[MessageSubmitActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
                ]
            ],
            Callable[
                [ActivityContext[MessageSubmitActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
            ],
        ]
        | Callable[[ActivityContext[MessageSubmitActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]
    ):
        """Register a message.submit activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[MessageSubmitActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
            ],
        ) -> Callable[
            [ActivityContext[MessageSubmitActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
        ]:
            validate_handler_type(
                self.logger,
                func,
                MessageSubmitActionInvokeActivity,
                "on_message_submit",
                "MessageSubmitActionInvokeActivity",
            )
            config = ACTIVITY_ROUTES["message.submit"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_handoff_action(
        self,
        handler: Callable[[ActivityContext[HandoffActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
    ) -> Callable[[ActivityContext[HandoffActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]: ...

    @overload
    def on_handoff_action(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[HandoffActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]],
        Callable[[ActivityContext[HandoffActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
    ]: ...

    def on_handoff_action(
        self,
        handler: Optional[
            Callable[[ActivityContext[HandoffActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]
        ] = None,
    ) -> (
        Callable[
            [Callable[[ActivityContext[HandoffActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]],
            Callable[[ActivityContext[HandoffActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
        ]
        | Callable[[ActivityContext[HandoffActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]
    ):
        """Register a handoff.action activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[HandoffActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
            ],
        ) -> Callable[[ActivityContext[HandoffActionInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]:
            validate_handler_type(
                self.logger, func, HandoffActionInvokeActivity, "on_handoff_action", "HandoffActionInvokeActivity"
            )
            config = ACTIVITY_ROUTES["handoff.action"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_signin_token_exchange(
        self,
        handler: Callable[
            [ActivityContext[SignInTokenExchangeInvokeActivity]],
            Awaitable[Union[InvokeResponse[TokenExchangeInvokeResponseType], TokenExchangeInvokeResponseType]],
        ],
    ) -> Callable[
        [ActivityContext[SignInTokenExchangeInvokeActivity]],
        Awaitable[Union[InvokeResponse[TokenExchangeInvokeResponseType], TokenExchangeInvokeResponseType]],
    ]: ...

    @overload
    def on_signin_token_exchange(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[SignInTokenExchangeInvokeActivity]],
                Awaitable[Union[InvokeResponse[TokenExchangeInvokeResponseType], TokenExchangeInvokeResponseType]],
            ]
        ],
        Callable[
            [ActivityContext[SignInTokenExchangeInvokeActivity]],
            Awaitable[Union[InvokeResponse[TokenExchangeInvokeResponseType], TokenExchangeInvokeResponseType]],
        ],
    ]: ...

    def on_signin_token_exchange(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[SignInTokenExchangeInvokeActivity]],
                Awaitable[Union[InvokeResponse[TokenExchangeInvokeResponseType], TokenExchangeInvokeResponseType]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[SignInTokenExchangeInvokeActivity]],
                    Awaitable[Union[InvokeResponse[TokenExchangeInvokeResponseType], TokenExchangeInvokeResponseType]],
                ]
            ],
            Callable[
                [ActivityContext[SignInTokenExchangeInvokeActivity]],
                Awaitable[Union[InvokeResponse[TokenExchangeInvokeResponseType], TokenExchangeInvokeResponseType]],
            ],
        ]
        | Callable[
            [ActivityContext[SignInTokenExchangeInvokeActivity]],
            Awaitable[Union[InvokeResponse[TokenExchangeInvokeResponseType], TokenExchangeInvokeResponseType]],
        ]
    ):
        """Register a signin.token-exchange activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[SignInTokenExchangeInvokeActivity]],
                Awaitable[Union[InvokeResponse[TokenExchangeInvokeResponseType], TokenExchangeInvokeResponseType]],
            ],
        ) -> Callable[
            [ActivityContext[SignInTokenExchangeInvokeActivity]],
            Awaitable[Union[InvokeResponse[TokenExchangeInvokeResponseType], TokenExchangeInvokeResponseType]],
        ]:
            validate_handler_type(
                self.logger,
                func,
                SignInTokenExchangeInvokeActivity,
                "on_signin_token_exchange",
                "SignInTokenExchangeInvokeActivity",
            )
            config = ACTIVITY_ROUTES["signin.token-exchange"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_signin_verify_state(
        self,
        handler: Callable[
            [ActivityContext[SignInVerifyStateInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
        ],
    ) -> Callable[[ActivityContext[SignInVerifyStateInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]: ...

    @overload
    def on_signin_verify_state(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[SignInVerifyStateInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]],
        Callable[[ActivityContext[SignInVerifyStateInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
    ]: ...

    def on_signin_verify_state(
        self,
        handler: Optional[
            Callable[[ActivityContext[SignInVerifyStateInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[SignInVerifyStateInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
                ]
            ],
            Callable[[ActivityContext[SignInVerifyStateInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]],
        ]
        | Callable[[ActivityContext[SignInVerifyStateInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]
    ):
        """Register a signin.verify-state activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[SignInVerifyStateInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]
            ],
        ) -> Callable[[ActivityContext[SignInVerifyStateInvokeActivity]], Awaitable[Union[InvokeResponse[None], None]]]:
            validate_handler_type(
                self.logger,
                func,
                SignInVerifyStateInvokeActivity,
                "on_signin_verify_state",
                "SignInVerifyStateInvokeActivity",
            )
            config = ACTIVITY_ROUTES["signin.verify-state"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_card_action(
        self,
        handler: Callable[
            [ActivityContext[AdaptiveCardInvokeActivity]],
            Awaitable[Union[InvokeResponse[AdaptiveCardInvokeResponse], AdaptiveCardInvokeResponse]],
        ],
    ) -> Callable[
        [ActivityContext[AdaptiveCardInvokeActivity]],
        Awaitable[Union[InvokeResponse[AdaptiveCardInvokeResponse], AdaptiveCardInvokeResponse]],
    ]: ...

    @overload
    def on_card_action(
        self,
    ) -> Callable[
        [
            Callable[
                [ActivityContext[AdaptiveCardInvokeActivity]],
                Awaitable[Union[InvokeResponse[AdaptiveCardInvokeResponse], AdaptiveCardInvokeResponse]],
            ]
        ],
        Callable[
            [ActivityContext[AdaptiveCardInvokeActivity]],
            Awaitable[Union[InvokeResponse[AdaptiveCardInvokeResponse], AdaptiveCardInvokeResponse]],
        ],
    ]: ...

    def on_card_action(
        self,
        handler: Optional[
            Callable[
                [ActivityContext[AdaptiveCardInvokeActivity]],
                Awaitable[Union[InvokeResponse[AdaptiveCardInvokeResponse], AdaptiveCardInvokeResponse]],
            ]
        ] = None,
    ) -> (
        Callable[
            [
                Callable[
                    [ActivityContext[AdaptiveCardInvokeActivity]],
                    Awaitable[Union[InvokeResponse[AdaptiveCardInvokeResponse], AdaptiveCardInvokeResponse]],
                ]
            ],
            Callable[
                [ActivityContext[AdaptiveCardInvokeActivity]],
                Awaitable[Union[InvokeResponse[AdaptiveCardInvokeResponse], AdaptiveCardInvokeResponse]],
            ],
        ]
        | Callable[
            [ActivityContext[AdaptiveCardInvokeActivity]],
            Awaitable[Union[InvokeResponse[AdaptiveCardInvokeResponse], AdaptiveCardInvokeResponse]],
        ]
    ):
        """Register a card.action activity handler."""

        def decorator(
            func: Callable[
                [ActivityContext[AdaptiveCardInvokeActivity]],
                Awaitable[Union[InvokeResponse[AdaptiveCardInvokeResponse], AdaptiveCardInvokeResponse]],
            ],
        ) -> Callable[
            [ActivityContext[AdaptiveCardInvokeActivity]],
            Awaitable[Union[InvokeResponse[AdaptiveCardInvokeResponse], AdaptiveCardInvokeResponse]],
        ]:
            validate_handler_type(
                self.logger, func, AdaptiveCardInvokeActivity, "on_card_action", "AdaptiveCardInvokeActivity"
            )
            config = ACTIVITY_ROUTES["card.action"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_invoke(
        self, handler: Callable[[ActivityContext[InvokeActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[InvokeActivity]], Awaitable[None]]: ...

    @overload
    def on_invoke(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[InvokeActivity]], Awaitable[None]]],
        Callable[[ActivityContext[InvokeActivity]], Awaitable[None]],
    ]: ...

    def on_invoke(
        self, handler: Optional[Callable[[ActivityContext[InvokeActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[InvokeActivity]], Awaitable[None]]],
            Callable[[ActivityContext[InvokeActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[InvokeActivity]], Awaitable[None]]
    ):
        """Register a invoke activity handler."""

        def decorator(
            func: Callable[[ActivityContext[InvokeActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[InvokeActivity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, InvokeActivity, "on_invoke", "InvokeActivity")
            config = ACTIVITY_ROUTES["invoke"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_installation_update(
        self, handler: Callable[[ActivityContext[InstallUpdateActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[InstallUpdateActivity]], Awaitable[None]]: ...

    @overload
    def on_installation_update(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[InstallUpdateActivity]], Awaitable[None]]],
        Callable[[ActivityContext[InstallUpdateActivity]], Awaitable[None]],
    ]: ...

    def on_installation_update(
        self, handler: Optional[Callable[[ActivityContext[InstallUpdateActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[InstallUpdateActivity]], Awaitable[None]]],
            Callable[[ActivityContext[InstallUpdateActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[InstallUpdateActivity]], Awaitable[None]]
    ):
        """Register a installation_update activity handler."""

        def decorator(
            func: Callable[[ActivityContext[InstallUpdateActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[InstallUpdateActivity]], Awaitable[None]]:
            validate_handler_type(
                self.logger, func, InstallUpdateActivity, "on_installation_update", "InstallUpdateActivity"
            )
            config = ACTIVITY_ROUTES["installation_update"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_install_add(
        self, handler: Callable[[ActivityContext[InstalledActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[InstalledActivity]], Awaitable[None]]: ...

    @overload
    def on_install_add(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[InstalledActivity]], Awaitable[None]]],
        Callable[[ActivityContext[InstalledActivity]], Awaitable[None]],
    ]: ...

    def on_install_add(
        self, handler: Optional[Callable[[ActivityContext[InstalledActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[InstalledActivity]], Awaitable[None]]],
            Callable[[ActivityContext[InstalledActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[InstalledActivity]], Awaitable[None]]
    ):
        """Register a install.add activity handler."""

        def decorator(
            func: Callable[[ActivityContext[InstalledActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[InstalledActivity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, InstalledActivity, "on_install_add", "InstalledActivity")
            config = ACTIVITY_ROUTES["install.add"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_install_remove(
        self, handler: Callable[[ActivityContext[UninstalledActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[UninstalledActivity]], Awaitable[None]]: ...

    @overload
    def on_install_remove(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[UninstalledActivity]], Awaitable[None]]],
        Callable[[ActivityContext[UninstalledActivity]], Awaitable[None]],
    ]: ...

    def on_install_remove(
        self, handler: Optional[Callable[[ActivityContext[UninstalledActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[UninstalledActivity]], Awaitable[None]]],
            Callable[[ActivityContext[UninstalledActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[UninstalledActivity]], Awaitable[None]]
    ):
        """Register a install.remove activity handler."""

        def decorator(
            func: Callable[[ActivityContext[UninstalledActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[UninstalledActivity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, UninstalledActivity, "on_install_remove", "UninstalledActivity")
            config = ACTIVITY_ROUTES["install.remove"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_typing(
        self, handler: Callable[[ActivityContext[TypingActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[TypingActivity]], Awaitable[None]]: ...

    @overload
    def on_typing(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[TypingActivity]], Awaitable[None]]],
        Callable[[ActivityContext[TypingActivity]], Awaitable[None]],
    ]: ...

    def on_typing(
        self, handler: Optional[Callable[[ActivityContext[TypingActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[TypingActivity]], Awaitable[None]]],
            Callable[[ActivityContext[TypingActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[TypingActivity]], Awaitable[None]]
    ):
        """Register a typing activity handler."""

        def decorator(
            func: Callable[[ActivityContext[TypingActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[TypingActivity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, TypingActivity, "on_typing", "TypingActivity")
            config = ACTIVITY_ROUTES["typing"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_trace(
        self, handler: Callable[[ActivityContext[TraceActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[TraceActivity]], Awaitable[None]]: ...

    @overload
    def on_trace(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[TraceActivity]], Awaitable[None]]],
        Callable[[ActivityContext[TraceActivity]], Awaitable[None]],
    ]: ...

    def on_trace(
        self, handler: Optional[Callable[[ActivityContext[TraceActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[TraceActivity]], Awaitable[None]]],
            Callable[[ActivityContext[TraceActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[TraceActivity]], Awaitable[None]]
    ):
        """Register a trace activity handler."""

        def decorator(
            func: Callable[[ActivityContext[TraceActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[TraceActivity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, TraceActivity, "on_trace", "TraceActivity")
            config = ACTIVITY_ROUTES["trace"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_handoff(
        self, handler: Callable[[ActivityContext[HandoffActivity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[HandoffActivity]], Awaitable[None]]: ...

    @overload
    def on_handoff(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[HandoffActivity]], Awaitable[None]]],
        Callable[[ActivityContext[HandoffActivity]], Awaitable[None]],
    ]: ...

    def on_handoff(
        self, handler: Optional[Callable[[ActivityContext[HandoffActivity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[HandoffActivity]], Awaitable[None]]],
            Callable[[ActivityContext[HandoffActivity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[HandoffActivity]], Awaitable[None]]
    ):
        """Register a handoff activity handler."""

        def decorator(
            func: Callable[[ActivityContext[HandoffActivity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[HandoffActivity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, HandoffActivity, "on_handoff", "HandoffActivity")
            config = ACTIVITY_ROUTES["handoff"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator

    @overload
    def on_activity(
        self, handler: Callable[[ActivityContext[Activity]], Awaitable[None]]
    ) -> Callable[[ActivityContext[Activity]], Awaitable[None]]: ...

    @overload
    def on_activity(
        self,
    ) -> Callable[
        [Callable[[ActivityContext[Activity]], Awaitable[None]]], Callable[[ActivityContext[Activity]], Awaitable[None]]
    ]: ...

    def on_activity(
        self, handler: Optional[Callable[[ActivityContext[Activity]], Awaitable[None]]] = None
    ) -> (
        Callable[
            [Callable[[ActivityContext[Activity]], Awaitable[None]]],
            Callable[[ActivityContext[Activity]], Awaitable[None]],
        ]
        | Callable[[ActivityContext[Activity]], Awaitable[None]]
    ):
        """Register a activity activity handler."""

        def decorator(
            func: Callable[[ActivityContext[Activity]], Awaitable[None]],
        ) -> Callable[[ActivityContext[Activity]], Awaitable[None]]:
            validate_handler_type(self.logger, func, Activity, "on_activity", "Activity")
            config = ACTIVITY_ROUTES["activity"]
            self.router.add_handler(config.selector, func)
            return func

        if handler is not None:
            return decorator(handler)
        return decorator
