Skip to content

Commit 2194200

Browse files
author
Jesus Terrazas
committed
Change model validation to Entity type
1 parent a9799a8 commit 2194200

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import Any, Optional, Type, TypeVar
2+
from microsoft_agents.activity.entity import Entity
23
from microsoft_agents.activity import Activity
34
from .notification_types import NotificationTypes
45
from .email_reference import EmailReference
@@ -21,18 +22,17 @@ def __init__(self, activity: Activity):
2122
entities = self.activity.entities or []
2223
for ent in entities:
2324
etype = ent.type.lower()
24-
payload = getattr(ent, "properties", ent)
2525

2626
if etype == NotificationTypes.EMAIL_NOTIFICATION.lower() and self._email is None:
2727
try:
28-
self._email = EmailReference.model_validate(payload)
28+
self._email = Entity.model_validate(ent)
2929
self._notification_type = NotificationTypes.EMAIL_NOTIFICATION
3030
except Exception:
3131
self._email = None
3232

3333
if etype == NotificationTypes.WPX_COMMENT.lower() and self._wpx_comment is None:
3434
try:
35-
self._wpx_comment = WpxComment.model_validate(payload)
35+
self._wpx_comment = Entity.model_validate(ent)
3636
self._notification_type = NotificationTypes.WPX_COMMENT
3737
except Exception:
3838
self._wpx_comment = None

0 commit comments

Comments
 (0)