Skip to content

Commit

Permalink
Fixed apiview warnings (#17172)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeauregardb authored Mar 11, 2021
1 parent 7dd62a6 commit 5243d2e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,34 @@
# license information.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING
from azure.core.tracing.decorator import distributed_trace
from azure.core.paging import ItemPaged
from azure.core.polling import LROPoller
from ._generated._phone_numbers_client import PhoneNumbersClient as PhoneNumbersClientGen
from ._generated.models import PhoneNumberSearchRequest
from ._shared.utils import parse_connection_str, get_authentication_policy
from ._version import SDK_MONIKER

if TYPE_CHECKING:
from typing import Any
from azure.core.credentials import TokenCredential
from azure.core.paging import ItemPaged
from azure.core.polling import LROPoller
from ._generated.models import PhoneNumberSearchResult, PurchasedPhoneNumber, PhoneNumberCapabilities


class PhoneNumbersClient(object):
"""A client to interact with the AzureCommunicationService Phone Numbers gateway.
This client provides operations to interact with the phone numbers service
:param str endpoint:
The endpoint url for Azure Communication Service resource.
:param TokenCredential credential:
The credentials with which to authenticate.
"""
def __init__(
self,
endpoint, # type: str
credential, # type: str
credential, # type: TokenCredential
**kwargs # type: Any
):
# type: (...) -> None
Expand Down Expand Up @@ -84,7 +99,7 @@ def begin_release_phone_number(
**kwargs # type: Any
):
# type: (...) -> LROPoller[None]
"""Releases an acquired phone number.
"""Releases an purchased phone number.
:param phone_number: Phone number to be released, e.g. +55534567890.
:type phone_number: str
Expand Down Expand Up @@ -188,9 +203,9 @@ def get_purchased_phone_number(
**kwargs # type: Any
):
# type: (...) -> PurchasedPhoneNumber
"""Gets the details of the given acquired phone number.
"""Gets the details of the given purchased phone number.
:param phone_number: The acquired phone number whose details are to be fetched in E.164 format,
:param phone_number: The purchased phone number whose details are to be fetched in E.164 format,
e.g. +11234567890.
:type phone_number: str
:rtype: ~azure.communication.phonenumbers.models.PurchasedPhoneNumber
Expand All @@ -206,7 +221,7 @@ def list_purchased_phone_numbers(
**kwargs # type: Any
):
# type: (...) -> ItemPaged[PurchasedPhoneNumber]
"""Gets the list of all acquired phone numbers.
"""Gets the list of all purchased phone numbers.
:param skip: An optional parameter for how many entries to skip, for pagination purposes. The
default value is 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# license information.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.paging import ItemPaged
Expand All @@ -13,11 +14,26 @@
from .._shared.utils import parse_connection_str, get_authentication_policy
from .._version import SDK_MONIKER

if TYPE_CHECKING:
from typing import Any
from azure.core.credentials_async import AsyncTokenCredential
from azure.core.async_paging import AsyncItemPaged
from azure.core.polling import AsyncLROPoller
from .._generated.models import PhoneNumberSearchResult, PurchasedPhoneNumber, PhoneNumberCapabilities

class PhoneNumbersClient(object):
"""A client to interact with the AzureCommunicationService Phone Numbers gateway.
This client provides operations to interact with the phone numbers service
:param str endpoint:
The endpoint url for Azure Communication Service resource.
:param AsyncTokenCredential credential:
The credentials with which to authenticate.
"""
def __init__(
self,
endpoint, # type: str
credential, # type: str
credential, # type: AsyncTokenCredential
**kwargs # type: Any
):
# type: (...) -> None
Expand Down Expand Up @@ -85,7 +101,7 @@ async def begin_release_phone_number(
**kwargs # type: Any
):
# type: (...) -> AsyncLROPoller[None]
"""Releases an acquired phone number.
"""Releases an purchased phone number.
:param phone_number: Phone number to be released, e.g. +11234567890.
:type phone_number: str
Expand Down Expand Up @@ -190,9 +206,9 @@ async def get_purchased_phone_number(
**kwargs # type: Any
):
# type: (...) -> PurchasedPhoneNumber
"""Gets the details of the given acquired phone number.
"""Gets the details of the given purchased phone number.
:param phone_number: The acquired phone number whose details are to be fetched in E.164 format,
:param phone_number: The purchased phone number whose details are to be fetched in E.164 format,
e.g. +11234567890.
:type phone_number: str
:rtype: ~azure.communication.phonenumbers.models.PurchasedPhoneNumber
Expand All @@ -207,16 +223,16 @@ def list_purchased_phone_numbers(
self,
**kwargs # type: Any
):
# type: (...) -> AsyncItemPaged[AcquiredPhoneNumbers]
"""Gets the list of all acquired phone numbers.
# type: (...) -> AsyncItemPaged[PurchasedPhoneNumber]
"""Gets the list of all purchased phone numbers.
:param skip: An optional parameter for how many entries to skip, for pagination purposes. The
default value is 0.
:type skip: int
:param top: An optional parameter for how many entries to return, for pagination purposes. The
default value is 100.
:type top: int
:rtype: ~azure.core.paging.AsyncItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers]
:rtype: ~azure.core.paging.AsyncItemPaged[~azure.communication.phonenumbers.models.PurchasedPhoneNumber]
"""
return self._phone_number_client.phone_numbers.list_phone_numbers(
**kwargs
Expand Down

0 comments on commit 5243d2e

Please sign in to comment.