Class PhoneNumbersAsyncClient
java.lang.Object
com.azure.communication.phonenumbers.PhoneNumbersAsyncClient
Asynchronous client for Communication service phone number operations.
-
Method Summary
Modifier and TypeMethodDescriptionbeginPurchasePhoneNumbers
(String searchId) Starts the purchase of the phone number(s) in the search result associated with a given id.beginReleasePhoneNumber
(String phoneNumber) Begins release of a purchased phone number.beginSearchAvailablePhoneNumbers
(String countryCode, PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, PhoneNumberCapabilities capabilities) Starts the search for available phone numbers to purchase.beginSearchAvailablePhoneNumbers
(String countryCode, PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, PhoneNumberCapabilities capabilities, PhoneNumberSearchOptions searchOptions) Starts the search for available phone numbers to purchase.beginUpdatePhoneNumberCapabilities
(String phoneNumber, PhoneNumberCapabilities capabilities) Update capabilities of a purchased phone number.getPurchasedPhoneNumber
(String phoneNumber) Gets information about a purchased phone number.getPurchasedPhoneNumberWithResponse
(String phoneNumber) Gets information about a purchased phone number with response.Gets the list of the purchased phone numbers.
-
Method Details
-
getPurchasedPhoneNumber
Gets information about a purchased phone number.- Parameters:
phoneNumber
- The phone number id in E.164 format. The leading plus can be either + or encoded as %2B.- Returns:
PurchasedPhoneNumber
representing the purchased telephone number.- Throws:
NullPointerException
- ifphoneNumber
is null.
-
getPurchasedPhoneNumberWithResponse
Gets information about a purchased phone number with response.- Parameters:
phoneNumber
- The phone number id in E.164 format. The leading plus can be either + or encoded as %2B.- Returns:
PurchasedPhoneNumber
representing the purchased telephone number.- Throws:
NullPointerException
- ifphoneNumber
is null.
-
listPurchasedPhoneNumbers
Gets the list of the purchased phone numbers.- Returns:
- A
PagedFlux
ofPurchasedPhoneNumber
instances representing a purchased telephone numbers.
-
beginSearchAvailablePhoneNumbers
public PollerFlux<PhoneNumberOperation,PhoneNumberSearchResult> beginSearchAvailablePhoneNumbers(String countryCode, PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, PhoneNumberCapabilities capabilities) Starts the search for available phone numbers to purchase.- Parameters:
countryCode
- The ISO 3166-2 country code.phoneNumberType
-PhoneNumberType
The phone number type.assignmentType
-PhoneNumberAssignmentType
The phone number assignment type.capabilities
-PhoneNumberCapabilities
The phone number capabilities.- Returns:
- A
PollerFlux
object with the reservation result. - Throws:
NullPointerException
- ifcountryCode
orsearchRequest
is null.
-
beginSearchAvailablePhoneNumbers
public PollerFlux<PhoneNumberOperation,PhoneNumberSearchResult> beginSearchAvailablePhoneNumbers(String countryCode, PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, PhoneNumberCapabilities capabilities, PhoneNumberSearchOptions searchOptions) Starts the search for available phone numbers to purchase.- Parameters:
countryCode
- The ISO 3166-2 country code.phoneNumberType
-PhoneNumberType
The phone number type.assignmentType
-PhoneNumberAssignmentType
The phone number assignment type.capabilities
-PhoneNumberCapabilities
The phone number capabilities.searchOptions
- The phone number search options.- Returns:
- A
PollerFlux
object with the reservation result. - Throws:
NullPointerException
- ifcountryCode
orsearchRequest
is null.RuntimeException
- if search operation fails.
-
beginPurchasePhoneNumbers
public PollerFlux<PhoneNumberOperation,PurchasePhoneNumbersResult> beginPurchasePhoneNumbers(String searchId) Starts the purchase of the phone number(s) in the search result associated with a given id.- Parameters:
searchId
- ID of the search.- Returns:
- A
PollerFlux
object. - Throws:
NullPointerException
- ifsearchId
is null.RuntimeException
- if purchase operation fails.
-
beginReleasePhoneNumber
public PollerFlux<PhoneNumberOperation,ReleasePhoneNumberResult> beginReleasePhoneNumber(String phoneNumber) Begins release of a purchased phone number. This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.- Parameters:
phoneNumber
- The phone number id in E.164 format. The leading plus can be either + or encoded as %2B.- Returns:
- A
PollerFlux
object. - Throws:
NullPointerException
- ifphoneNumber
is null.RuntimeException
- if release operation fails.
-
beginUpdatePhoneNumberCapabilities
public PollerFlux<PhoneNumberOperation,PurchasedPhoneNumber> beginUpdatePhoneNumberCapabilities(String phoneNumber, PhoneNumberCapabilities capabilities) Update capabilities of a purchased phone number.- Parameters:
phoneNumber
- The phone number id in E.164 format. The leading plus can be either + or encoded as %2B.capabilities
- Update capabilities of a purchased phone number.- Returns:
- A
PollerFlux
object. - Throws:
NullPointerException
- ifphoneNumber
orcapabilities
is null.RuntimeException
- if update capabilities operation fails.
-