Skip to content

Commit

Permalink
Merge pull request #55 from Bandwidth/DX-2867
Browse files Browse the repository at this point in the history
DX-2867 Update `ImportTnOrder` Models
  • Loading branch information
ajrice6713 authored Sep 27, 2022
2 parents 9ae6e2c + 1cdd44e commit 5430540
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ target

# Eclipse
.settings/

# VS Code
.vscode/
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,31 @@ ImportTnOrder order = new ImportTnOrder();
order.setSiteId(100);
order.setSipPeer(303);

ServiceAddress address = new ServiceAddress();
address.setHouseNumber("123");
address.setStreetName("Main st");
address.setCity("Raleigh");
address.setStateCode("NC");
address.setZip("27606");

Subscriber sub = new Subscriber();
sub.setBusinessName("test business llc");
sub.setName("Bandwidth");
sub.setFirstName("Band");
sub.setLastName("Width");
sub.setServiceAddress(address);

TelephoneNumber tn1 = new TelephoneNumber();
tn1.setTelephoneNumber("9195551234");
List<TelephoneNumber> telephoneNumberList = new ArrayList<TelephoneNumber>();
telephoneNumberList.add(tn1);

order.setSiteId(14480);
order.setSipPeer(522211);
order.setTelephoneNumberList(telephoneNumberList);
order.setSubscriber(sub);
order.setLoaAuthorizingPerson("Bandwidth");

ImportTnOrderResponse response = ImportTnOrder.Create(client, order );
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,15 @@ public ImportTnOrder getImportTnOrder() {
public void setImportTnOrder(ImportTnOrder importTnOrder) {
this.importTnOrder = importTnOrder;
}

@XmlElement(name = "ResponseStatus")
private ResponseStatus responseStatus;

public ResponseStatus getResponseStatus() {
return responseStatus;
}

public void setResponseStatus(ResponseStatus responseStatus) {
this.responseStatus = responseStatus;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name="RemoveImportedTnOrderResponse")
@XmlRootElement(name="RemoveImportedTnOrdersResponse")
@XmlAccessorType(XmlAccessType.FIELD)
public class RemoveImportedTnOrderResponse {

Expand All @@ -19,4 +19,15 @@ public RemoveImportedTnOrder getRemoveImportedTnOrder() {
public void setRemoveImportedTnOrder(RemoveImportedTnOrder removeImportedTnOrder) {
this.removeImportedTnOrder = removeImportedTnOrder;
}

@XmlElement(name = "ResponseStatus")
private ResponseStatus responseStatus;

public ResponseStatus getResponseStatus() {
return responseStatus;
}

public void setResponseStatus(ResponseStatus responseStatus) {
this.responseStatus = responseStatus;
}
}
11 changes: 11 additions & 0 deletions src/main/java/com/bandwidth/iris/sdk/model/TelephoneNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public class TelephoneNumber {
@XmlElement(name = "FullNumber")
protected String fullNumber;

@XmlElement(name = "TelephoneNumber")
protected String telephoneNumber;

@XmlElement(name = "City")
protected String city;

Expand Down Expand Up @@ -47,6 +50,14 @@ public String getFullNumber() {

public void setFullNumber(String fullNumber) {
this.fullNumber = fullNumber;
}

public String getTelephoneNumber() {
return telephoneNumber;
}

public void setTelephoneNumber(String telephoneNumber) {
this.telephoneNumber = telephoneNumber;
}

public String getCity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@ public TnOptionOrder getTnOptionOrder() {
public void setTnOptionOrder(TnOptionOrder tnOptionOrder) {
this.tnOptionOrder = tnOptionOrder;
}

@XmlElement(name = "ResponseStatus")
private ResponseStatus responseStatus;

public ResponseStatus getResponseStatus() {
return responseStatus;
}

public void setResponseStatus(ResponseStatus responseStatus) {
this.responseStatus = responseStatus;
}
}
26 changes: 26 additions & 0 deletions src/test/java/com/bandwidth/iris/sdk/ImportTnOrderTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.junit.Test;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import static com.github.tomakehurst.wiremock.client.WireMock.*;
Expand All @@ -24,6 +25,31 @@ public void TestCreate() throws Exception {

ImportTnOrder order = new ImportTnOrder();

ServiceAddress address = new ServiceAddress();
address.setHouseNumber("123");
address.setStreetName("Main st");
address.setCity("Raleigh");
address.setStateCode("NC");
address.setZip("27606");

Subscriber sub = new Subscriber();
sub.setBusinessName("test business llc");
sub.setName("Bandwidth");
sub.setFirstName("Band");
sub.setLastName("Width");
sub.setServiceAddress(address);

TelephoneNumber tn1 = new TelephoneNumber();
tn1.setTelephoneNumber("9195551234");
List<TelephoneNumber> telephoneNumberList = new ArrayList<TelephoneNumber>();
telephoneNumberList.add(tn1);

order.setSiteId(14480);
order.setSipPeer(522211);
order.setTelephoneNumberList(telephoneNumberList);
order.setSubscriber(sub);
order.setLoaAuthorizingPerson("Bandwidth");

ImportTnOrdersResponse response = ImportTnOrder.Create(getDefaultClient(), order );
ImportTnOrder tnOrder = response.getImportTnOrder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public class IrisClientTestUtils {
* RemoveImportedTnOrders
*/
public static String removeImportedTnOrder = "<RemoveImportedTnOrder><CustomerOrderId>custom string</CustomerOrderId><OrderCreateDate>2020-02-03T18:08:44.199Z</OrderCreateDate><AccountId>9900778</AccountId><CreatedByUser>jmulford-api</CreatedByUser><OrderId>5bb3b642-cbbb-4438-9a44-56069550d603</OrderId><LastModifiedDate>2020-02-03T18:08:44.256Z</LastModifiedDate><TelephoneNumbers><TelephoneNumber>5554443333</TelephoneNumber><TelephoneNumber>5553332222</TelephoneNumber></TelephoneNumbers><ProcessingStatus>FAILED</ProcessingStatus><Errors><Error><Code>5158</Code><Description>Telephone number hasn't been previously imported.</Description><TelephoneNumbers><TelephoneNumber>5554443333</TelephoneNumber><TelephoneNumber>5553332222</TelephoneNumber></TelephoneNumbers></Error></Errors></RemoveImportedTnOrder>";
public static String removeImportedTnOrderResponse = "<RemoveImportedTnOrderResponse>" + removeImportedTnOrder + "</RemoveImportedTnOrderResponse>";
public static String removeImportedTnOrderResponse = "<RemoveImportedTnOrdersResponse>" + removeImportedTnOrder + "</RemoveImportedTnOrdersResponse>";
public static String removeImportedTnorders = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><RemoveImportedTnOrders><TotalCount>9</TotalCount><RemoveImportedTnOrderSummary><accountId>9900778</accountId><CountOfTNs>1</CountOfTNs><userId>dtolb</userId><lastModifiedDate>2020-02-04T18:01:54.786Z</lastModifiedDate><OrderDate>2020-02-04T18:01:54.434Z</OrderDate><OrderType>remove_imported_tn_orders</OrderType><OrderStatus>COMPLETE</OrderStatus><OrderId>7a992c85-d164-46df-97c4-dac6030ec952</OrderId></RemoveImportedTnOrderSummary><RemoveImportedTnOrderSummary><accountId>9900778</accountId><CountOfTNs>1</CountOfTNs><userId>dtolb</userId><lastModifiedDate>2020-02-04T17:48:45.340Z</lastModifiedDate><OrderDate>2020-02-04T17:48:45.033Z</OrderDate><OrderType>remove_imported_tn_orders</OrderType><OrderStatus>COMPLETE</OrderStatus><OrderId>0053a536-f3fb-4ac9-aa08-6fc22abe8c49</OrderId></RemoveImportedTnOrderSummary><RemoveImportedTnOrderSummary><accountId>9900778</accountId><CountOfTNs>2</CountOfTNs><CustomerOrderId>custom string</CustomerOrderId><userId>jmulford-api</userId><lastModifiedDate>2020-02-03T18:08:44.256Z</lastModifiedDate><OrderDate>2020-02-03T18:08:44.199Z</OrderDate><OrderType>remove_imported_tn_orders</OrderType><OrderStatus>FAILED</OrderStatus><OrderId>5bb3b642-cbbb-4438-9a44-56069550d603</OrderId></RemoveImportedTnOrderSummary><RemoveImportedTnOrderSummary><accountId>9900778</accountId><CountOfTNs>2</CountOfTNs><CustomerOrderId>custom string</CustomerOrderId><userId>jmulford-api</userId><lastModifiedDate>2020-02-03T18:08:19.955Z</lastModifiedDate><OrderDate>2020-02-03T18:08:19.927Z</OrderDate><OrderType>remove_imported_tn_orders</OrderType><OrderStatus>FAILED</OrderStatus><OrderId>384ff500-ff33-4580-a910-45eff3d51f0d</OrderId></RemoveImportedTnOrderSummary><RemoveImportedTnOrderSummary><accountId>9900778</accountId><CountOfTNs>2</CountOfTNs><CustomerOrderId>custom string</CustomerOrderId><userId>jmulford-api</userId><lastModifiedDate>2020-02-03T15:51:14.496Z</lastModifiedDate><OrderDate>2020-02-03T15:51:14.471Z</OrderDate><OrderType>remove_imported_tn_orders</OrderType><OrderStatus>FAILED</OrderStatus><OrderId>20943d4a-600c-44e0-ac97-dd3d6f1f2af5</OrderId></RemoveImportedTnOrderSummary><RemoveImportedTnOrderSummary><accountId>9900778</accountId><CountOfTNs>2</CountOfTNs><CustomerOrderId>custom string</CustomerOrderId><userId>jmulford-api</userId><lastModifiedDate>2020-02-03T15:48:28.440Z</lastModifiedDate><OrderDate>2020-02-03T15:48:28.418Z</OrderDate><OrderType>remove_imported_tn_orders</OrderType><OrderStatus>FAILED</OrderStatus><OrderId>d3ed8a2e-7927-4fbc-8e6c-9c8408d443d5</OrderId></RemoveImportedTnOrderSummary><RemoveImportedTnOrderSummary><accountId>9900778</accountId><CountOfTNs>2</CountOfTNs><CustomerOrderId>custom string</CustomerOrderId><userId>jmulford-api</userId><lastModifiedDate>2020-01-31T21:12:23.731Z</lastModifiedDate><OrderDate>2020-01-31T21:12:23.707Z</OrderDate><OrderType>remove_imported_tn_orders</OrderType><OrderStatus>FAILED</OrderStatus><OrderId>6ddec230-ca5f-4502-8273-15ba8968dc8c</OrderId></RemoveImportedTnOrderSummary><RemoveImportedTnOrderSummary><accountId>9900778</accountId><CountOfTNs>2</CountOfTNs><CustomerOrderId>custom string</CustomerOrderId><userId>jmulford-api</userId><lastModifiedDate>2020-01-31T21:12:08.200Z</lastModifiedDate><OrderDate>2020-01-31T21:12:08.183Z</OrderDate><OrderType>remove_imported_tn_orders</OrderType><OrderStatus>FAILED</OrderStatus><OrderId>dc2ae1c7-b7db-44e7-bbb2-eb2b17e18413</OrderId></RemoveImportedTnOrderSummary><RemoveImportedTnOrderSummary><accountId>9900778</accountId><CountOfTNs>2</CountOfTNs><CustomerOrderId>custom string</CustomerOrderId><userId>jmulford-api</userId><lastModifiedDate>2020-01-31T21:11:46.368Z</lastModifiedDate><OrderDate>2020-01-31T21:11:46.343Z</OrderDate><OrderType>remove_imported_tn_orders</OrderType><OrderStatus>FAILED</OrderStatus><OrderId>1bcfe0bd-6998-4198-b734-abd1fffe346a</OrderId></RemoveImportedTnOrderSummary></RemoveImportedTnOrders>";


Expand Down

0 comments on commit 5430540

Please sign in to comment.