Skip to content

Commit 5243d2e

Browse files
authored
Fixed apiview warnings (#17172)
1 parent 7dd62a6 commit 5243d2e

File tree

2 files changed

+45
-14
lines changed

2 files changed

+45
-14
lines changed

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

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,34 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7+
from typing import TYPE_CHECKING
78
from azure.core.tracing.decorator import distributed_trace
8-
from azure.core.paging import ItemPaged
9-
from azure.core.polling import LROPoller
109
from ._generated._phone_numbers_client import PhoneNumbersClient as PhoneNumbersClientGen
1110
from ._generated.models import PhoneNumberSearchRequest
1211
from ._shared.utils import parse_connection_str, get_authentication_policy
1312
from ._version import SDK_MONIKER
1413

14+
if TYPE_CHECKING:
15+
from typing import Any
16+
from azure.core.credentials import TokenCredential
17+
from azure.core.paging import ItemPaged
18+
from azure.core.polling import LROPoller
19+
from ._generated.models import PhoneNumberSearchResult, PurchasedPhoneNumber, PhoneNumberCapabilities
20+
21+
1522
class PhoneNumbersClient(object):
23+
"""A client to interact with the AzureCommunicationService Phone Numbers gateway.
24+
25+
This client provides operations to interact with the phone numbers service
26+
:param str endpoint:
27+
The endpoint url for Azure Communication Service resource.
28+
:param TokenCredential credential:
29+
The credentials with which to authenticate.
30+
"""
1631
def __init__(
1732
self,
1833
endpoint, # type: str
19-
credential, # type: str
34+
credential, # type: TokenCredential
2035
**kwargs # type: Any
2136
):
2237
# type: (...) -> None
@@ -84,7 +99,7 @@ def begin_release_phone_number(
8499
**kwargs # type: Any
85100
):
86101
# type: (...) -> LROPoller[None]
87-
"""Releases an acquired phone number.
102+
"""Releases an purchased phone number.
88103
89104
:param phone_number: Phone number to be released, e.g. +55534567890.
90105
:type phone_number: str
@@ -188,9 +203,9 @@ def get_purchased_phone_number(
188203
**kwargs # type: Any
189204
):
190205
# type: (...) -> PurchasedPhoneNumber
191-
"""Gets the details of the given acquired phone number.
206+
"""Gets the details of the given purchased phone number.
192207
193-
:param phone_number: The acquired phone number whose details are to be fetched in E.164 format,
208+
:param phone_number: The purchased phone number whose details are to be fetched in E.164 format,
194209
e.g. +11234567890.
195210
:type phone_number: str
196211
:rtype: ~azure.communication.phonenumbers.models.PurchasedPhoneNumber
@@ -206,7 +221,7 @@ def list_purchased_phone_numbers(
206221
**kwargs # type: Any
207222
):
208223
# type: (...) -> ItemPaged[PurchasedPhoneNumber]
209-
"""Gets the list of all acquired phone numbers.
224+
"""Gets the list of all purchased phone numbers.
210225
211226
:param skip: An optional parameter for how many entries to skip, for pagination purposes. The
212227
default value is 0.

sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7+
from typing import TYPE_CHECKING
78
from azure.core.tracing.decorator import distributed_trace
89
from azure.core.tracing.decorator_async import distributed_trace_async
910
from azure.core.paging import ItemPaged
@@ -13,11 +14,26 @@
1314
from .._shared.utils import parse_connection_str, get_authentication_policy
1415
from .._version import SDK_MONIKER
1516

17+
if TYPE_CHECKING:
18+
from typing import Any
19+
from azure.core.credentials_async import AsyncTokenCredential
20+
from azure.core.async_paging import AsyncItemPaged
21+
from azure.core.polling import AsyncLROPoller
22+
from .._generated.models import PhoneNumberSearchResult, PurchasedPhoneNumber, PhoneNumberCapabilities
23+
1624
class PhoneNumbersClient(object):
25+
"""A client to interact with the AzureCommunicationService Phone Numbers gateway.
26+
27+
This client provides operations to interact with the phone numbers service
28+
:param str endpoint:
29+
The endpoint url for Azure Communication Service resource.
30+
:param AsyncTokenCredential credential:
31+
The credentials with which to authenticate.
32+
"""
1733
def __init__(
1834
self,
1935
endpoint, # type: str
20-
credential, # type: str
36+
credential, # type: AsyncTokenCredential
2137
**kwargs # type: Any
2238
):
2339
# type: (...) -> None
@@ -85,7 +101,7 @@ async def begin_release_phone_number(
85101
**kwargs # type: Any
86102
):
87103
# type: (...) -> AsyncLROPoller[None]
88-
"""Releases an acquired phone number.
104+
"""Releases an purchased phone number.
89105
90106
:param phone_number: Phone number to be released, e.g. +11234567890.
91107
:type phone_number: str
@@ -190,9 +206,9 @@ async def get_purchased_phone_number(
190206
**kwargs # type: Any
191207
):
192208
# type: (...) -> PurchasedPhoneNumber
193-
"""Gets the details of the given acquired phone number.
209+
"""Gets the details of the given purchased phone number.
194210
195-
:param phone_number: The acquired phone number whose details are to be fetched in E.164 format,
211+
:param phone_number: The purchased phone number whose details are to be fetched in E.164 format,
196212
e.g. +11234567890.
197213
:type phone_number: str
198214
:rtype: ~azure.communication.phonenumbers.models.PurchasedPhoneNumber
@@ -207,16 +223,16 @@ def list_purchased_phone_numbers(
207223
self,
208224
**kwargs # type: Any
209225
):
210-
# type: (...) -> AsyncItemPaged[AcquiredPhoneNumbers]
211-
"""Gets the list of all acquired phone numbers.
226+
# type: (...) -> AsyncItemPaged[PurchasedPhoneNumber]
227+
"""Gets the list of all purchased phone numbers.
212228
213229
:param skip: An optional parameter for how many entries to skip, for pagination purposes. The
214230
default value is 0.
215231
:type skip: int
216232
:param top: An optional parameter for how many entries to return, for pagination purposes. The
217233
default value is 100.
218234
:type top: int
219-
:rtype: ~azure.core.paging.AsyncItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers]
235+
:rtype: ~azure.core.paging.AsyncItemPaged[~azure.communication.phonenumbers.models.PurchasedPhoneNumber]
220236
"""
221237
return self._phone_number_client.phone_numbers.list_phone_numbers(
222238
**kwargs

0 commit comments

Comments
 (0)