Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,121 @@ 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)
Comment thread
gwharris7 marked this conversation as resolved.

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)

def on_user_enabled(
self, **kwargs: Any
) -> Callable[[AgentHandler], Callable[[TurnContext, TurnState], Awaitable[None]]]:
"""Register a handler for user enabled lifecycle events.

This is a convenience decorator that registers a handler specifically for
agentic user enabled 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_enabled()
async def handle_user_enabled(context, state, notification):
print("Agentic user enabled")
```
"""
return self.on_lifecycle_notification(AgentLifecycleEvent.USERENABLED, **kwargs)

def on_user_disabled(
self, **kwargs: Any
) -> Callable[[AgentHandler], Callable[[TurnContext, TurnState], Awaitable[None]]]:
"""Register a handler for user disabled lifecycle events.

This is a convenience decorator that registers a handler specifically for
agentic user disabled 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_disabled()
async def handle_user_disabled(context, state, notification):
print("Agentic user disabled")
```
"""
return self.on_lifecycle_notification(AgentLifecycleEvent.USERDISABLED, **kwargs)

@staticmethod
def _normalize_subchannel(value: str | AgentSubChannel | None) -> str:
"""Normalize a subchannel value to a lowercase string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ 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.
USERENABLED: Event triggered when an agentic user is enabled.
USERDISABLED: Event triggered when an agentic user is disabled.
"""

USERCREATED = "agenticuseridentitycreated"
USERWORKLOADONBOARDINGUPDATED = "agenticuserworkloadonboardingupdated"
USERDELETED = "agenticuseridentitydeleted"
USERDELETED = "agenticuserdeleted"
USERUNDELETED = "agenticuserundeleted"
Comment thread
gwharris7 marked this conversation as resolved.
USERUPDATED = "agenticuseridentityupdated"
USERMANAGERUPDATED = "agenticusermanagerupdated"
Comment thread
eddie-lee-msft marked this conversation as resolved.
USERENABLED = "agenticuserenabled"
USERDISABLED = "agenticuserdisabled"
Loading