All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.twilio.sdk.resource.list.OutgoingCallerIdList Maven / Gradle / Ivy

There is a newer version: 7.0.0-rc-10
Show newest version
package com.twilio.sdk.resource.list;

import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.TwilioRestResponse;
import com.twilio.sdk.resource.ListResource;
import com.twilio.sdk.resource.factory.OutgoingCallerIdFactory;
import com.twilio.sdk.resource.instance.CallerIdValidation;
import com.twilio.sdk.resource.instance.OutgoingCallerId;
import org.apache.http.NameValuePair;

import java.util.List;
import java.util.Map;

// TODO: Auto-generated Javadoc
/**
 * The Class OutgoingCallerIdList.
 *
 * For more information see https://www.twilio.com/docs/api/rest/outgoing-caller-ids
 */
public class OutgoingCallerIdList extends ListResource
		implements OutgoingCallerIdFactory {

	/**
	 * Instantiates a new outgoing caller id list.
	 *
	 * @param client the client
	 */
	public OutgoingCallerIdList(TwilioRestClient client) {
		super(client);
	}

	/**
	 * Instantiates a new outgoing caller id list.
	 *
	 * @param client the client
	 * @param filters the filters
	 */
	public OutgoingCallerIdList(TwilioRestClient client,
			Map filters) {
		super(client, filters);
	}

	/* (non-Javadoc)
	 * @see com.twilio.sdk.resource.Resource#getResourceLocation()
	 */
	@Override
	protected String getResourceLocation() {
		return "/" + TwilioRestClient.DEFAULT_VERSION + "/Accounts/"
				+ this.getRequestAccountSid() + "/OutgoingCallerIds.json";
	}

	/* (non-Javadoc)
	 * @see com.twilio.sdk.resource.ListResource#makeNew(com.twilio.sdk.TwilioRestClient, java.util.Map)
	 */
	@Override
	protected OutgoingCallerId makeNew(TwilioRestClient client,
			Map params) {
		return new OutgoingCallerId(client, params);
	}

	/* (non-Javadoc)
	 * @see com.twilio.sdk.resource.ListResource#getListKey()
	 */
	@Override
	protected String getListKey() {
		return "outgoing_caller_ids";
	}

	/* (non-Javadoc)
	 * @see com.twilio.sdk.resource.factory.OutgoingCallerIdFactory#create(java.util.Map)
	 */
	public CallerIdValidation create(Map params) throws TwilioRestException {
		TwilioRestResponse response = this.getClient().safeRequest(
				this.getResourceLocation(), "POST", params);
		return new CallerIdValidation(response);
	}

	/* (non-Javadoc)
	 * @see com.twilio.sdk.resource.factory.OutgoingCallerIdFactory#create(java.util.List)
	 */
	public CallerIdValidation create(List params) throws TwilioRestException {
		TwilioRestResponse response = this.getClient().safeRequest(
				this.getResourceLocation(), "POST", params);
		return new CallerIdValidation(response);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy