Skip to content

Commit 46d0a7c

Browse files
Terminal API new Event Types (#1501)
* Add NetworkConnected and NetworkDisconnected * Edit event description * Update src/main/java/com/adyen/model/nexo/EventToNotifyType.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update src/main/java/com/adyen/model/nexo/EventToNotifyType.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent ae24225 commit 46d0a7c

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/main/java/com/adyen/model/nexo/EventToNotifyType.java

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
* &lt;enumeration value="CardInserted"/&gt;
3131
* &lt;enumeration value="CardRemoved"/&gt;
3232
* &lt;enumeration value="Reject"/&gt;
33+
* &lt;enumeration value="NetworkConnected"/&gt;
34+
* &lt;enumeration value="NetworkDisconnected"/&gt;
3335
* &lt;/restriction&gt;
3436
* &lt;/simpleType&gt;
3537
* </pre>
@@ -141,7 +143,22 @@ public enum EventToNotifyType {
141143
@Schema(
142144
description =
143145
"A message request is rejected. An error explanation and the message in error have to be put in the EventDetails data element.")
144-
REJECT("Reject");
146+
REJECT("Reject"),
147+
148+
/**
149+
* The terminal has established a network connection to the POS and is online.
150+
*/
151+
@XmlEnumValue("NetworkConnected")
152+
@Schema(description = "The terminal is connected to the POS over the Internet.")
153+
NETWORK_CONNECTED("NetworkConnected"),
154+
155+
/**
156+
* The terminal has lost its network connection to the POS and is offline.
157+
*/
158+
@XmlEnumValue("NetworkDisconnected")
159+
@Schema(description = "The terminal is disconnected from the POS.")
160+
NETWORK_DISCONNECTED("NetworkDisconnected");
161+
145162
private final String value;
146163

147164
EventToNotifyType(String v) {
@@ -165,8 +182,8 @@ public String value() {
165182
*/
166183
public static EventToNotifyType fromValue(String v) {
167184
return Arrays.stream(values())
168-
.filter(s -> s.value.equals(v))
169-
.findFirst()
170-
.orElseThrow(() -> new IllegalArgumentException(v));
185+
.filter(s -> s.value.equals(v))
186+
.findFirst()
187+
.orElseThrow(() -> new IllegalArgumentException(v));
171188
}
172189
}

0 commit comments

Comments
 (0)