Skip to content

Commit 7e02172

Browse files
Merge pull request #61 from Bandwidth/DX-3120
DX-3120 MessagingSettings
2 parents 754a852 + e5233b2 commit 7e02172

File tree

5 files changed

+109
-1
lines changed

5 files changed

+109
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.bandwidth.iris.sdk.model;
2+
3+
import javax.xml.bind.annotation.*;
4+
5+
@XmlRootElement(name = "AssignedNnRoute")
6+
@XmlAccessorType(XmlAccessType.FIELD)
7+
public class AssignedNnRoute extends BaseModel {
8+
9+
@XmlElement(name = "Name")
10+
private String name;
11+
12+
@XmlElement(name = "Nnid")
13+
private String nnid;
14+
15+
16+
public String getName() {
17+
return name;
18+
}
19+
20+
public void setName(String name) {
21+
this.name = name;
22+
}
23+
24+
public String getNnid() {
25+
return nnid;
26+
}
27+
28+
public void setNnid(String nnid) {
29+
this.nnid = nnid;
30+
}
31+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package com.bandwidth.iris.sdk.model;
2+
3+
import javax.xml.bind.annotation.*;
4+
import java.util.List;
5+
6+
@XmlRootElement(name = "MessagingSettings")
7+
@XmlAccessorType(XmlAccessType.FIELD)
8+
public class MessagingSettings extends BaseModel {
9+
10+
@XmlElement(name = "A2pState")
11+
private String a2pState;
12+
13+
@XmlElement(name = "AssignedNnRoute")
14+
private AssignedNnRoute assignedNnRoute;
15+
16+
@XmlElement(name = "CampaignId")
17+
private String campaignId;
18+
19+
@XmlElement(name = "MessageClass")
20+
private String messageClass;
21+
22+
@XmlElement(name = "SmsEnabled")
23+
private String smsEnabled;
24+
25+
26+
public String getA2pState() {
27+
return a2pState;
28+
}
29+
30+
public void setA2pState(String a2pState) {
31+
this.a2pState = a2pState;
32+
}
33+
34+
public AssignedNnRoute getAssignedNnRoute() {
35+
return assignedNnRoute;
36+
}
37+
38+
public void setAssignedNnRoute(AssignedNnRoute assignedNnRoute) {
39+
this.assignedNnRoute = assignedNnRoute;
40+
}
41+
42+
public String getCampaignId() {
43+
return campaignId;
44+
}
45+
46+
public void setCampaignId(String campaignId) {
47+
this.campaignId = campaignId;
48+
}
49+
50+
public String getMessageClass() {
51+
return messageClass;
52+
}
53+
54+
public void setMessageClass(String messageClass) {
55+
this.messageClass = messageClass;
56+
}
57+
58+
public String getSmsEnabled() {
59+
return smsEnabled;
60+
}
61+
62+
public void setSmsEnabled(String smsEnabled) {
63+
this.smsEnabled = smsEnabled;
64+
}
65+
}

src/main/java/com/bandwidth/iris/sdk/model/TelephoneNumberDetails.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public class TelephoneNumberDetails extends TelephoneNumberDetail {
3131
@XmlElement(name = "Lata")
3232
private String lata;
3333

34+
@XmlElement(name = "MessagingSettings")
35+
private MessagingSettings messagingSettings;
36+
3437
@XmlElementWrapper(name = "ServiceTypes")
3538
@XmlElement(name = "ServiceType")
3639
private List<String> serviceTypes = new ArrayList<>();
@@ -99,6 +102,14 @@ public void setLata(String lata) {
99102
this.lata = lata;
100103
}
101104

105+
public MessagingSettings getMessagingSettings() {
106+
return messagingSettings;
107+
}
108+
109+
public void setMessagingSettings(MessagingSettings messagingSettings) {
110+
this.messagingSettings = messagingSettings;
111+
}
112+
102113
public List<String> getServiceTypes() { return serviceTypes; }
103114

104115
public void setServiceTypes(List<String> serviceTypes) { this.serviceTypes = serviceTypes; }

src/test/java/com/bandwidth/iris/sdk/IrisClientTestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ public class IrisClientTestUtils {
648648
" </TelephoneNumberDetails>\n" +
649649
"</TelephoneNumberResponse>";
650650

651-
public static String validTnDetailsResponseXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><TelephoneNumberResponse><TelephoneNumberDetails><City>MOUNT OLIVE</City><Lata>426</Lata><State>NC</State><FullNumber>9195551212</FullNumber><Tier>0</Tier><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName><RateCenter>MOUNTOLIVE</RateCenter><Status>Inservice</Status><AccountId>9900096</AccountId><LastModified>2014-10-14T20:01:53.000Z</LastModified></TelephoneNumberDetails></TelephoneNumberResponse>";
651+
public static String validTnDetailsResponseXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><TelephoneNumberResponse><TelephoneNumberDetails><City>MOUNT OLIVE</City><Lata>426</Lata><State>NC</State><FullNumber>9195551212</FullNumber><Tier>0</Tier><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName><RateCenter>MOUNTOLIVE</RateCenter><Status>Inservice</Status><AccountId>9900096</AccountId><LastModified>2014-10-14T20:01:53.000Z</LastModified><MessagingSettings><SmsEnabled>true</SmsEnabled><MessageClass>UNREGISTERED</MessageClass><A2pState>system_default</A2pState><AssignedNnRoute><Nnid>103775</Nnid><Name>BW A2P - SVR - E151 (103775)</Name></AssignedNnRoute></MessagingSettings></TelephoneNumberDetails></TelephoneNumberResponse>";
652652
public static String validTnRateCenterResponseXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><TelephoneNumberResponse><TelephoneNumberDetails><State>NC</State><RateCenter>MOUNTOLIVE</RateCenter></TelephoneNumberDetails></TelephoneNumberResponse>";
653653
public static String validTnLataResponseXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><TelephoneNumberResponse><TelephoneNumberDetails><Lata>426</Lata></TelephoneNumberDetails></TelephoneNumberResponse>";
654654
public static String validTnSiteResponseXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Site><Id>2858</Id><Name>Test Site</Name></Site>";

src/test/java/com/bandwidth/iris/sdk/TnTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public void testGetTnDetails() throws Exception {
1919
TelephoneNumberDetails details = Tns.getTnDetails(getDefaultClient(), "9195551212");
2020
assertNotNull(details);
2121
assertEquals("9195551212", details.getFullNumber());
22+
assertEquals("103775", details.getMessagingSettings().getAssignedNnRoute().getNnid());
2223
}
2324

2425
@Test

0 commit comments

Comments
 (0)