com.twilio.sdk.resource.list.ipmessaging.CredentialList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio-java-sdk Show documentation
Show all versions of twilio-java-sdk Show documentation
Release Candidate for Next-Gen Twilio Java Helper Library
package com.twilio.sdk.resource.list.ipmessaging;
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.TwilioRestResponse;
import com.twilio.sdk.resource.NextGenListResource;
import com.twilio.sdk.resource.factory.ResourceFactory;
import com.twilio.sdk.resource.instance.ipmessaging.Credential;
import org.apache.http.NameValuePair;
import java.util.List;
import java.util.Map;
/**
* Represents credential list endpoint for ip messaging
*/
public class CredentialList extends NextGenListResource
implements ResourceFactory {
public CredentialList(TwilioIPMessagingClient client) {
super(client);
}
public CredentialList(TwilioIPMessagingClient client, Map filters) {
super(client, filters);
}
@Override
protected Credential makeNew(final TwilioIPMessagingClient client, final Map params) {
return new Credential(client, params);
}
@Override
protected String getResourceLocation() {
return "/" + TwilioIPMessagingClient.DEFAULT_VERSION + "/Credentials";
}
@Override
public Credential create(final Map params) throws TwilioRestException {
TwilioRestResponse response = this.getClient().safeRequest(this.getResourceLocation(), "POST", params);
return makeNew(this.getClient(), response.toMap());
}
@Override
public Credential create(final List params) throws TwilioRestException {
TwilioRestResponse response = this.getClient().safeRequest(this.getResourceLocation(), "POST", params);
return makeNew(this.getClient(), response.toMap());
}
}