@@ -38,6 +38,7 @@ public class InboundMessage extends JsonableBaseObject {
3838
3939 protected static class UrlWrapper extends JsonableBaseObject {
4040 @ JsonProperty ("url" ) protected URI url ;
41+ @ JsonProperty ("name" ) protected String name ;
4142 }
4243
4344 protected static class UrlWrapperWithCaption extends UrlWrapper {
@@ -48,6 +49,10 @@ protected static class Whatsapp extends JsonableBaseObject {
4849 @ JsonProperty ("referral" ) protected Referral referral ;
4950 }
5051
52+ protected static class Origin extends JsonableBaseObject {
53+ @ JsonProperty ("network_code" ) protected String networkCode ;
54+ }
55+
5156 protected InboundMessage () {}
5257
5358 @ JsonAnySetter protected Map <String , Object > unknownProperties ;
@@ -79,6 +84,7 @@ protected InboundMessage() {}
7984 @ JsonProperty ("order" ) protected Order whatsappOrder ;
8085 @ JsonProperty ("usage" ) protected MessageStatus .Usage usage ;
8186 @ JsonProperty ("sms" ) protected SmsInboundMetadata smsMetadata ;
87+ @ JsonProperty ("origin" ) protected Origin origin ;
8288
8389 /**
8490 * This is a catch-all method which encapsulates all fields in the response JSON
@@ -330,6 +336,19 @@ public SmsInboundMetadata getSmsMetadata() {
330336 return smsMetadata ;
331337 }
332338
339+ /**
340+ * If the {@linkplain #getChannel()} is {@linkplain Channel#SMS} or {@linkplain Channel#MMS},
341+ * return the network code from which the message originated (if available).
342+ *
343+ * @return The origin network code if applicable, or {@code null} if unknown.
344+ *
345+ * @since 8.7.0
346+ */
347+ @ JsonIgnore
348+ public String getNetworkCode () {
349+ return origin != null ? origin .networkCode : null ;
350+ }
351+
333352 /**
334353 * If the {@linkplain #getChannel()} is {@linkplain Channel#WHATSAPP} and a content referral is present in
335354 * the message, returns the metadata related to the post or advertisement that the user clicked on.
0 commit comments