Skip to content

Commit ee66108

Browse files
author
Doug Black
committed
Address -> IpAddress
1 parent 6a6665e commit ee66108

File tree

6 files changed

+304
-304
lines changed

6 files changed

+304
-304
lines changed

src/main/java/com/twilio/sdk/resource/factory/sip/AddressFactory.java renamed to src/main/java/com/twilio/sdk/resource/factory/sip/IpAddressFactory.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@
44
import java.util.List;
55

66
import com.twilio.sdk.TwilioRestException;
7-
import com.twilio.sdk.resource.instance.sip.Address;
7+
import com.twilio.sdk.resource.instance.sip.IpAddress;
88
import org.apache.http.NameValuePair;
99

1010
// TODO: Auto-generated Javadoc
1111
/**
1212
* A factory for creating SipDomain objects.
1313
*
14-
* For more information see <a href=" https://www.twilio.com/docs/api/rest/address"> https://www.twilio.com/docs/api/rest/address</a>
14+
* For more information see <a href=" https://www.twilio.com/docs/api/rest/ip-address"> https://www.twilio.com/docs/api/rest/ip-address</a>
1515
*
1616
*/
17-
public interface AddressFactory {
17+
public interface IpAddressFactory {
1818

1919

2020
/**
21-
* Creates the address
21+
* Creates the IpAddress
2222
*
2323
* @param params the params map
24-
* @return the address
24+
* @return the IpAddress
2525
* @throws TwilioRestException
2626
*/
27-
public Address create(Map<String, String> params) throws TwilioRestException;
27+
public IpAddress create(Map<String, String> params) throws TwilioRestException;
2828

2929
/**
30-
* Creates the address
30+
* Creates the IpAddress
3131
*
3232
* @param params the params list
33-
* @return the address
33+
* @return the IpAddress
3434
* @throws TwilioRestException
3535
*/
36-
public Address create(List<NameValuePair> params) throws TwilioRestException;
36+
public IpAddress create(List<NameValuePair> params) throws TwilioRestException;
3737

3838
}

src/main/java/com/twilio/sdk/resource/instance/UsageRecord.java

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -18,112 +18,112 @@
1818
*/
1919
public class UsageRecord extends InstanceResource {
2020

21-
/**
22-
* The Constant SID_PROPERTY.
23-
*/
24-
private static final String SID_PROPERTY = "sid";
25-
26-
/**
27-
* Instantiates a new usageRecord.
28-
*
29-
* @param client the client
30-
*/
31-
public UsageRecord(TwilioRestClient client) {
32-
super(client);
33-
}
34-
35-
/**
36-
* {@inheritDoc}
37-
*/
38-
@Override
39-
protected String getResourceLocation() {
40-
return null;
41-
}
42-
43-
/**
44-
* Instantiates a new usageRecord.
45-
*
46-
* @param client the client
47-
* @param sid the sid
48-
*/
49-
public UsageRecord(TwilioRestClient client, String sid) {
50-
super(client);
51-
if (sid == null) {
52-
throw new IllegalStateException(
53-
"The Sid for a UsageRecord can not be null");
54-
}
55-
this.setProperty(SID_PROPERTY, sid);
56-
}
57-
58-
/**
59-
* Instantiates a new UsageRecord.
60-
*
61-
* @param client the client
62-
* @param properties the properties
63-
*/
64-
public UsageRecord(TwilioRestClient client, Map<String, Object> properties) {
65-
super(client, properties);
66-
}
67-
68-
69-
public UsageCategory getCategory() {
70-
return UsageCategory.valueOf(getProperty("Category").replace('-', '_'));
71-
}
72-
73-
public String getDescription() {
74-
return getProperty("Description");
75-
}
76-
77-
public Date getStartDate() {
78-
SimpleDateFormat format = new SimpleDateFormat(
79-
"EEE, dd MMM yyyy HH:mm:ss Z");
80-
try {
81-
return format.parse(this.getProperty("StartDate"));
82-
} catch (ParseException e) {
83-
return null;
84-
}
85-
}
86-
87-
public Date getEndDate() {
88-
SimpleDateFormat format = new SimpleDateFormat(
89-
"EEE, dd MMM yyyy HH:mm:ss Z");
90-
try {
91-
return format.parse(this.getProperty("EndDate"));
92-
} catch (ParseException e) {
93-
return null;
94-
}
95-
}
96-
97-
public BigDecimal getUsage() {
98-
return new BigDecimal(getProperty("Usage"));
99-
}
100-
101-
public String getUsageUnits() {
102-
return getProperty("UsageUnits");
103-
}
104-
105-
public Long getCount() {
106-
String count = getProperty("Count");
107-
return count == null ? null : Long.parseLong(getProperty("Count"));
108-
}
109-
110-
public String getCountUnits() {
111-
return getProperty("CountUnits");
112-
}
113-
114-
public BigDecimal getPrice() {
115-
return new BigDecimal(getProperty("Price"));
116-
}
117-
118-
public String getPriceUnit() {
119-
return getProperty("PriceUnit");
120-
}
121-
122-
public String getUri() {
123-
return getProperty("Uri");
124-
}
125-
126-
public String[] getSubresourceUris() {
127-
return null;
128-
}
21+
/**
22+
* The Constant SID_PROPERTY.
23+
*/
24+
private static final String SID_PROPERTY = "sid";
25+
26+
/**
27+
* Instantiates a new usageRecord.
28+
*
29+
* @param client the client
30+
*/
31+
public UsageRecord(TwilioRestClient client) {
32+
super(client);
33+
}
34+
35+
/**
36+
* {@inheritDoc}
37+
*/
38+
@Override
39+
protected String getResourceLocation() {
40+
return null;
41+
}
42+
43+
/**
44+
* Instantiates a new usageRecord.
45+
*
46+
* @param client the client
47+
* @param sid the sid
48+
*/
49+
public UsageRecord(TwilioRestClient client, String sid) {
50+
super(client);
51+
if (sid == null) {
52+
throw new IllegalStateException(
53+
"The Sid for a UsageRecord can not be null");
54+
}
55+
this.setProperty(SID_PROPERTY, sid);
56+
}
57+
58+
/**
59+
* Instantiates a new UsageRecord.
60+
*
61+
* @param client the client
62+
* @param properties the properties
63+
*/
64+
public UsageRecord(TwilioRestClient client, Map<String, Object> properties) {
65+
super(client, properties);
66+
}
67+
68+
69+
public UsageCategory getCategory() {
70+
return UsageCategory.valueOf(getProperty("Category").replace('-', '_'));
71+
}
72+
73+
public String getDescription() {
74+
return getProperty("Description");
75+
}
76+
77+
public Date getStartDate() {
78+
SimpleDateFormat format = new SimpleDateFormat(
79+
"EEE, dd MMM yyyy HH:mm:ss Z");
80+
try {
81+
return format.parse(this.getProperty("StartDate"));
82+
} catch (ParseException e) {
83+
return null;
84+
}
85+
}
86+
87+
public Date getEndDate() {
88+
SimpleDateFormat format = new SimpleDateFormat(
89+
"EEE, dd MMM yyyy HH:mm:ss Z");
90+
try {
91+
return format.parse(this.getProperty("EndDate"));
92+
} catch (ParseException e) {
93+
return null;
94+
}
95+
}
96+
97+
public BigDecimal getUsage() {
98+
return new BigDecimal(getProperty("Usage"));
99+
}
100+
101+
public String getUsageUnits() {
102+
return getProperty("UsageUnits");
103+
}
104+
105+
public Long getCount() {
106+
String count = getProperty("Count");
107+
return count == null ? null : Long.parseLong(getProperty("Count"));
108+
}
109+
110+
public String getCountUnits() {
111+
return getProperty("CountUnits");
112+
}
113+
114+
public BigDecimal getPrice() {
115+
return new BigDecimal(getProperty("Price"));
116+
}
117+
118+
public String getPriceUnit() {
119+
return getProperty("PriceUnit");
120+
}
121+
122+
public String getUri() {
123+
return getProperty("Uri");
124+
}
125+
126+
public String[] getSubresourceUris() {
127+
return null;
128+
}
129129
}

0 commit comments

Comments
 (0)