public class AccountClient extends AbstractClient
NexmoClient.getInsightClient().| Modifier and Type | Field and Description |
|---|---|
protected BalanceEndpoint |
balance |
protected PrefixPricingEndpoint |
prefixPricing |
protected com.nexmo.client.account.PricingEndpoint |
pricing |
protected TopUpEndpoint |
topUp |
httpWrapper| Constructor and Description |
|---|
AccountClient(HttpWrapper httpWrapper)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
BalanceResponse |
getBalance() |
PrefixPricingResponse |
getPrefixPrice(ServiceType type,
java.lang.String prefix)
Retrieve the pricing for a specified prefix.
|
PricingResponse |
getSmsPrice(java.lang.String country)
Retrieve the SMS pricing for a specified country.
|
PricingResponse |
getVoicePrice(java.lang.String country)
Retrieve the voice pricing for a specified country.
|
void |
topUp(java.lang.String transaction)
Top-up your account when you have enabled auto-reload in the dashboard.
|
protected BalanceEndpoint balance
protected com.nexmo.client.account.PricingEndpoint pricing
protected PrefixPricingEndpoint prefixPricing
protected TopUpEndpoint topUp
public AccountClient(HttpWrapper httpWrapper)
httpWrapper - (required) shared HTTP wrapper object used for making REST calls.public BalanceResponse getBalance() throws java.io.IOException, NexmoClientException
java.io.IOExceptionNexmoClientExceptionpublic PricingResponse getVoicePrice(java.lang.String country) throws java.io.IOException, NexmoClientException
country - The two-character country code for which you would like to retrieve pricing.java.io.IOException - if a network error occurred contacting the Nexmo Account API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public PricingResponse getSmsPrice(java.lang.String country) throws java.io.IOException, NexmoClientException
country - The two-character country code for which you would like to retrieve pricing.java.io.IOException - if a network error occurred contacting the Nexmo Account API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public PrefixPricingResponse getPrefixPrice(ServiceType type, java.lang.String prefix) throws java.io.IOException, NexmoClientException
type - The type of service to retrieve pricing for.prefix - The prefix to retrieve the pricing for.java.io.IOException - if a network error occurred contacting the Nexmo Account API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public void topUp(java.lang.String transaction) throws java.io.IOException, NexmoClientException
transaction - The ID associated with your original auto-reload transactionjava.io.IOException - if a network error occurred contacting the Nexmo Account API.NexmoClientException - if there was a problem with the Nexmo request or response object indicating that
the request was unsuccessful.