PhoneNumberAsyncClient Class

  • java.lang.Object
    • com.azure.communication.administration.PhoneNumberAsyncClient

public final class PhoneNumberAsyncClient

Asynchronous client for Communication service phone number operations

Method Summary

Modifier and Type Method and Description
PollerFlux<PhoneNumberReservation,PhoneNumberReservation> beginCreateReservation(CreateReservationOptions options, Duration pollInterval)

Initiates a reservation and returns a PhoneNumberReservation usable by other functions This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.

PollerFlux<Void,Void> beginPurchaseReservation(String reservationId, Duration pollInterval)

Initiates a purchase process and polls until a terminal state is reached This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.

PollerFlux<PhoneNumberRelease,PhoneNumberRelease> beginReleasePhoneNumbers(List<PhoneNumber> phoneNumbers, Duration pollInterval)

Releases the given phone numbers.

Mono<Void> cancelReservation(String reservationId)

Cancels the reservation.

Mono<Response<Void>> cancelReservationWithResponse(String reservationId)

Cancels the reservation.

Mono<Void> configureNumber(PhoneNumber phoneNumber, PstnConfiguration pstnConfiguration)

Associates a phone number with a PSTN Configuration.

Mono<Response<Void>> configureNumberWithResponse(PhoneNumber phoneNumber, PstnConfiguration pstnConfiguration)

Associates a phone number with a PSTN Configuration.

Mono<AreaCodes> getAllAreaCodes(String locationType, String countryCode, String phonePlanId, List<LocationOptionsQuery> locationOptions)

Gets a list of the supported area codes.

Mono<Response<AreaCodes>> getAllAreaCodesWithResponse(String locationType, String countryCode, String phonePlanId, List<LocationOptionsQuery> locationOptions)

Gets a list of the supported area codes.

Mono<UpdatePhoneNumberCapabilitiesResponse> getCapabilitiesUpdate(String capabilitiesId)

Gets the information for a phone number capabilities update

Mono<Response<UpdatePhoneNumberCapabilitiesResponse>> getCapabilitiesUpdateWithResponse(String capabilitiesId)

Gets the information for a phone number capabilities update

Mono<NumberConfigurationResponse> getNumberConfiguration(PhoneNumber phoneNumber)

Gets the configuration of a given phone number.

Mono<Response<NumberConfigurationResponse>> getNumberConfigurationWithResponse(PhoneNumber phoneNumber)

Gets the configuration of a given phone number.

Mono<LocationOptionsResponse> getPhonePlanLocationOptions(String countryCode, String phonePlanGroupId, String phonePlanId, String locale)

Gets the location options for a phone plan.

Mono<Response<LocationOptionsResponse>> getPhonePlanLocationOptionsWithResponse(String countryCode, String phonePlanGroupId, String phonePlanId, String locale)

Gets the location options for a phone plan.

Mono<PhoneNumberRelease> getReleaseById(String releaseId)

Gets a release by ID.

Mono<Response<PhoneNumberRelease>> getReleaseByIdWithResponse(String releaseId)

Gets a release by ID.

Mono<PhoneNumberReservation> getReservationById(String reservationId)

Gets a reservation by ID.

Mono<Response<PhoneNumberReservation>> getReservationByIdWithResponse(String reservationId)

Gets a reservation by ID.

PagedFlux<AcquiredPhoneNumber> listAllPhoneNumbers(String locale)

Gets the list of the acquired phone numbers.

PagedFlux<PhoneNumberEntity> listAllReleases()

Gets the list of all releases

PagedFlux<PhoneNumberEntity> listAllReservations()

Gets the list of all reservations

PagedFlux<PhoneNumberCountry> listAllSupportedCountries(String locale)

Gets a list of supported countries.

PagedFlux<PhonePlanGroup> listPhonePlanGroups(String countryCode, String locale, Boolean includeRateInformation)

Gets a list of phone plan groups for the given country.

PagedFlux<PhonePlan> listPhonePlans(String countryCode, String phonePlanGroupId, String locale)

Gets a list of phone plans for a phone plan group

Mono<Void> unconfigureNumber(PhoneNumber phoneNumber)

Removes the PSTN Configuration from a phone number.

Mono<Response<Void>> unconfigureNumberWithResponse(PhoneNumber phoneNumber)

Removes the PSTN Configuration from a phone number.

Mono<UpdateNumberCapabilitiesResponse> updateCapabilities(Map<PhoneNumber,NumberUpdateCapabilities> phoneNumberCapabilitiesUpdate)

Adds or removes phone number capabilities.

Mono<Response<UpdateNumberCapabilitiesResponse>> updateCapabilitiesWithResponse(Map<PhoneNumber,NumberUpdateCapabilities> phoneNumberCapabilitiesUpdate)

Adds or removes phone number capabilities.

Methods inherited from java.lang.Object

Method Details

beginCreateReservation

public PollerFlux<PhoneNumberReservation,PhoneNumberReservation> beginCreateReservation(CreateReservationOptions options, Duration pollInterval)

Initiates a reservation and returns a PhoneNumberReservation usable by other functions This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.

Parameters:

options - A CreateReservationOptions with the reservation options
pollInterval - The time our long running operation will keep on polling until it gets a result from the server

Returns:

A PollerFlux<T,U> object with the reservation result

beginPurchaseReservation

public PollerFlux<Void,Void> beginPurchaseReservation(String reservationId, Duration pollInterval)

Initiates a purchase process and polls until a terminal state is reached This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.

Parameters:

reservationId - ID of the reservation
pollInterval - The time our long running operation will keep on polling until it gets a result from the server

Returns:

A PollerFlux<T,U> object.

beginReleasePhoneNumbers

public PollerFlux<PhoneNumberRelease,PhoneNumberRelease> beginReleasePhoneNumbers(List<PhoneNumber> phoneNumbers, Duration pollInterval)

Releases the given phone numbers. This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.

Parameters:

phoneNumbers - A list of PhoneNumber with the desired numbers to release
pollInterval - The time our long running operation will keep on polling until it gets a result from the server

Returns:

A PollerFlux<T,U> object with the release entity

cancelReservation

public Mono<Void> cancelReservation(String reservationId)

Cancels the reservation. This means existing numbers in the reservation will be made available.

Parameters:

reservationId - ID of the reservation

Returns:

A Mono for the asynchronous return

cancelReservationWithResponse

public Mono<Response<Void>> cancelReservationWithResponse(String reservationId)

Cancels the reservation. This means existing numbers in the reservation will be made available.

Parameters:

reservationId - ID of the reservation

Returns:

A Mono containing a Response<T> for the operation

configureNumber

public Mono<Void> configureNumber(PhoneNumber phoneNumber, PstnConfiguration pstnConfiguration)

Associates a phone number with a PSTN Configuration.

Parameters:

phoneNumber - A PhoneNumber representing the phone number.
pstnConfiguration - A PstnConfiguration containing the pstn number configuration options.

Returns:

A Mono for the asynchronous return

configureNumberWithResponse

public Mono<Response<Void>> configureNumberWithResponse(PhoneNumber phoneNumber, PstnConfiguration pstnConfiguration)

Associates a phone number with a PSTN Configuration.

Parameters:

phoneNumber - A PhoneNumber representing the phone number.
pstnConfiguration - A PstnConfiguration containing the pstn number configuration options.

Returns:

A Mono containing a Response<T> for the operation.

getAllAreaCodes

public Mono<AreaCodes> getAllAreaCodes(String locationType, String countryCode, String phonePlanId, List<LocationOptionsQuery> locationOptions)

Gets a list of the supported area codes.

Parameters:

locationType - The type of location information required by the plan.
countryCode - The ISO 3166-2 country code.
phonePlanId - The plan id from which to search area codes.
locationOptions - A List of LocationOptionsQuery for querying the area codes.

Returns:

A Mono containing a AreaCodes representing area codes.

getAllAreaCodesWithResponse

public Mono<Response<AreaCodes>> getAllAreaCodesWithResponse(String locationType, String countryCode, String phonePlanId, List<LocationOptionsQuery> locationOptions)

Gets a list of the supported area codes.

Parameters:

locationType - The type of location information required by the plan.
countryCode - The ISO 3166-2 country code.
phonePlanId - The plan id from which to search area codes.
locationOptions - A List of LocationOptionsQuery for querying the area codes.

Returns:

A Mono containing a Response<T> whose Response#getValue() value returns a AreaCodes representing area codes.

getCapabilitiesUpdate

public Mono<UpdatePhoneNumberCapabilitiesResponse> getCapabilitiesUpdate(String capabilitiesId)

Gets the information for a phone number capabilities update

Parameters:

capabilitiesId - ID of the capabilities update.

Returns:

A Mono containing a UpdatePhoneNumberCapabilitiesResponse representing the capabilities update.

getCapabilitiesUpdateWithResponse

public Mono<Response<UpdatePhoneNumberCapabilitiesResponse>> getCapabilitiesUpdateWithResponse(String capabilitiesId)

Gets the information for a phone number capabilities update

Parameters:

capabilitiesId - ID of the capabilities update.

Returns:

A Mono containing a Response<T> whose Response#getValue() value returns a UpdatePhoneNumberCapabilitiesResponse representing the capabilities update.

getNumberConfiguration

public Mono<NumberConfigurationResponse> getNumberConfiguration(PhoneNumber phoneNumber)

Gets the configuration of a given phone number.

Parameters:

phoneNumber - A PhoneNumber representing the phone number.

Returns:

A Mono containing a NumberConfigurationResponse representing the configuration.

getNumberConfigurationWithResponse

public Mono<Response<NumberConfigurationResponse>> getNumberConfigurationWithResponse(PhoneNumber phoneNumber)

Gets the configuration of a given phone number.

Parameters:

phoneNumber - A PhoneNumber representing the phone number.

Returns:

A Mono containing a Response<T> whose Response#getValue() value returns a NumberConfigurationResponse representing the configuration.

getPhonePlanLocationOptions

public Mono<LocationOptionsResponse> getPhonePlanLocationOptions(String countryCode, String phonePlanGroupId, String phonePlanId, String locale)

Gets the location options for a phone plan.

Parameters:

countryCode - The ISO 3166-2 country code.
phonePlanGroupId - ID of the Phone Plan Group
phonePlanId - ID of the Phone Plan
locale - A language-locale pairing which will be used to localise the names of countries.

Returns:

A Mono containing a LocationOptionsResponse representing the location options

getPhonePlanLocationOptionsWithResponse

public Mono<Response<LocationOptionsResponse>> getPhonePlanLocationOptionsWithResponse(String countryCode, String phonePlanGroupId, String phonePlanId, String locale)

Gets the location options for a phone plan.

Parameters:

countryCode - The ISO 3166-2 country code.
phonePlanGroupId - ID of the Phone Plan Group
phonePlanId - ID of the Phone Plan
locale - A language-locale pairing which will be used to localise the names of countries.

Returns:

A Mono containing a Response<T> whose Response#getValue() value returns a LocationOptionsResponse representing the location options

getReleaseById

public Mono<PhoneNumberRelease> getReleaseById(String releaseId)

Gets a release by ID.

Parameters:

releaseId - ID of the Release

Returns:

A Mono containing a PhoneNumberRelease representing the release.

getReleaseByIdWithResponse

public Mono<Response<PhoneNumberRelease>> getReleaseByIdWithResponse(String releaseId)

Gets a release by ID.

Parameters:

releaseId - ID of the Release

Returns:

A Mono containing a Response<T> whose Response#getValue() value returns a PhoneNumberRelease representing the release.

getReservationById

public Mono<PhoneNumberReservation> getReservationById(String reservationId)

Gets a reservation by ID.

Parameters:

reservationId - ID of the reservation

Returns:

A Mono containing a PhoneNumberReservation representing the reservation.

getReservationByIdWithResponse

public Mono<Response<PhoneNumberReservation>> getReservationByIdWithResponse(String reservationId)

Gets a reservation by ID.

Parameters:

reservationId - ID of the reservation

Returns:

A Mono containing a Response<T> whose Response#getValue() value returns a PhoneNumberReservation representing the reservation.

listAllPhoneNumbers

public PagedFlux<AcquiredPhoneNumber> listAllPhoneNumbers(String locale)

Gets the list of the acquired phone numbers.

Parameters:

locale - A language-locale pairing which will be used to localise the names of countries.

Returns:

A PagedFlux<T> of AcquiredPhoneNumber instances representing acquired telephone numbers.

listAllReleases

public PagedFlux<PhoneNumberEntity> listAllReleases()

Gets the list of all releases

Returns:

A PagedFlux<T> of PhoneNumberEntity instances representing releases.

listAllReservations

public PagedFlux<PhoneNumberEntity> listAllReservations()

Gets the list of all reservations

Returns:

A PagedFlux<T> of PhoneNumberEntity instances representing reservations.

listAllSupportedCountries

public PagedFlux<PhoneNumberCountry> listAllSupportedCountries(String locale)

Gets a list of supported countries.

Parameters:

locale - A language-locale pairing which will be used to localise the names of countries.

Returns:

A PagedFlux<T> of PhoneNumberCountry instances representing supported countries.

listPhonePlanGroups

public PagedFlux<PhonePlanGroup> listPhonePlanGroups(String countryCode, String locale, Boolean includeRateInformation)

Gets a list of phone plan groups for the given country.

Parameters:

countryCode - The ISO 3166-2 country code.
locale - A language-locale pairing which will be used to localise the names of countries.
includeRateInformation - Flag to indicate if rate information should be returned.

Returns:

A PagedFlux<T> of PhonePlanGroup instances representing phone plan groups

listPhonePlans

public PagedFlux<PhonePlan> listPhonePlans(String countryCode, String phonePlanGroupId, String locale)

Gets a list of phone plans for a phone plan group

Parameters:

countryCode - The ISO 3166-2 country code.
phonePlanGroupId - ID of the Phone Plan Group
locale - A language-locale pairing which will be used to localise the names of countries.

Returns:

A PagedFlux<T> of PhonePlan instances representing phone plans

unconfigureNumber

public Mono<Void> unconfigureNumber(PhoneNumber phoneNumber)

Removes the PSTN Configuration from a phone number.

Parameters:

phoneNumber - A PhoneNumber representing the phone number.

Returns:

A Mono for the asynchronous return

unconfigureNumberWithResponse

public Mono<Response<Void>> unconfigureNumberWithResponse(PhoneNumber phoneNumber)

Removes the PSTN Configuration from a phone number.

Parameters:

phoneNumber - A PhoneNumber representing the phone number.

Returns:

A Mono containing a Response<T> for the operation.

updateCapabilities

public Mono<UpdateNumberCapabilitiesResponse> updateCapabilities(Map<PhoneNumber,NumberUpdateCapabilities> phoneNumberCapabilitiesUpdate)

Adds or removes phone number capabilities.

Parameters:

phoneNumberCapabilitiesUpdate - Map with the updates to perform

Returns:

A Mono containing a UpdatePhoneNumberCapabilitiesResponse representing the capabilities update.

updateCapabilitiesWithResponse

public Mono<Response<UpdateNumberCapabilitiesResponse>> updateCapabilitiesWithResponse(Map<PhoneNumber,NumberUpdateCapabilities> phoneNumberCapabilitiesUpdate)

Adds or removes phone number capabilities.

Parameters:

phoneNumberCapabilitiesUpdate - Map with the updates to perform

Returns:

A Mono containing a Response<T> whose Response#getValue() value returns a UpdatePhoneNumberCapabilitiesResponse representing the capabilities update.

Applies to