![JAR search and dependency download from the Maven repository](/logo.png)
com.twilio.sdk.resource.instance.pricing.MessagingCountry 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
Java helper library for Twilio services
package com.twilio.sdk.resource.instance.pricing;
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.resource.NextGenInstanceResource;
import org.apache.commons.lang3.StringUtils;
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.HashMap;
import java.util.List;
import java.util.Map;
/**
* Pricing information for Messaging in a specific country
*
* For more information see the Twilio REST API documentation.
*/
public class MessagingCountry extends NextGenInstanceResource {
public MessagingCountry(final TwilioPricingClient client) {
this(client, new HashMap());
}
public MessagingCountry(final TwilioPricingClient client, final String isoCountry) {
super(client);
if (StringUtils.isBlank(isoCountry)) {
throw new IllegalArgumentException("The isoCountry for a MessagingCountry cannot be blank");
}
setProperty("iso_country", isoCountry);
}
public MessagingCountry(final TwilioPricingClient client, final Map properties) {
super(client, properties);
}
@Override
protected String getResourceLocation() {
return "/" + TwilioPricingClient.DEFAULT_VERSION + "/Messaging/Countries/" + getIsoCountry();
}
/**
* Get the name of the country this pricing information applies to.
* @return the country name
*/
public String getCountry() {
return getProperty("country");
}
/**
* Get an abbreviated identifier for the country this pricing information
* applies to.
* @return the ISO 3166-1 alpha-2 country code, e.g. "US" for the United States
*/
public String getIsoCountry() {
return getProperty("iso_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 outbound SNS in this country,
* broken out by number type
*
* @return List of SMS prices with outbound pricing info
*/
public List getOutboundSmsPrices() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy