Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PhoneNumberAdministrationClient

Package version

Client class for interacting with Azure Communication Services PhoneNumber Administration.

Hierarchy

  • PhoneNumberAdministrationClient

Index

Constructors

constructor

Methods

beginPurchaseReservation

  • 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);

    Parameters

    Returns Promise<PollerLike<PollOperationState<void>, void>>

beginReleasePhoneNumbers

  • 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);

    Parameters

    Returns Promise<PollerLike<PollOperationState<PhoneNumberRelease>, PhoneNumberRelease>>

beginReservePhoneNumbers

  • 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);

    Parameters

    Returns Promise<PollerLike<PollOperationState<PhoneNumberReservation>, PhoneNumberReservation>>

cancelReservation

configurePhoneNumber

getAreaCodes

getCapabilitiesUpdate

getPhoneNumberConfiguration

getPhonePlanLocationOptions

getReservation

listPhoneNumbers

listPhonePlanGroups

  • 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);
    }
    summary

    List all available phone plan groups for a country.

    Parameters

    Returns PagedAsyncIterableIterator<PhonePlanGroup>

listPhonePlans

  • 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.

    Parameters

    Returns PagedAsyncIterableIterator<PhonePlan>

listReleases

  • 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.

    Parameters

    Returns PagedAsyncIterableIterator<PhoneNumberEntity>

listSearches

  • 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.

    Parameters

    Returns PagedAsyncIterableIterator<PhoneNumberEntity>

listSupportedCountries

unconfigurePhoneNumber

updatePhoneNumbersCapabilities

Generated using TypeDoc