From 0287632a1cccb1ef39fab760b43427b13f211428 Mon Sep 17 00:00:00 2001 From: Kjetil Valle Date: Tue, 25 Aug 2026 15:54:47 +0200 Subject: [PATCH] Add support for sms-notification-delivered events Adding support for the new DocumentEvent type SMS_NOTIFICATION_DELIVERED, indicating successful sending of SMS notification. These events are not on by default, but needs to be enabled by Digipost admin. --- .../representations/DocumentEventType.java | 1 + .../client/representations/EventMetadata.java | 1 + .../SmsNotificationDeliveredMetadata.java | 37 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 src/main/java/no/digipost/api/client/representations/SmsNotificationDeliveredMetadata.java diff --git a/src/main/java/no/digipost/api/client/representations/DocumentEventType.java b/src/main/java/no/digipost/api/client/representations/DocumentEventType.java index 26bb917d..8a77a4a2 100644 --- a/src/main/java/no/digipost/api/client/representations/DocumentEventType.java +++ b/src/main/java/no/digipost/api/client/representations/DocumentEventType.java @@ -26,6 +26,7 @@ public enum DocumentEventType { EMAIL_MESSAGE_SENT, EMAIL_NOTIFICATION_FAILED, SMS_NOTIFICATION_FAILED, + SMS_NOTIFICATION_DELIVERED, OPENED, MOVE_FILES_FROM_PUBLIC_SECTOR, POSTMARKED, diff --git a/src/main/java/no/digipost/api/client/representations/EventMetadata.java b/src/main/java/no/digipost/api/client/representations/EventMetadata.java index c0b24fe9..2faf7f7d 100644 --- a/src/main/java/no/digipost/api/client/representations/EventMetadata.java +++ b/src/main/java/no/digipost/api/client/representations/EventMetadata.java @@ -27,6 +27,7 @@ EmailDeliveredMetadata.class, EmailNotificationFailedMetadata.class, SmsNotificationFailedMetadata.class, + SmsNotificationDeliveredMetadata.class, FailedPrintMetadata.class, FailedPeppolMetadata.class, PostmarkedMetadata.class diff --git a/src/main/java/no/digipost/api/client/representations/SmsNotificationDeliveredMetadata.java b/src/main/java/no/digipost/api/client/representations/SmsNotificationDeliveredMetadata.java new file mode 100644 index 00000000..7ef16f0b --- /dev/null +++ b/src/main/java/no/digipost/api/client/representations/SmsNotificationDeliveredMetadata.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) Posten Bring AS + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package no.digipost.api.client.representations; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlType; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "sms-notification-delivered-metadata") +public class SmsNotificationDeliveredMetadata extends EventMetadata { + + @XmlAttribute(name = "mobile-number") + public final String mobileNumber; + + public SmsNotificationDeliveredMetadata() { + this(null); + } + + public SmsNotificationDeliveredMetadata(String mobileNumber) { + this.mobileNumber = mobileNumber; + } +}