Class PhoneNumbersClient
java.lang.Object
com.azure.communication.phonenumbers.PhoneNumbersClient
Synchronous 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.beginPurchasePhoneNumbers(String searchId, Context context) Starts the purchase of the phone number(s) in the search result associated with a given id.beginReleasePhoneNumber(String phoneNumber) Starts the update of capabilities for a purchased phone number.beginReleasePhoneNumber(String phoneNumber, Context context) Starts the update of capabilities for 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, Context context) Starts the search for available phone numbers to purchase.beginUpdatePhoneNumberCapabilities(String phoneNumber, PhoneNumberCapabilities capabilities) Update capabilities of a purchased phone number.beginUpdatePhoneNumberCapabilities(String phoneNumber, PhoneNumberCapabilities capabilities, Context context) Update capabilities of a purchased phone number.getPurchasedPhoneNumber(String phoneNumber) Gets information about a purchased phone number.getPurchasedPhoneNumberWithResponse(String phoneNumber, Context context) Gets information about a purchased phone number with response.Gets the list of the purchased phone numbers.listPurchasedPhoneNumbers(Context context) Gets the list of the purchased phone numbers with context.
-
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:
PurchasedPhoneNumberrepresenting the purchased telephone number.- Throws:
NullPointerException- ifphoneNumberis null.
-
getPurchasedPhoneNumberWithResponse
public Response<PurchasedPhoneNumber> getPurchasedPhoneNumberWithResponse(String phoneNumber, Context context) 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.context- AContextrepresenting the request context.- Returns:
PurchasedPhoneNumberrepresenting the purchased telephone number.- Throws:
NullPointerException- ifphoneNumberis null.
-
listPurchasedPhoneNumbers
Gets the list of the purchased phone numbers.- Returns:
- A
PagedIterableofPurchasedPhoneNumberinstances representing purchased telephone numbers.
-
listPurchasedPhoneNumbers
Gets the list of the purchased phone numbers with context.- Parameters:
context- AContextrepresenting the request context.- Returns:
- A
PagedIterableofPurchasedPhoneNumberinstances representing purchased telephone numbers.
-
beginSearchAvailablePhoneNumbers
public SyncPoller<PhoneNumberOperation,PhoneNumberSearchResult> beginSearchAvailablePhoneNumbers(String countryCode, PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, PhoneNumberCapabilities capabilities) Starts the search for available phone numbers to purchase. This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.- Parameters:
countryCode- The ISO 3166-2 country code.phoneNumberType-PhoneNumberTypeThe phone number type.assignmentType-PhoneNumberAssignmentTypeThe phone number assignment type.capabilities-PhoneNumberCapabilitiesThe phone number capabilities.- Returns:
- A
SyncPollerobject with the reservation result. - Throws:
NullPointerException- ifcountryCodeorsearchRequestis null.
-
beginSearchAvailablePhoneNumbers
public SyncPoller<PhoneNumberOperation,PhoneNumberSearchResult> beginSearchAvailablePhoneNumbers(String countryCode, PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, PhoneNumberCapabilities capabilities, PhoneNumberSearchOptions searchOptions, Context context) Starts the search for available phone numbers to purchase. This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.- Parameters:
countryCode- The ISO 3166-2 country code.phoneNumberType-PhoneNumberTypeThe phone number type.assignmentType-PhoneNumberAssignmentTypeThe phone number assignment type.capabilities-PhoneNumberCapabilitiesThe phone number capabilities.searchOptions- The phone number search options.context- AContextrepresenting the request context.- Returns:
- A
SyncPollerobject with the reservation result. - Throws:
NullPointerException- ifcountryCodeorsearchRequestis null.
-
beginPurchasePhoneNumbers
public SyncPoller<PhoneNumberOperation,PurchasePhoneNumbersResult> beginPurchasePhoneNumbers(String searchId) Starts the purchase of the phone number(s) in the search result associated with a given id. This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.- Parameters:
searchId- ID of the search- Returns:
- A
SyncPollerobject with PurchasePhoneNumbersResult. - Throws:
NullPointerException- ifsearchIdis null.
-
beginPurchasePhoneNumbers
public SyncPoller<PhoneNumberOperation,PurchasePhoneNumbersResult> beginPurchasePhoneNumbers(String searchId, Context context) Starts the purchase of the phone number(s) in the search result associated with a given id. This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.- Parameters:
searchId- ID of the searchcontext- AContextrepresenting the request context.- Returns:
- A
SyncPollerobject with PurchasePhoneNumbersResult. - Throws:
NullPointerException- ifsearchIdis null.
-
beginReleasePhoneNumber
public SyncPoller<PhoneNumberOperation,ReleasePhoneNumberResult> beginReleasePhoneNumber(String phoneNumber) Starts the update of capabilities for 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
SyncPollerobject with ReleasePhoneNumberResult. - Throws:
NullPointerException- ifphoneNumberis null.
-
beginReleasePhoneNumber
public SyncPoller<PhoneNumberOperation,ReleasePhoneNumberResult> beginReleasePhoneNumber(String phoneNumber, Context context) Starts the update of capabilities for 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.context- AContextrepresenting the request context.- Returns:
- A
SyncPollerobject with ReleasePhoneNumberResult. - Throws:
NullPointerException- ifphoneNumberis null.
-
beginUpdatePhoneNumberCapabilities
public SyncPoller<PhoneNumberOperation,PurchasedPhoneNumber> beginUpdatePhoneNumberCapabilities(String phoneNumber, PhoneNumberCapabilities capabilities) Update capabilities 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.capabilities- Update capabilities of a purchased phone number.- Returns:
- A
SyncPollerobject with purchased phone number. - Throws:
NullPointerException- ifphoneNumberorcapabilitiesis null.
-
beginUpdatePhoneNumberCapabilities
public SyncPoller<PhoneNumberOperation,PurchasedPhoneNumber> beginUpdatePhoneNumberCapabilities(String phoneNumber, PhoneNumberCapabilities capabilities, Context context) Update capabilities 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.capabilities- Update capabilities of a purchased phone number.context- AContextrepresenting the request context.- Returns:
- A
SyncPollerobject with purchased phone number. - Throws:
NullPointerException- ifphoneNumberorcapabilitiesis null.
-