Initializes a new instance of the PhoneNumberAdministrationClient class.
Connection string to connect to an Azure Communication Service resource. Example: "endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret";
Optional. Options to configure the HTTP pipeline.
Initializes a new instance of the PhoneNumberAdministrationClient class using an Azure KeyCredential.
The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).
An object that is used to authenticate requests to the service. Use the Azure KeyCredential or @azure/identity
to create a credential.
Optional. Options to configure the HTTP pipeline.
Starts the purchase of the phone number(s) in the reservation associated with a given id.
This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
Example usage:
const client = new PhoneNumberAdministrationClient(CONNECTION_STRING);
const purchasePoller = await client.beginPurchaseReservation(RESERVATION_ID);
// Serializing the poller
const serialized = purchasePoller.toString();
// Waiting until it's done
const results = await purchasePoller.pollUntilDone();
console.log(results);
The id of the reservation to purchase.
Additional request options.
Starts the release of a list of acquired phone numbers.
This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
Example usage:
const client = new PhoneNumberAdministrationClient(CONNECTION_STRING);
const releasePoller = await client.beginReleasePhoneNumbers(PHONE_NUMBERS);
// Serializing the poller
const serialized = releasePoller.toString();
// Waiting until it's done
const results = await releasePoller.pollUntilDone();
console.log(results);
The phone numbers to be released.
Additional request options.
Starts a search for phone numbers given some constraints such as name or area code. The phone numbers that are found are reserved until you cancel, purchase or the reservation expires.
This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
Example usage:
const client = new PhoneNumberAdministrationClient(CONNECTION_STRING);
const reservePoller = await client.beginReservePhoneNumbers(RESERVATION_REQUEST);
// Serializing the poller
const serialized = reservePoller.toString();
// Waiting until it's done
const results = await reservePoller.pollUntilDone();
console.log(results);
Request properties to constraint the search scope.
Additional request options.
Cancels the reservation associated with a given id.
The id of the reservation returned by createReservation.
Additional request options.
Configures a phone number, for example to assign a callbackUrl.
The configuration details
Additional request options.
Gets a list of the supported area codes based on location.
Request properties to constraint the search scope.
Additional request options.
Get the update capabilities request associated with a given id.
The id associated with the request.
Additional request options.
Gets the configuration for a given phone number.
The E.164 representation of the phone number whose configuration is requested.
Additional request options.
Gets the location options for a given phone plan.
Request properties to constraint the search scope.
Additional request options.
Gets the reservation associated with a given id. Use this function to query the status of a phone number reservation.
The id of the reservation returned by createReservation.
Additional request options.
Iterates the acquired phone numbers.
Example usage:
let client = new PhoneNumberAdministrationClient(credentials);
for await (const acquired of client.listPhoneNumbers()) {
console.log("phone number: ", acquired.phoneNumber);
}
Iterates the available phone plan groups for a country.
Example usage:
let client = new PhoneNumberAdministrationClient(credentials);
for await (const phonePlanGroup of client.listPhonePlanGroups("CA")) {
console.log("plan group id: ", phonePlanGroup.phonePlanGroupId);
}
Iterates the available phone plan for a plan group.
Example usage:
let client = new PhoneNumberAdministrationClient(credentials);
for await (const phonePlan of client.listPhonePlanGroups(PLAN_GROUP_INFO)) {
console.log("plan id: ", phonePlan.phonePlanId);
}
Gets all available phone plans for a given plan group.
@param planGroupInfo Information need to search for plans.
@param options Additional request options.
Iterates the releases created by the Azure resource.
Example usage:
let client = new PhoneNumberAdministrationClient(credentials);
for await (const entity of client.listReleases()) {
console.log("id: ", entity.id);
}
Gets all releases created by the Azure resource.
Iterates the searches created by the Azure resource.
Example usage:
let client = new PhoneNumberAdministrationClient(credentials);
for await (const entity of client.listReleases()) {
console.log("id: ", entity.id);
}
Gets all searches created by the Azure resource.
Iterates the supported countries.
Example usage:
let client = new PhoneNumberAdministrationClient(credentials);
for await (const country of client.listSupportedCountries()) {
console.log("country name: ", country.localizedName);
}
Unconfigure a phone number, resetting its' configuration.
Phone Number to unconfigure.
Additional request options.
Updates the capabilities for a list of phone numbers. The response includes the id of the created update capabilities request, remember that id for subsequent calls to getCapabilitiesUpdate.
Dictionary containing a list of phone numbers and their capabilities updates.
Additional request options.
Generated using TypeDoc
Client class for interacting with Azure Communication Services PhoneNumber Administration.