Skip to content

Commit 9c906cc

Browse files
sofiar-msftandrewjhopkinsannatisch
authored
Sofiar/beta mobile (#41649)
* add mobile number * use 2025-06-01 * update readme * update default api version * Add missing phone_number_type to public client * Update recordings * Fix capabilities recordings * Update PHONE_NUMBER_SWAGGER.md to use public spec * Add clarification on phone number types and grouping in README.md * Update development status to reflect beta stage in setup.py * Add phone number type to list available localities * Add phone number type to list available localities * Fix pylint * Fix comments * Fix pylint issues * Fix spacing in comments * Add optional phone number type * Update _phone_numbers_client.py * Update _phone_numbers_client_async.py * Add release date --------- Co-authored-by: Andrew Hopkins <anhopki@microsoft.com> Co-authored-by: Andrew Hopkins <ahopkins0929@gmail.com> Co-authored-by: Anna Tisch <8689453+annatisch@users.noreply.github.com>
1 parent e81b4c3 commit 9c906cc

20 files changed

+310
-143
lines changed

sdk/communication/azure-communication-phonenumbers/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Release History
22

3+
## 1.4.0b1 (2025-07-22)
4+
5+
### Features Added
6+
- Adds support for mobile number types
7+
- mobile numbers are location associated phone numbers with SMS capabilities
8+
- API version `2025-06-01` is the default.
9+
310
## 1.3.0 (2025-06-20)
411

512
### Features Added

sdk/communication/azure-communication-phonenumbers/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pip install azure-communication-phonenumbers
2222

2323
This SDK provides functionality to easily manage `direct offer` and `direct routing` numbers.
2424

25-
The `direct offer` numbers come in two types: Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.
25+
The `direct offer` numbers come in three types: Geographic, Toll-Free and Mobile. Geographic and Mobile phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.
2626
They are managed using the `PhoneNumbersClient`
2727

2828
The `direct routing` feature enables connecting your existing telephony infrastructure to ACS.
@@ -77,7 +77,9 @@ sip_routing_client = SipRoutingClient.from_connection_string(connection_str)
7777

7878
#### Phone number types overview
7979

80-
Phone numbers come in two types; Geographic and Toll-Free. Geographic phone numbers are phone numbers associated with a location, whose area codes are associated with the area code of a geographic location. Toll-Free phone numbers are phone numbers with no associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.
80+
Phone numbers come in three types; Geographic, Toll-Free and Mobile. Toll-Free numbers are not associated with a location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888. Geographic and Mobile phone numbers are phone numbers associated with a location.
81+
82+
Phone number types with the same country are grouped into a phone plan group with that phone number type. For example all Toll-Free phone numbers within the same country are grouped into a phone plan group.
8183

8284
#### Searching and Purchasing and Releasing numbers
8385

sdk/communication/azure-communication-phonenumbers/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/communication/azure-communication-phonenumbers",
5-
"Tag": "python/communication/azure-communication-phonenumbers_db3a0ba22d"
5+
"Tag": "python/communication/azure-communication-phonenumbers_ee055c0573"
66
}

sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_api_versions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
1414
V2024_03_01_PREVIEW = "2024-03-01-preview"
1515
V2025_02_11 = "2025-02-11"
1616
V2025_04_01 = "2025-04-01"
17+
V2025_06_01 = "2025-06-01"
1718

1819

19-
DEFAULT_VERSION = ApiVersion.V2025_04_01
20+
DEFAULT_VERSION = ApiVersion.V2025_06_01

sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class PhoneNumbersClient:
2929
:param endpoint: The communication resource, for example
3030
https://resourcename.communication.azure.com. Required.
3131
:type endpoint: str
32-
:keyword api_version: Api Version. Default value is "2025-04-01". Note that overriding this
32+
:keyword api_version: Api Version. Default value is "2025-06-01". Note that overriding this
3333
default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ class PhoneNumbersClientConfiguration: # pylint: disable=too-many-instance-attr
2222
:param endpoint: The communication resource, for example
2323
https://resourcename.communication.azure.com. Required.
2424
:type endpoint: str
25-
:keyword api_version: Api Version. Default value is "2025-04-01". Note that overriding this
25+
:keyword api_version: Api Version. Default value is "2025-06-01". Note that overriding this
2626
default value may result in unsupported behavior.
2727
:paramtype api_version: str
2828
"""
2929

3030
def __init__(self, endpoint: str, **kwargs: Any) -> None:
31-
api_version: str = kwargs.pop("api_version", "2025-04-01")
31+
api_version: str = kwargs.pop("api_version", "2025-06-01")
3232

3333
if endpoint is None:
3434
raise ValueError("Parameter 'endpoint' must not be None.")

sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class PhoneNumbersClient:
2929
:param endpoint: The communication resource, for example
3030
https://resourcename.communication.azure.com. Required.
3131
:type endpoint: str
32-
:keyword api_version: Api Version. Default value is "2025-04-01". Note that overriding this
32+
:keyword api_version: Api Version. Default value is "2025-06-01". Note that overriding this
3333
default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ class PhoneNumbersClientConfiguration: # pylint: disable=too-many-instance-attr
2222
:param endpoint: The communication resource, for example
2323
https://resourcename.communication.azure.com. Required.
2424
:type endpoint: str
25-
:keyword api_version: Api Version. Default value is "2025-04-01". Note that overriding this
25+
:keyword api_version: Api Version. Default value is "2025-06-01". Note that overriding this
2626
default value may result in unsupported behavior.
2727
:paramtype api_version: str
2828
"""
2929

3030
def __init__(self, endpoint: str, **kwargs: Any) -> None:
31-
api_version: str = kwargs.pop("api_version", "2025-04-01")
31+
api_version: str = kwargs.pop("api_version", "2025-06-01")
3232

3333
if endpoint is None:
3434
raise ValueError("Parameter 'endpoint' must not be None.")

sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_operations.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# --------------------------------------------------------------------------
99
from collections.abc import MutableMapping
1010
from io import IOBase
11-
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
11+
from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
1212
import urllib.parse
1313

1414
from azure.core import AsyncPipelineClient
@@ -93,15 +93,15 @@ def list_area_codes(
9393
administrative_division: Optional[str] = None,
9494
accept_language: Optional[str] = None,
9595
**kwargs: Any
96-
) -> AsyncIterable["_models.PhoneNumberAreaCode"]:
96+
) -> AsyncItemPaged["_models.PhoneNumberAreaCode"]:
9797
"""Gets the list of available area codes.
9898
9999
Gets the list of available area codes.
100100
101101
:param country_code: The ISO 3166-2 country code, e.g. US. Required.
102102
:type country_code: str
103-
:keyword phone_number_type: Filter by numberType, e.g. Geographic, TollFree. Known values are:
104-
"geographic" and "tollFree". Required.
103+
:keyword phone_number_type: Filter by numberType, e.g. Geographic, TollFree, Mobile. Known
104+
values are: "geographic", "tollFree", and "mobile". Required.
105105
:paramtype phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType
106106
:keyword skip: An optional parameter for how many entries to skip, for pagination purposes. The
107107
default value is 0. Default value is 0.
@@ -215,7 +215,7 @@ async def get_next(next_link=None):
215215
@distributed_trace
216216
def list_available_countries(
217217
self, *, skip: int = 0, max_page_size: int = 100, accept_language: Optional[str] = None, **kwargs: Any
218-
) -> AsyncIterable["_models.PhoneNumberCountry"]:
218+
) -> AsyncItemPaged["_models.PhoneNumberCountry"]:
219219
"""Gets the list of supported countries.
220220
221221
Gets the list of supported countries.
@@ -461,8 +461,9 @@ def list_available_localities(
461461
max_page_size: int = 100,
462462
administrative_division: Optional[str] = None,
463463
accept_language: Optional[str] = None,
464+
phone_number_type: Optional[Union[str, _models.PhoneNumberType]] = None,
464465
**kwargs: Any
465-
) -> AsyncIterable["_models.PhoneNumberLocality"]:
466+
) -> AsyncItemPaged["_models.PhoneNumberLocality"]:
466467
"""Gets the list of cities or towns with available phone numbers.
467468
468469
Gets the list of cities or towns with available phone numbers.
@@ -481,6 +482,9 @@ def list_available_localities(
481482
:keyword accept_language: The locale to display in the localized fields in the response. e.g.
482483
'en-US'. Default value is None.
483484
:paramtype accept_language: str
485+
:keyword phone_number_type: Filter by numberType, e.g. Geographic, TollFree, Mobile. Known
486+
values are: "geographic", "tollFree", and "mobile". Default value is None.
487+
:paramtype phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType
484488
:return: An iterator like instance of PhoneNumberLocality
485489
:rtype:
486490
~azure.core.async_paging.AsyncItemPaged[~azure.communication.phonenumbers.models.PhoneNumberLocality]
@@ -508,6 +512,7 @@ def prepare_request(next_link=None):
508512
max_page_size=max_page_size,
509513
administrative_division=administrative_division,
510514
accept_language=accept_language,
515+
phone_number_type=phone_number_type,
511516
api_version=self._config.api_version,
512517
headers=_headers,
513518
params=_params,
@@ -579,7 +584,7 @@ def list_offerings(
579584
assignment_type: Optional[Union[str, _models.PhoneNumberAssignmentType]] = None,
580585
accept_language: Optional[str] = None,
581586
**kwargs: Any
582-
) -> AsyncIterable["_models.PhoneNumberOffering"]:
587+
) -> AsyncItemPaged["_models.PhoneNumberOffering"]:
583588
"""List available offerings of capabilities with rates for the given country.
584589
585590
List available offerings of capabilities with rates for the given country.
@@ -592,8 +597,8 @@ def list_offerings(
592597
:keyword max_page_size: An optional parameter for how many entries to return, for pagination
593598
purposes. The default value is 100. Default value is 100.
594599
:paramtype max_page_size: int
595-
:keyword phone_number_type: Filter by numberType, e.g. Geographic, TollFree. Known values are:
596-
"geographic" and "tollFree". Default value is None.
600+
:keyword phone_number_type: Filter by numberType, e.g. Geographic, TollFree, Mobile. Known
601+
values are: "geographic", "tollFree", and "mobile". Default value is None.
597602
:paramtype phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType
598603
:keyword assignment_type: Filter by assignmentType, e.g. Person, Application. Known values are:
599604
"person" and "application". Default value is None.
@@ -693,7 +698,7 @@ async def get_next(next_link=None):
693698
@distributed_trace
694699
def list_reservations(
695700
self, *, max_page_size: int = 100, **kwargs: Any
696-
) -> AsyncIterable["_models.PhoneNumbersReservation"]:
701+
) -> AsyncItemPaged["_models.PhoneNumbersReservation"]:
697702
"""Lists all reservations.
698703
699704
Retrieves a paginated list of all phone number reservations. Note that the reservations will
@@ -2147,7 +2152,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
21472152
@distributed_trace
21482153
def list_phone_numbers(
21492154
self, *, skip: int = 0, top: int = 100, **kwargs: Any
2150-
) -> AsyncIterable["_models.PurchasedPhoneNumber"]:
2155+
) -> AsyncItemPaged["_models.PurchasedPhoneNumber"]:
21512156
"""Gets the list of all purchased phone numbers.
21522157
21532158
Gets the list of all purchased phone numbers.

sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class PhoneNumberType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
9999

100100
GEOGRAPHIC = "geographic"
101101
TOLL_FREE = "tollFree"
102+
MOBILE = "mobile"
102103

103104

104105
class ReservationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):

0 commit comments

Comments
 (0)