diff --git a/src/Notification/Microsoft.Agents.A365.Notifications/AgentNotification.cs b/src/Notification/Microsoft.Agents.A365.Notifications/AgentNotification.cs index 814aed84..10aa8dcc 100644 --- a/src/Notification/Microsoft.Agents.A365.Notifications/AgentNotification.cs +++ b/src/Notification/Microsoft.Agents.A365.Notifications/AgentNotification.cs @@ -159,6 +159,9 @@ private static bool IsValidLifecycleEvent(string lifecycleEvent) Events.AgenticUserIdentityCreated => true, Events.AgenticUserWorkloadOnboardingUpdated => true, Events.AgenticUserDeleted => true, + Events.AgenticUserUndeleted => true, + Events.AgenticUserIdentityUpdated => true, + Events.AgenticUserManagerUpdated => true, _ => false, }; } @@ -287,6 +290,45 @@ public static void OnAgenticUserDeletedNotification(this AgentApplication app, A a365.OnLifecycleNotification(Events.AgenticUserDeleted, routeHandler, rank, autoSignInHandlers); }); + /// + /// Registers a handler for agentic user undeleted lifecycle notifications. + /// + /// The agent application to extend. + /// The handler to invoke when a notification is received. + /// The route priority rank (default is 32767). + /// Optional array of auto sign-in handlers. + public static void OnAgenticUserUndeletedNotification(this AgentApplication app, AgentNotificationHandler routeHandler, ushort rank = 32767, string[] autoSignInHandlers = null!) => + app.RegisterExtension(new AgentNotification(app), a365 => + { + a365.OnLifecycleNotification(Events.AgenticUserUndeleted, routeHandler, rank, autoSignInHandlers); + }); + + /// + /// Registers a handler for agentic user identity updated lifecycle notifications. + /// + /// The agent application to extend. + /// The handler to invoke when a notification is received. + /// The route priority rank (default is 32767). + /// Optional array of auto sign-in handlers. + public static void OnAgenticUserIdentityUpdatedNotification(this AgentApplication app, AgentNotificationHandler routeHandler, ushort rank = 32767, string[] autoSignInHandlers = null!) => + app.RegisterExtension(new AgentNotification(app), a365 => + { + a365.OnLifecycleNotification(Events.AgenticUserIdentityUpdated, routeHandler, rank, autoSignInHandlers); + }); + + /// + /// Registers a handler for agentic user manager updated lifecycle notifications. + /// + /// The agent application to extend. + /// The handler to invoke when a notification is received. + /// The route priority rank (default is 32767). + /// Optional array of auto sign-in handlers. + public static void OnAgenticUserManagerUpdatedNotification(this AgentApplication app, AgentNotificationHandler routeHandler, ushort rank = 32767, string[] autoSignInHandlers = null!) => + app.RegisterExtension(new AgentNotification(app), a365 => + { + a365.OnLifecycleNotification(Events.AgenticUserManagerUpdated, routeHandler, rank, autoSignInHandlers); + }); + /// /// Creates a reply Activity containing an entity populated with the provided HTML body. /// diff --git a/src/Notification/Microsoft.Agents.A365.Notifications/Constants.cs b/src/Notification/Microsoft.Agents.A365.Notifications/Constants.cs index 98204251..c8d75f1d 100644 --- a/src/Notification/Microsoft.Agents.A365.Notifications/Constants.cs +++ b/src/Notification/Microsoft.Agents.A365.Notifications/Constants.cs @@ -58,5 +58,20 @@ public class Events /// The event name for agentic user deletion /// public const string AgenticUserDeleted = "agenticUserDeleted"; + + /// + /// The event name for agentic user undeletion. + /// + public const string AgenticUserUndeleted = "agenticUserUndeleted"; + + /// + /// The event name for agentic user identity update + /// + public const string AgenticUserIdentityUpdated = "agenticUserIdentityUpdated"; + + /// + /// The event name for agentic user manager update + /// + public const string AgenticUserManagerUpdated = "agenticUserManagerUpdated"; } }