diff --git a/README.md b/README.md index 5d42425..0c3821c 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ export BANDWIDTH_IRIS_URL=https://dashboard.bandwidth.com ``` -## API Objects +## API Objects ### General principles When fetching objects from the API, it will always return an object that has the client instantiated so that you can call dependent methods as well as update, delete. @@ -120,7 +120,7 @@ for(CoveredRateCenter rc : rateCenters){ ``` -## Disconnect Numbers +## Disconnect Numbers The Disconnect object is used to disconnect numbers from an account. Creates a disconnect order that can be tracked ### Create Disconnect @@ -327,7 +327,7 @@ peer.moveTns(sipPeerTelephoneNumbers); ## Sites ### Create A Site -A site is what is called Location in the web UI. +A site is what is called Location in the web UI. ```Java Site s = new Site(); s.setName("My New Site"); @@ -438,10 +438,8 @@ sub.setFirstName("Band"); sub.setLastName("Width"); sub.setServiceAddress(address); -TelephoneNumber tn1 = new TelephoneNumber(); -tn1.setTelephoneNumber("9195551234"); -List telephoneNumberList = new ArrayList(); -telephoneNumberList.add(tn1); +List telephoneNumberList = new ArrayList(); +telephoneNumberList.add("9195551234"); order.setSiteId(14480); order.setSipPeer(522211); @@ -452,7 +450,7 @@ order.setLoaAuthorizingPerson("Bandwidth"); ImportTnOrderResponse response = ImportTnOrder.Create(client, order ); ``` -### List ImportTnOrders +### List ImportTnOrders ```Java Map query = new HashMap<>(); @@ -473,18 +471,21 @@ ImportTnOrder response = ImportTnOrder.Get(client, orderId ); OrderHistoryWrapper response = ImportTnOrder.GetHistory(client, orderId ); ``` -## RemoveImportedTnOrders +## RemoveImportedTnOrders ### Create RemoveImportedTnOrder ```Java +List tnList = new ArrayList(); +telephoneNumberList.add("9195551234"); + RemoveImportedTnOrder order = new RemoveImportedTnOrder(); order.setTelephoneNumberList( tnList ); RemoveImportedTnOrderResponse response = RemoveImportedTnOrder.Create(client, order); ``` -### List RemoveImportedTnOrders +### List RemoveImportedTnOrders ```Java Map query = new HashMap<>(); @@ -505,7 +506,7 @@ RemoveImportedTnOrder response = RemoveImportedTnOrder.Get(client, orderId); OrderHistoryWrapper response = RemoveImportedTnOrder.GetHistory(client, orderId); ``` -## ImportTnChecker +## ImportTnChecker ### Check Importability of Tns @@ -516,9 +517,9 @@ payload.setTelephoneNumberList( tnList ); ImportTnCheckerResponse response = ImportTnChecker.Check(client, payload); ``` -## Csr Order +## Csr Order -### Create Csr +### Create Csr ```Java Csr csr = new Csr(); @@ -542,7 +543,7 @@ csr.setCity("Raleigh"); CsrResponse response = Csr.Replace(client, orderId, csr); ``` -### Get Csr Notes +### Get Csr Notes ```Java Notes response = Csr.GetNotes(client, orderId); @@ -566,9 +567,9 @@ note.setDescription("This is a csr note"); IrisResponse response = Csr.UpdateNote(client, orderId, noteId, note ); ``` -## Emergency Notification +## Emergency Notification -### Create Recipients +### Create Recipients ```java EmergencyNotificationRecipient recipient = new EmergencyNotificationRecipient(); recipient.setEmailAddress("test@example.com"); @@ -576,7 +577,7 @@ recipient.setEmailAddress("test@example.com"); EmergencyNotificationRecipientsResponse response = EmergencyNotification.createRecipients(client, recipient); ``` -### List Recipients +### List Recipients ```java Map query = new HashMap(); query.add("ModifiedByUser", "jgilmore"); @@ -589,7 +590,7 @@ EmergencyNotificationRecipientsResponse response = EmergencyNotification.listRec EmergencyNotificationRecipientsResponse response = EmergencyNotification.getRecipients(client, recipientsId); ``` -### Replace Recipients +### Replace Recipients ```java EmergencyNotificationRecipient recipient = new EmergencyNotificationRecipient(); recipient.setEmailAddress("test@example.com"); @@ -640,7 +641,7 @@ EmergencyNotificationGroupsResponse response = EmergencyNotification.getGroups(c EmergencyNotificationEndpointOrderResponse response = EmergencyNotification.createEndpointOrder(client, new EmergencyNotificationEndpointOrder()); ``` -### List Endpoint Orders +### List Endpoint Orders ```java EmergencyNotificationEndpointOrderResponse response = EmergencyNotification.listEndpointOrders(client, query); ``` @@ -650,7 +651,7 @@ EmergencyNotificationEndpointOrderResponse response = EmergencyNotification.list EmergencyNotificationEndpointOrderResponse response = EmergencyNotification.getEndpointOrder(client, orderId); ``` -## Aeuis +## Aeuis ### Get Aeui @@ -659,7 +660,7 @@ AlternateEndUserIdentifierResponse response = Aeui.get(client, id); ``` ### List Aeuis -```java +```java AlternateEndUserIdentifiersResponse response = Aeui.list(client, query); ``` diff --git a/src/main/java/com/bandwidth/iris/sdk/model/ImportTnOrder.java b/src/main/java/com/bandwidth/iris/sdk/model/ImportTnOrder.java index dbc5afa..dde400d 100644 --- a/src/main/java/com/bandwidth/iris/sdk/model/ImportTnOrder.java +++ b/src/main/java/com/bandwidth/iris/sdk/model/ImportTnOrder.java @@ -43,8 +43,9 @@ public class ImportTnOrder extends BaseModel { @XmlElement(name = "LoaAuthorizingPerson") private String loaAuthorizingPerson; - @XmlElement(name = "TelephoneNumbers") - private List telephoneNumberList; + @XmlElementWrapper(name = "TelephoneNumbers") + @XmlElement(name = "TelephoneNumber") + private List telephoneNumberList; @XmlElement(name="ProcessingStatus") private String processingStatus; @@ -173,11 +174,11 @@ public void setLoaAuthorizingPerson(String loaAuthorizingPerson) { this.loaAuthorizingPerson = loaAuthorizingPerson; } - public List getTelephoneNumberList() { + public List getTelephoneNumberList() { return telephoneNumberList; } - public void setTelephoneNumberList(List telephoneNumberList) { + public void setTelephoneNumberList(List telephoneNumberList) { this.telephoneNumberList = telephoneNumberList; } diff --git a/src/main/java/com/bandwidth/iris/sdk/model/RemoveImportedTnOrder.java b/src/main/java/com/bandwidth/iris/sdk/model/RemoveImportedTnOrder.java index f3e445d..8069351 100644 --- a/src/main/java/com/bandwidth/iris/sdk/model/RemoveImportedTnOrder.java +++ b/src/main/java/com/bandwidth/iris/sdk/model/RemoveImportedTnOrder.java @@ -13,21 +13,29 @@ public class RemoveImportedTnOrder extends BaseModel{ @XmlElement(name = "CustomerOrderId") private String customerOrderId; + @XmlElement(name = "OrderCreateDate") private String orderCreateDate; + @XmlElement(name= "AccountId") private String accountId; + @XmlElement(name = "CreatedByUser") private String createdByUser; + @XmlElement(name = "OrderId") private String orderId; + @XmlElement(name = "LastModifiedDate") private String lastModifiedDate; + @XmlElementWrapper(name = "TelephoneNumbers") @XmlElement(name = "TelephoneNumber") - private List telephoneNumberList; + private List telephoneNumberList; + @XmlElement(name = "ProcessingStatus") private String processingStatus; + @XmlElementWrapper(name = "Errors") @XmlElement(name = "Error") private List errors; @@ -97,11 +105,11 @@ public void setLastModifiedDate(String lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } - public List getTelephoneNumberList() { + public List getTelephoneNumberList() { return telephoneNumberList; } - public void setTelephoneNumberList(List telephoneNumberList) { + public void setTelephoneNumberList(List telephoneNumberList) { this.telephoneNumberList = telephoneNumberList; } diff --git a/src/main/java/com/bandwidth/iris/sdk/model/TelephoneNumber.java b/src/main/java/com/bandwidth/iris/sdk/model/TelephoneNumber.java index bc21be4..97f2812 100644 --- a/src/main/java/com/bandwidth/iris/sdk/model/TelephoneNumber.java +++ b/src/main/java/com/bandwidth/iris/sdk/model/TelephoneNumber.java @@ -4,6 +4,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; + import java.util.Date; @XmlRootElement(name = "TelephoneNumber") @@ -24,14 +25,19 @@ public class TelephoneNumber { @XmlElement(name = "State") protected String state; + @XmlElement(name = "RateCenter") protected String rateCenter; + @XmlElement(name = "Tier") private String tier; + @XmlElement(name = "VendorId") private String vendorId; + @XmlElement(name = "VendorName") private String vendorName; + @XmlElement(name = "Status") private String status; @@ -50,8 +56,8 @@ public String getFullNumber() { public void setFullNumber(String fullNumber) { this.fullNumber = fullNumber; - } - + } + public String getTelephoneNumber() { return telephoneNumber; } diff --git a/src/test/java/com/bandwidth/iris/sdk/ImportTnOrderTests.java b/src/test/java/com/bandwidth/iris/sdk/ImportTnOrderTests.java index b111b91..54c7c57 100644 --- a/src/test/java/com/bandwidth/iris/sdk/ImportTnOrderTests.java +++ b/src/test/java/com/bandwidth/iris/sdk/ImportTnOrderTests.java @@ -39,10 +39,8 @@ public void TestCreate() throws Exception { sub.setLastName("Width"); sub.setServiceAddress(address); - TelephoneNumber tn1 = new TelephoneNumber(); - tn1.setTelephoneNumber("9195551234"); - List telephoneNumberList = new ArrayList(); - telephoneNumberList.add(tn1); + List telephoneNumberList = new ArrayList(); + telephoneNumberList.add("9195551234"); order.setSiteId(14480); order.setSipPeer(522211);