com.twilio.sdk.resource.instance.pricing.PhoneNumberCountry 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.instance.pricing;
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.resource.NextGenInstanceResource;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Pricing information for Phone Numbers in a specific country.
*
* For more information see the Twilio REST API documentation.
*/
public class PhoneNumberCountry extends NextGenInstanceResource {
public PhoneNumberCountry(final TwilioPricingClient client) {
super(client);
}
public PhoneNumberCountry(final TwilioPricingClient client, final Map properties) {
super(client, properties);
}
public PhoneNumberCountry(final TwilioPricingClient client, final String isoCountry) {
super(client);
if (isoCountry == null || "".equals(isoCountry)) {
throw new IllegalArgumentException("isoCountry cannot be null");
}
setProperty("iso_country", isoCountry);
}
/**
* Get an abbreviated identifier for the country this pricing information applies to.
*
* @return the ISO 3166-1 alpha-2 country code
*/
public String getIsoCountry() {
return getProperty("iso_country");
}
/**
* Get the name of the country this pricing information applies to.
*
* @return the country name
*/
public String getCountry() {
return getProperty("country");
}
/**
* Get the currency unit for this pricing information.
*
* @return A string representing the currency information, e.g. "USD" for US Dollars.
*/
public String getPriceUnit() {
return getProperty("price_unit");
}
/**
* Get a list of prices for available phone number types in this country.
*
* Twilio Phone Numbers are priced per month, and each price object will contain the price for a specific type of
* phone number (e.g. mobile, local, toll-free) both before and after any discounts available for the requesting
* account are applied.
*
* @return A list of objects with phone number pricing information.
*/
public List getPhoneNumberPrices() {
List