public class AccountClient extends AbstractClient
NexmoClient.getAccountClient() ()}.| Modifier and Type | Field and Description |
|---|---|
protected com.nexmo.client.account.BalanceEndpoint |
balance |
protected com.nexmo.client.account.PrefixPricingEndpoint |
prefixPricing |
protected com.nexmo.client.account.PricingEndpoint |
pricing |
protected com.nexmo.client.account.SecretManagementEndpoint |
secret |
protected com.nexmo.client.account.SettingsEndpoint |
settings |
protected com.nexmo.client.account.TopUpEndpoint |
topUp |
httpWrapper| Constructor and Description |
|---|
AccountClient(HttpWrapper httpWrapper)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
SecretResponse |
createSecret(java.lang.String apiKey,
java.lang.String secret)
Create a secret to be used with a specific API key.
|
BalanceResponse |
getBalance() |
PrefixPricingResponse |
getPrefixPrice(ServiceType type,
java.lang.String prefix)
Retrieve the pricing for a specified prefix.
|
SecretResponse |
getSecret(java.lang.String apiKey,
java.lang.String secretId)
Get information for a specific secret id associated to a given API key.
|
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.
|
ListSecretsResponse |
listSecrets(java.lang.String apiKey)
List the ID of each secret associated to the given API key.
|
void |
revokeSecret(java.lang.String apiKey,
java.lang.String secretId)
Revoke a secret associated with a specific API key.
|
void |
topUp(java.lang.String transaction)
Top-up your account when you have enabled auto-reload in the dashboard.
|
SettingsResponse |
updateDeliveryReceiptUrl(java.lang.String url) |
SettingsResponse |
updateSettings(SettingsRequest request) |
SettingsResponse |
updateSmsIncomingUrl(java.lang.String url) |
protected com.nexmo.client.account.BalanceEndpoint balance
protected com.nexmo.client.account.PricingEndpoint pricing
protected com.nexmo.client.account.PrefixPricingEndpoint prefixPricing
protected com.nexmo.client.account.TopUpEndpoint topUp
protected com.nexmo.client.account.SecretManagementEndpoint secret
protected com.nexmo.client.account.SettingsEndpoint settings
public AccountClient(HttpWrapper httpWrapper)
httpWrapper - (required) shared HTTP wrapper object used for making REST calls.public BalanceResponse getBalance() throws NexmoResponseParseException, NexmoClientException
public PricingResponse getVoicePrice(java.lang.String country) throws NexmoResponseParseException, NexmoClientException
country - The two-character country code for which you would like to retrieve pricing.NexmoResponseParseException - if the response from the API could not be parsed.NexmoClientException - if there was a problem with the Nexmo request or response objects.public PricingResponse getSmsPrice(java.lang.String country) throws NexmoResponseParseException, NexmoClientException
country - The two-character country code for which you would like to retrieve pricing.NexmoResponseParseException - if the response from the API could not be parsed.NexmoClientException - if there was a problem with the Nexmo request or response objects.public PrefixPricingResponse getPrefixPrice(ServiceType type, java.lang.String prefix) throws NexmoResponseParseException, NexmoClientException
type - The type of service to retrieve pricing for.prefix - The prefix to retrieve the pricing for.NexmoResponseParseException - if the response from the API could not be parsed.NexmoClientException - if there was a problem with the Nexmo request or response objects.public void topUp(java.lang.String transaction) throws NexmoResponseParseException, NexmoClientException
transaction - The ID associated with your original auto-reload transactionNexmoResponseParseException - if the response from the API could not be parsed.NexmoClientException - if there was a problem with the Nexmo request or response object indicating
that the request was unsuccessful.public ListSecretsResponse listSecrets(java.lang.String apiKey) throws NexmoResponseParseException, NexmoClientException
apiKey - The API key to look up secrets for.NexmoResponseParseException - if a network error occurred contacting the Nexmo Account APINexmoClientException - if there was a problem with the Nexmo request or response object indicating
that the request was unsuccessful.public SecretResponse getSecret(java.lang.String apiKey, java.lang.String secretId) throws NexmoResponseParseException, NexmoClientException
apiKey - The API key that the secret is associated to.secretId - The id of the secret to get information on.NexmoResponseParseException - if a network error occurred contacting the Nexmo Account APINexmoClientException - if there was a problem with the Nexmo request or response object indicating
that the request was unsuccessful.public SecretResponse createSecret(java.lang.String apiKey, java.lang.String secret) throws NexmoResponseParseException, NexmoClientException
apiKey - The API key that the secret is to be used with.secret - The contents of the secret.NexmoResponseParseException - if a network error occurred contacting the Nexmo Account APINexmoClientException - if there was a problem with the Nexmo request or response object indicating
that the request was unsuccessful.public void revokeSecret(java.lang.String apiKey, java.lang.String secretId) throws NexmoResponseParseException, NexmoClientException
apiKey - The API key that the secret is associated to.secretId - The id of the secret to revoke.NexmoResponseParseException - if a network error occurred contacting the Nexmo Account APINexmoClientException - if there was a problem with the Nexmo request or response object indicating
that the request was unsuccessful.public SettingsResponse updateSmsIncomingUrl(java.lang.String url) throws NexmoResponseParseException, NexmoClientException
url - The new incoming sms webhook url to associate to your account.SettingsResponse containing the newly-updated account settings.NexmoResponseParseException - if a network error occurred contacting the Nexmo Account APINexmoClientException - if there was a problem with the Nexmo request or response object indicating
that the request was unsuccessful.public SettingsResponse updateDeliveryReceiptUrl(java.lang.String url) throws NexmoResponseParseException, NexmoClientException
url - The new delivery receipt webhook url to associate to your account.SettingsResponse containing the newly-updated account settings.NexmoResponseParseException - if a network error occurred contacting the Nexmo Account APINexmoClientException - if there was a problem with the Nexmo request or response object indicating
that the request was unsuccessful.public SettingsResponse updateSettings(SettingsRequest request) throws NexmoResponseParseException, NexmoClientException
request - The SettingsRequest containing the fields to update.SettingsResponse containing the newly-updated account settings.NexmoResponseParseException - if a network error occurred contacting the Nexmo Account APINexmoClientException - if there was a problem with the Nexmo request or response object indicating
that the request was unsuccessful.