Skip to content

Commit ae0df3f

Browse files
authored
Number Insight GA (Azure#38793)
* Add number lookup GA * Add GA release of Number Insight to changelog * add number insight models to init file to make them public * add PhoneNumberSearchResultError to init file to make them public * error code and error from PhoneNumberSearchResult to match previous stable version * disable pylint docstring-keyword-should-match-keyword-only * fixed async search operatorInformation * Change code comment, Mobile Network Code -> ISO 2 Mobile Network Code; Mobile Country Code -> ISO 2 Mobile Country Code * update docs * regenerate comments * fix doc comment policy issue * options becomes a kwarg * fix pylint and docs * update change logs for options as kwarg
1 parent 787a443 commit ae0df3f

File tree

27 files changed

+594
-449
lines changed

27 files changed

+594
-449
lines changed

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

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

3+
## 1.2.0 (2025-02-11)
4+
5+
### Features Added
6+
- GA release of Number Insight.
7+
- API version `2025-02-11` is the default.
8+
9+
## Other changes
10+
- Updated `search_operator_information` method signature to enforce `options` as a keyword-only argument.
11+
312
## 1.2.0b2 (2024-03-01)
413

514
### Features Added

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_f1965f9584"
5+
"Tag": "python/communication/azure-communication-phonenumbers_a45b7bec94"
66
}

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

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,27 @@
2020
PhoneNumberCountry,
2121
PhoneNumberLocality,
2222
PhoneNumberOffering,
23+
OperatorInformationOptions,
24+
OperatorInformation,
2325
OperatorInformationResult,
2426
)
2527

2628
__all__ = [
27-
"PurchasedPhoneNumber",
28-
"PhoneNumberCapabilities",
29-
"PhoneNumberCost",
30-
"PhoneNumberSearchResult",
31-
"BillingFrequency",
32-
"PhoneNumberAssignmentType",
33-
"PhoneNumberCapabilityType",
34-
"PhoneNumberType",
35-
"PhoneNumberAreaCode",
36-
"PhoneNumberAdministrativeDivision",
37-
"PhoneNumberCountry",
38-
"PhoneNumberLocality",
39-
"PhoneNumberOffering",
40-
"OperatorInformationResult",
41-
"PhoneNumbersClient",
29+
'PurchasedPhoneNumber',
30+
'PhoneNumberCapabilities',
31+
'PhoneNumberCost',
32+
'PhoneNumberSearchResult',
33+
'BillingFrequency',
34+
'PhoneNumberAssignmentType',
35+
'PhoneNumberCapabilityType',
36+
'PhoneNumberType',
37+
'PhoneNumberAreaCode',
38+
'PhoneNumberAdministrativeDivision',
39+
'PhoneNumberCountry',
40+
'PhoneNumberLocality',
41+
'PhoneNumberOffering',
42+
'OperatorInformationOptions',
43+
'OperatorInformation',
44+
'OperatorInformationResult',
45+
'PhoneNumbersClient'
4246
]

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
@@ -12,6 +12,7 @@ class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
1212
V2022_12_01 = "2022-12-01"
1313
V2023_05_01_PREVIEW = "2023-05-01-preview"
1414
V2024_03_01_PREVIEW = "2024-03-01-preview"
15+
V2025_02_11 = "2025-02-11"
1516

1617

17-
DEFAULT_VERSION = ApiVersion.V2024_03_01_PREVIEW
18+
DEFAULT_VERSION = ApiVersion.V2025_02_11

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._client import PhoneNumbersClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import PhoneNumbersClient # type: ignore
1016

1117
try:
1218
from ._patch import __all__ as _patch_all
13-
from ._patch import * # pylint: disable=unused-wildcard-import
19+
from ._patch import *
1420
except ImportError:
1521
_patch_all = []
1622
from ._patch import patch_sdk as _patch_sdk
1723

1824
__all__ = [
1925
"PhoneNumbersClient",
2026
]
21-
__all__.extend([p for p in _patch_all if p not in __all__])
27+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2228

2329
_patch_sdk()

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any
11+
from typing_extensions import Self
1112

1213
from azure.core import PipelineClient
1314
from azure.core.pipeline import policies
@@ -19,7 +20,7 @@
1920
from .operations import PhoneNumbersOperations
2021

2122

22-
class PhoneNumbersClient: # pylint: disable=client-accepts-api-version-keyword
23+
class PhoneNumbersClient:
2324
"""The phone numbers client uses Azure Communication Services to purchase and manage phone
2425
numbers.
2526
@@ -28,8 +29,8 @@ class PhoneNumbersClient: # pylint: disable=client-accepts-api-version-keyword
2829
:param endpoint: The communication resource, for example
2930
https://resourcename.communication.azure.com. Required.
3031
:type endpoint: str
31-
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
32-
this default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2025-02-11". Note that overriding this
33+
default value may result in unsupported behavior.
3334
:paramtype api_version: str
3435
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
3536
Retry-After header is present.
@@ -95,7 +96,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
9596
def close(self) -> None:
9697
self._client.close()
9798

98-
def __enter__(self) -> "PhoneNumbersClient":
99+
def __enter__(self) -> Self:
99100
self._client.__enter__()
100101
return self
101102

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
VERSION = "unknown"
1414

1515

16-
class PhoneNumbersClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
16+
class PhoneNumbersClientConfiguration: # pylint: disable=too-many-instance-attributes
1717
"""Configuration for PhoneNumbersClient.
1818
1919
Note that all parameters used to create this instance are saved as instance
@@ -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 "2024-03-01-preview". Note that overriding
26-
this default value may result in unsupported behavior.
25+
:keyword api_version: Api Version. Default value is "2025-02-11". Note that overriding this
26+
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", "2024-03-01-preview")
31+
api_version: str = kwargs.pop("api_version", "2025-02-11")
3232

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Copyright (c) Microsoft Corporation.
33
# Licensed under the MIT License.
44
# ------------------------------------
5+
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize

0 commit comments

Comments
 (0)