diff --git a/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/agent_notification.py b/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/agent_notification.py index a604670c..3c423433 100644 --- a/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/agent_notification.py +++ b/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/agent_notification.py @@ -426,6 +426,75 @@ async def handle_user_deleted(context, state, notification): """ return self.on_lifecycle_notification(AgentLifecycleEvent.USERDELETED, **kwargs) + def on_user_undeleted( + self, **kwargs: Any + ) -> Callable[[AgentHandler], Callable[[TurnContext, TurnState], Awaitable[None]]]: + """Register a handler for user un-deletion lifecycle events. + + This is a convenience decorator that registers a handler specifically for + agentic user identity un-deletion events. + + Args: + **kwargs: Additional keyword arguments passed to the app's add_route method. + + Returns: + A decorator function that registers the handler with the application. + + Example: + ```python + @notifications.on_user_undeleted() + async def handle_user_undeleted(context, state, notification): + print("Agentic user identity un-deleted") + ``` + """ + return self.on_lifecycle_notification(AgentLifecycleEvent.USERUNDELETED, **kwargs) + + def on_user_updated( + self, **kwargs: Any + ) -> Callable[[AgentHandler], Callable[[TurnContext, TurnState], Awaitable[None]]]: + """Register a handler for user updated lifecycle events. + + This is a convenience decorator that registers a handler specifically for + agentic user identity updated events. + + Args: + **kwargs: Additional keyword arguments passed to the app's add_route method. + + Returns: + A decorator function that registers the handler with the application. + + Example: + ```python + @notifications.on_user_updated() + async def handle_user_updated(context, state, notification): + print("Agentic user identity updated") + ``` + """ + return self.on_lifecycle_notification(AgentLifecycleEvent.USERUPDATED, **kwargs) + + def on_user_manager_updated( + self, **kwargs: Any + ) -> Callable[[AgentHandler], Callable[[TurnContext, TurnState], Awaitable[None]]]: + """Register a handler for user manager updated lifecycle events. + + This is a convenience decorator that registers a handler specifically for + agentic user manager updated events. + + Args: + **kwargs: Additional keyword arguments passed to the app's add_route method. + + Returns: + A decorator function that registers the handler with the application. + + Example: + ```python + @notifications.on_user_manager_updated() + async def handle_user_manager_updated(context, state, notification): + print("Agentic user manager updated") + ``` + """ + return self.on_lifecycle_notification(AgentLifecycleEvent.USERMANAGERUPDATED, **kwargs) + @staticmethod def _normalize_subchannel(value: str | AgentSubChannel | None) -> str: """Normalize a subchannel value to a lowercase string. diff --git a/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_lifecycle_event.py b/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_lifecycle_event.py index 9b4b15d8..1877a01b 100644 --- a/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_lifecycle_event.py +++ b/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_lifecycle_event.py @@ -15,8 +15,14 @@ class AgentLifecycleEvent(str, Enum): USERWORKLOADONBOARDINGUPDATED: Event triggered when a user's workload onboarding status is updated. USERDELETED: Event triggered when an agentic user identity is deleted. + USERUNDELETED: Event triggered when an agentic user identity is un-deleted. + USERUPDATED: Event triggered when an agentic user identity is updated. + USERMANAGERUPDATED: Event triggered when an agentic user's manager is updated. """ USERCREATED = "agenticuseridentitycreated" USERWORKLOADONBOARDINGUPDATED = "agenticuserworkloadonboardingupdated" - USERDELETED = "agenticuseridentitydeleted" + USERDELETED = "agenticuserdeleted" + USERUNDELETED = "agenticuserundeleted" + USERUPDATED = "agenticuseridentityupdated" + USERMANAGERUPDATED = "agenticusermanagerupdated"