From 2194200125c515a2fc64caa9d6a22e6764cd9cfb Mon Sep 17 00:00:00 2001 From: Jesus Terrazas Date: Thu, 13 Nov 2025 10:19:53 -0800 Subject: [PATCH 1/2] Change model validation to Entity type --- .../notifications/models/agent_notification_activity.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py b/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py index a4e51a32..03ab49f6 100644 --- a/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py +++ b/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py @@ -1,4 +1,5 @@ from typing import Any, Optional, Type, TypeVar +from microsoft_agents.activity.entity import Entity from microsoft_agents.activity import Activity from .notification_types import NotificationTypes from .email_reference import EmailReference @@ -21,18 +22,17 @@ def __init__(self, activity: Activity): entities = self.activity.entities or [] for ent in entities: etype = ent.type.lower() - payload = getattr(ent, "properties", ent) if etype == NotificationTypes.EMAIL_NOTIFICATION.lower() and self._email is None: try: - self._email = EmailReference.model_validate(payload) + self._email = Entity.model_validate(ent) self._notification_type = NotificationTypes.EMAIL_NOTIFICATION except Exception: self._email = None if etype == NotificationTypes.WPX_COMMENT.lower() and self._wpx_comment is None: try: - self._wpx_comment = WpxComment.model_validate(payload) + self._wpx_comment = Entity.model_validate(ent) self._notification_type = NotificationTypes.WPX_COMMENT except Exception: self._wpx_comment = None From e0e7418e65732471286f1d9a802fe09dfd95491a Mon Sep 17 00:00:00 2001 From: Jesus Terrazas Date: Thu, 13 Nov 2025 10:53:14 -0800 Subject: [PATCH 2/2] revent to retrieving "additional_properties" --- .../notifications/models/agent_notification_activity.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py b/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py index 03ab49f6..c2de5e77 100644 --- a/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py +++ b/libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py @@ -1,5 +1,4 @@ from typing import Any, Optional, Type, TypeVar -from microsoft_agents.activity.entity import Entity from microsoft_agents.activity import Activity from .notification_types import NotificationTypes from .email_reference import EmailReference @@ -22,17 +21,18 @@ def __init__(self, activity: Activity): entities = self.activity.entities or [] for ent in entities: etype = ent.type.lower() + payload = getattr(ent, "additional_properties", ent) if etype == NotificationTypes.EMAIL_NOTIFICATION.lower() and self._email is None: try: - self._email = Entity.model_validate(ent) + self._email = EmailReference.model_validate(payload) self._notification_type = NotificationTypes.EMAIL_NOTIFICATION except Exception: self._email = None if etype == NotificationTypes.WPX_COMMENT.lower() and self._wpx_comment is None: try: - self._wpx_comment = Entity.model_validate(ent) + self._wpx_comment = WpxComment.model_validate(payload) self._notification_type = NotificationTypes.WPX_COMMENT except Exception: self._wpx_comment = None