Class PhoneNumbersClient
- java.lang.Object
-
- com.azure.communication.phonenumbers.PhoneNumbersClient
-
public final class PhoneNumbersClient extends Object
Synchronous client for Communication service phone number operations
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,PurchasePhoneNumbersResult>
beginPurchasePhoneNumbers(String searchId)
Starts the purchase of the phone number(s) in the search result associated with a given id.com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,PurchasePhoneNumbersResult>
beginPurchasePhoneNumbers(String searchId, com.azure.core.util.Context context)
Starts the purchase of the phone number(s) in the search result associated with a given id.com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,ReleasePhoneNumberResult>
beginReleasePhoneNumber(String phoneNumber)
Starts the update of capabilities for a purchased phone number.com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,ReleasePhoneNumberResult>
beginReleasePhoneNumber(String phoneNumber, com.azure.core.util.Context context)
Starts the update of capabilities for a purchased phone number.com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,PhoneNumberSearchResult>
beginSearchAvailablePhoneNumbers(String countryCode, PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, PhoneNumberCapabilities capabilities)
Starts the search for available phone numbers to purchase.com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,PhoneNumberSearchResult>
beginSearchAvailablePhoneNumbers(String countryCode, PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, PhoneNumberCapabilities capabilities, PhoneNumberSearchOptions searchOptions, com.azure.core.util.Context context)
Starts the search for available phone numbers to purchase.com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,PurchasedPhoneNumber>
beginUpdatePhoneNumberCapabilities(String phoneNumber, PhoneNumberCapabilities capabilities)
Update capabilities of a purchased phone number.com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,PurchasedPhoneNumber>
beginUpdatePhoneNumberCapabilities(String phoneNumber, PhoneNumberCapabilities capabilities, com.azure.core.util.Context context)
Update capabilities of a purchased phone number.PurchasedPhoneNumber
getPurchasedPhoneNumber(String phoneNumber)
Gets information about a purchased phone number.com.azure.core.http.rest.Response<PurchasedPhoneNumber>
getPurchasedPhoneNumberWithResponse(String phoneNumber, com.azure.core.util.Context context)
Gets information about a purchased phone number with response.com.azure.core.http.rest.PagedIterable<PurchasedPhoneNumber>
listPurchasedPhoneNumbers()
Gets the list of the purchased phone numbers.com.azure.core.http.rest.PagedIterable<PurchasedPhoneNumber>
listPurchasedPhoneNumbers(com.azure.core.util.Context context)
Gets the list of the purchased phone numbers with context.
-
-
-
Method Detail
-
getPurchasedPhoneNumber
public PurchasedPhoneNumber getPurchasedPhoneNumber(String phoneNumber)
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
public com.azure.core.http.rest.Response<PurchasedPhoneNumber> getPurchasedPhoneNumberWithResponse(String phoneNumber, com.azure.core.util.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
- AContext
representing the request context.- Returns:
PurchasedPhoneNumber
representing the purchased telephone number.- Throws:
NullPointerException
- ifphoneNumber
is null.
-
listPurchasedPhoneNumbers
public com.azure.core.http.rest.PagedIterable<PurchasedPhoneNumber> listPurchasedPhoneNumbers()
Gets the list of the purchased phone numbers.- Returns:
- A
PagedIterable
ofPurchasedPhoneNumber
instances representing purchased telephone numbers.
-
listPurchasedPhoneNumbers
public com.azure.core.http.rest.PagedIterable<PurchasedPhoneNumber> listPurchasedPhoneNumbers(com.azure.core.util.Context context)
Gets the list of the purchased phone numbers with context.- Parameters:
context
- AContext
representing the request context.- Returns:
- A
PagedIterable
ofPurchasedPhoneNumber
instances representing purchased telephone numbers.
-
beginSearchAvailablePhoneNumbers
public com.azure.core.util.polling.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
-PhoneNumberType
The phone number type.assignmentType
-PhoneNumberAssignmentType
The phone number assignment type.capabilities
-PhoneNumberCapabilities
The phone number capabilities.- Returns:
- A
SyncPoller
object with the reservation result. - Throws:
NullPointerException
- ifcountryCode
orsearchRequest
is null.
-
beginSearchAvailablePhoneNumbers
public com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,PhoneNumberSearchResult> beginSearchAvailablePhoneNumbers(String countryCode, PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, PhoneNumberCapabilities capabilities, PhoneNumberSearchOptions searchOptions, com.azure.core.util.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
-PhoneNumberType
The phone number type.assignmentType
-PhoneNumberAssignmentType
The phone number assignment type.capabilities
-PhoneNumberCapabilities
The phone number capabilities.searchOptions
- The phone number search options.context
- AContext
representing the request context.- Returns:
- A
SyncPoller
object with the reservation result. - Throws:
NullPointerException
- ifcountryCode
orsearchRequest
is null.
-
beginPurchasePhoneNumbers
public com.azure.core.util.polling.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
SyncPoller
object with PurchasePhoneNumbersResult. - Throws:
NullPointerException
- ifsearchId
is null.
-
beginPurchasePhoneNumbers
public com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,PurchasePhoneNumbersResult> beginPurchasePhoneNumbers(String searchId, com.azure.core.util.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
- AContext
representing the request context.- Returns:
- A
SyncPoller
object with PurchasePhoneNumbersResult. - Throws:
NullPointerException
- ifsearchId
is null.
-
beginReleasePhoneNumber
public com.azure.core.util.polling.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
SyncPoller
object with ReleasePhoneNumberResult. - Throws:
NullPointerException
- ifphoneNumber
is null.
-
beginReleasePhoneNumber
public com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,ReleasePhoneNumberResult> beginReleasePhoneNumber(String phoneNumber, com.azure.core.util.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
- AContext
representing the request context.- Returns:
- A
SyncPoller
object with ReleasePhoneNumberResult. - Throws:
NullPointerException
- ifphoneNumber
is null.
-
beginUpdatePhoneNumberCapabilities
public com.azure.core.util.polling.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
SyncPoller
object with purchased phone number. - Throws:
NullPointerException
- ifphoneNumber
orcapabilities
is null.
-
beginUpdatePhoneNumberCapabilities
public com.azure.core.util.polling.SyncPoller<PhoneNumberOperation,PurchasedPhoneNumber> beginUpdatePhoneNumberCapabilities(String phoneNumber, PhoneNumberCapabilities capabilities, com.azure.core.util.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
- AContext
representing the request context.- Returns:
- A
SyncPoller
object with purchased phone number. - Throws:
NullPointerException
- ifphoneNumber
orcapabilities
is null.
-
-