Skip to content
Merged
Changes from 1 commit
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
@@ -1,4 +1,5 @@
from typing import Any, Optional, Type, TypeVar
Comment thread
JesuTerraz marked this conversation as resolved.
from microsoft_agents.activity.entity import Entity
from microsoft_agents.activity import Activity
from .notification_types import NotificationTypes
from .email_reference import EmailReference
Expand All @@ -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)
Comment thread
JesuTerraz marked this conversation as resolved.
Outdated
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)
Comment thread
JesuTerraz marked this conversation as resolved.
Outdated
self._notification_type = NotificationTypes.WPX_COMMENT
except Exception:
self._wpx_comment = None
Expand Down
Loading