Skip to content

Commit 7882f47

Browse files
author
Doug Black
committed
add more missing methods
1 parent 35e17d3 commit 7882f47

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

src/main/java/com/twilio/sdk/resource/factory/sip/IpAccessControlListFactory.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package com.twilio.sdk.resource.factory.sip;
22

33
import java.util.Map;
4+
import java.util.List;
45

56
import com.twilio.sdk.TwilioRestException;
67
import com.twilio.sdk.resource.instance.sip.IpAccessControlList;
8+
import org.apache.http.NameValuePair;
79

810
// TODO: Auto-generated Javadoc
911
/**
10-
* A factory for creating SipDomain objects.
12+
* A factory for creating IpAccessControlList objects.
1113
*
1214
* For more information see <a href=" http://www.twilio.com/docs/api/rest/ipaccesscontrollist"> http://www.twilio.com/docs/api/rest/ipaccesscontrollist</a>
1315
*
@@ -18,10 +20,19 @@ public interface IpAccessControlListFactory {
1820
/**
1921
* Creates the ip access control list
2022
*
21-
* @param params the params
23+
* @param params the params map
2224
* @return the ip access control list
2325
* @throws TwilioRestException
2426
*/
2527
public IpAccessControlList create(Map<String, String> params) throws TwilioRestException;
2628

29+
/**
30+
* Creates the ip access control list
31+
*
32+
* @param params the params list
33+
* @return the ip access control list
34+
* @throws TwilioRestException
35+
*/
36+
public IpAccessControlList create(List<NameValuePair> params) throws TwilioRestException;
37+
2738
}

src/main/java/com/twilio/sdk/resource/instance/sip/CredentialListInstance.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.twilio.sdk.TwilioRestException;
1111
import com.twilio.sdk.TwilioRestResponse;
1212
import com.twilio.sdk.resource.InstanceResource;
13+
import com.twilio.sdk.resource.factory.sip.CredentialFactory;
1314
import com.twilio.sdk.resource.instance.sip.Credential;
1415
import com.twilio.sdk.resource.list.sip.CredentialList;
1516

@@ -156,6 +157,15 @@ public Credential getCredential(String credentialSid) {
156157
return credential;
157158
}
158159

160+
/**
161+
* Gets a CredentialFactory which creates credentials
162+
*
163+
* @return the CredentialFactory
164+
*/
165+
public CredentialFactory getCredentialFactory() {
166+
return this.getCredentials();
167+
}
168+
159169
/**
160170
* Delete this {@link CredentialListInstance}.
161171
* @throws TwilioRestException

src/main/java/com/twilio/sdk/resource/list/sip/CredentialList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected String getResourceLocation() {
5858
return "/" + TwilioRestClient.DEFAULT_VERSION
5959
+ "/Accounts/" + this.getRequestAccountSid()
6060
+ "/SIP/CredentialLists/" + this.getRequestCredentialListSid()
61-
+ "/.json";
61+
+ "/Credentials.json";
6262
}
6363

6464
/* (non-Javadoc)

src/main/java/com/twilio/sdk/resource/list/sip/IpAccessControlListList.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package com.twilio.sdk.resource.list.sip;
22

33
import java.util.Map;
4+
import java.util.List;
45

56
import com.twilio.sdk.TwilioRestClient;
67
import com.twilio.sdk.TwilioRestException;
78
import com.twilio.sdk.TwilioRestResponse;
89
import com.twilio.sdk.resource.ListResource;
910
import com.twilio.sdk.resource.factory.sip.IpAccessControlListFactory;
1011
import com.twilio.sdk.resource.instance.sip.IpAccessControlList;
12+
import org.apache.http.NameValuePair;
1113

1214
public class IpAccessControlListList extends ListResource<IpAccessControlList> implements IpAccessControlListFactory {
1315

@@ -64,4 +66,13 @@ public IpAccessControlList create(Map<String, String> params) throws TwilioRestE
6466
return makeNew(this.getClient(), response.toMap());
6567
}
6668

69+
/* (non-Javadoc)
70+
* @see com.twilio.sdk.resource.factory.IpAccessControlListFactory#create(java.util.List)
71+
*/
72+
public IpAccessControlList create(List<NameValuePair> params) throws TwilioRestException {
73+
TwilioRestResponse response = this.getClient().safeRequest(
74+
this.getResourceLocation(), "POST", params);
75+
return makeNew(this.getClient(), response.toMap());
76+
}
77+
6778
}

0 commit comments

Comments
 (0)