public class NumbersClient extends java.lang.Object
| Constructor and Description |
|---|
NumbersClient(HttpWrapper httpWrapper) |
| Modifier and Type | Method and Description |
|---|---|
void |
buyNumber(java.lang.String country,
java.lang.String msisdn)
Start renting a Nexmo Virtual Number.
|
void |
cancelNumber(java.lang.String country,
java.lang.String msisdn)
Stop renting a Nexmo Virtual Number.
|
void |
linkNumber(java.lang.String msisdn,
java.lang.String country,
java.lang.String appId)
Link a given Nexmo Virtual Number to a Nexmo Application with the given ID.
|
ListNumbersResponse |
listNumbers()
Get the first page of phone numbers assigned to the authenticated account.
|
ListNumbersResponse |
listNumbers(ListNumbersFilter filter)
Get a filtered set of numbers assigned to the authenticated account.
|
SearchNumbersResponse |
searchNumbers(SearchNumbersFilter filter)
Search for available Nexmo Virtual Numbers.
|
SearchNumbersResponse |
searchNumbers(java.lang.String country)
Search for available Nexmo Virtual Numbers.
|
void |
updateNumber(UpdateNumberRequest request)
Update the callbacks and/or application associations for a given Nexmo Virtual Number.
|
public NumbersClient(HttpWrapper httpWrapper)
public ListNumbersResponse listNumbers() throws java.io.IOException, NexmoClientException
java.io.IOException - if an error occurs contacting the Nexmo APINexmoClientException - if an error is returned by the server.public ListNumbersResponse listNumbers(ListNumbersFilter filter) throws java.io.IOException, NexmoClientException
filter - A ListNumbersFilter describing the filters to be applied to the request.java.io.IOException - if an error occurs contacting the Nexmo APINexmoClientException - if an error is returned by the server.public SearchNumbersResponse searchNumbers(java.lang.String country) throws java.io.IOException, NexmoClientException
java.io.IOException - if an error occurs contacting the Nexmo APINexmoClientException - if an error is returned by the server.public SearchNumbersResponse searchNumbers(SearchNumbersFilter filter) throws java.io.IOException, NexmoClientException
java.io.IOException - if an error occurs contacting the Nexmo APINexmoClientException - if an error is returned by the server.public void buyNumber(java.lang.String country, java.lang.String msisdn) throws java.io.IOException, NexmoClientException
country - A String containing a 2-character ISO country code.msisdn - The phone number to be bought.java.io.IOException - if an error occurs contacting the Nexmo APINexmoClientException - if an error is returned by the server.public void cancelNumber(java.lang.String country, java.lang.String msisdn) throws java.io.IOException, NexmoClientException
country - A String containing a 2-character ISO country code.msisdn - The phone number to be cancelled.java.io.IOException - if an error occurs contacting the Nexmo APINexmoClientException - if an error is returned by the server.public void updateNumber(UpdateNumberRequest request) throws java.io.IOException, NexmoClientException
request - Details of the updates to be made to the number association.java.io.IOException - if an error occurs contacting the Nexmo APINexmoClientException - if an error is returned by the server.public void linkNumber(java.lang.String msisdn, java.lang.String country, java.lang.String appId) throws java.io.IOException, NexmoClientException
msisdn - The Nexmo Virtual Number to be updated.country - The country for the given msisdn.appId - The ID for the Nexmo Application to be associated with the number.java.io.IOException - if an error occurs contacting the Nexmo APINexmoClientException - if an error is returned by the server.