diff --git a/android_sms_gateway/domain.py b/android_sms_gateway/domain.py index f8951cd..07df9e4 100644 --- a/android_sms_gateway/domain.py +++ b/android_sms_gateway/domain.py @@ -202,6 +202,8 @@ class Webhook: """The URL the webhook will be sent to.""" event: WebhookEvent """The type of event the webhook is triggered for.""" + device_id: t.Optional[str] = None + """The unique identifier of the device the webhook is associated with.""" @classmethod def from_dict(cls, payload: t.Dict[str, t.Any]) -> "Webhook": @@ -215,6 +217,7 @@ def from_dict(cls, payload: t.Dict[str, t.Any]) -> "Webhook": """ return cls( id=payload.get("id"), + device_id=payload.get("deviceId", None), url=payload["url"], event=WebhookEvent(payload["event"]), ) @@ -227,6 +230,7 @@ def asdict(self) -> t.Dict[str, t.Any]: """ return { "id": self.id, + "deviceId": self.device_id, "url": self.url, "event": self.event.value, }