Skip to content

fixed linting issues #35662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
from typing import TYPE_CHECKING, Optional, Union
from azure.core.tracing.decorator import distributed_trace
from azure.core.exceptions import HttpResponseError

from azure.core.credentials import TokenCredential, AzureKeyCredential
from azure.core.paging import ItemPaged
from azure.core.polling import LROPoller

from ._generated._client import PhoneNumbersClient as PhoneNumbersClientGen
from ._generated.models import (
PhoneNumberSearchRequest,
Expand All @@ -20,24 +25,22 @@
from ._shared.auth_policy_utils import get_authentication_policy
from ._shared.utils import parse_connection_str
from ._version import SDK_MONIKER


from ._api_versions import DEFAULT_VERSION
from ._generated.models import (
PhoneNumberCapabilities,
PhoneNumberCountry,
PhoneNumberOffering,
PhoneNumberLocality,
PhoneNumberSearchResult,
PurchasedPhoneNumber,
)

_DEFAULT_POLLING_INTERVAL_IN_SECONDS = 2

if TYPE_CHECKING:
from typing import Any
from azure.core.credentials import TokenCredential, AzureKeyCredential
from azure.core.paging import ItemPaged
from azure.core.polling import LROPoller
from ._generated.models import (
PhoneNumberCapabilities,
PhoneNumberCapabilityType,
PhoneNumberCountry,
PhoneNumberOffering,
PhoneNumberLocality,
PhoneNumberSearchResult,
PurchasedPhoneNumber,
)
pass

class PhoneNumbersClient(object):
"""A client to interact with the AzureCommunicationService Phone Numbers gateway.
Expand Down Expand Up @@ -104,16 +107,12 @@ def begin_purchase_phone_numbers(
**kwargs # type: Any
):
# type: (...) -> LROPoller[None]
"""Purchases phone numbers.
"""
Purchases phone numbers.

:param search_id: The search id.
:type search_id: str
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the LROBasePolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time (seconds) between two polls
for LRO operations if no Retry-After header is present.
:return: An instance of LROPoller that returns None.
:rtype: ~azure.core.polling.LROPoller[None]
"""
purchase_request = PhoneNumberPurchaseRequest(search_id=search_id)
Expand All @@ -137,12 +136,7 @@ def begin_release_phone_number(

:param phone_number: Phone number to be released, e.g. +55534567890.
:type phone_number: str
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the LROBasePolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time (seconds) between two polls
for LRO operations if no Retry-After header is present.
:return: An instance of LROPoller that returns None.
:rtype: ~azure.core.polling.LROPoller[None]
"""
polling_interval = kwargs.pop(
Expand Down Expand Up @@ -177,15 +171,7 @@ def begin_search_available_phone_numbers(
~azure.communication.phonenumbers.models.PhoneNumberAssignmentType
:param capabilities: Required. Capabilities of a phone number.
:type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities
:keyword str area_code: The area code of the desired phone number, e.g. 425. If not set,
any area code could be used in the final search.
:keyword int quantity: The quantity of phone numbers in the search. Default is 1.
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the LROBasePolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time (seconds) between two polls
for LRO operations if no Retry-After header is present.
:return: An instance of LROPoller that returns PhoneNumberSearchResult.
:rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult]
"""
search_request = PhoneNumberSearchRequest(
Expand Down Expand Up @@ -222,12 +208,7 @@ def begin_update_phone_number_capabilities(
:type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType
:param sms: Capability value for SMS.
:type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the LROBasePolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time (seconds) between two polls
for LRO operations if no Retry-After header is present.
:return: An instance of LROPoller that returns PurchasedPhoneNumber.
:rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.PurchasedPhoneNumber]
"""

Expand Down Expand Up @@ -282,12 +263,7 @@ def list_purchased_phone_numbers(
# type: (...) -> ItemPaged[PurchasedPhoneNumber]
"""Gets the list of all purchased phone numbers.

:keyword skip: An optional parameter for how many entries to skip, for pagination purposes. The
default value is 0. Default value is 0.
:paramtype skip: int
:keyword top: An optional parameter for how many entries to return, for pagination purposes.
The default value is 100. Default value is 100.
:paramtype top: int
:return: An iterator like instance of PurchasedPhoneNumber
:rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.PurchasedPhoneNumber]
"""
return self._phone_number_client.phone_numbers.list_phone_numbers(
Expand All @@ -302,11 +278,6 @@ def list_available_countries(
# type: (...) -> ItemPaged[PhoneNumberCountry]
"""Gets the list of supported countries.

Gets the list of supported countries.

:keyword skip: An optional parameter for how many entries to skip, for pagination purposes. The
default value is 0. Default value is 0.
:paramtype skip: int
:return: An iterator like instance of PhoneNumberCountry
:rtype:
~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.PhoneNumberCountry]
Expand All @@ -326,16 +297,8 @@ def list_available_localities(
# type: (...) -> ItemPaged[PhoneNumberLocality]
"""Gets the list of cities or towns with available phone numbers.

Gets the list of cities or towns with available phone numbers.

:param country_code: The ISO 3166-2 country/region two letter code, e.g. US. Required.
:type country_code: str
:param administrative_division: An optional parameter for the name of the state or province
in which to search for the area code. e.g. California. Default value is None.
:type administrative_division: str
:keyword skip: An optional parameter for how many entries to skip, for pagination purposes. The
default value is 0. Default value is 0.
:paramtype skip: int
:return: An iterator like instance of PhoneNumberLocality
:rtype:
~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.PhoneNumberLocality]
Expand All @@ -358,19 +321,8 @@ def list_available_offerings(
# type: (...) -> ItemPaged[PhoneNumberOffering]
"""List available offerings of capabilities with rates for the given country/region.

List available offerings of capabilities with rates for the given country/region.

:param country_code: The ISO 3166-2 country/region two letter code, e.g. US. Required.
:type country_code: str
:param phone_number_type: Filter by phoneNumberType, e.g. Geographic, TollFree. Known values
are: "geographic" and "tollFree". Default value is None.
:type phone_number_type: ~azure.communication.phonenumbers.models.PhoneNumberType
:param assignment_type: Filter by assignmentType, e.g. User, Application. Known values are:
"person" and "application". Default value is None.
:type assignment_type: ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType
:keyword skip: An optional parameter for how many entries to skip, for pagination purposes. The
default value is 0. Default value is 0.
:paramtype skip: int
:return: An iterator like instance of PhoneNumberOffering
:rtype:
~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.PhoneNumberOffering]
Expand Down Expand Up @@ -398,18 +350,6 @@ def list_available_area_codes(
:param phone_number_type: Filter by phone number type, e.g. Geographic, TollFree. Known values are:
"geographic" and "tollFree". Required.
:type phone_number_type: ~azure.communication.phonenumbers.models.PhoneNumberType
:param assignment_type: Filter by assignmentType, e.g. User, Application. Known values are:
"person" and "application". Default value is None.
:type assignment_type: ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType
:param locality: The name of locality in which to search for the area code. e.g. Seattle.
This is required if the phone number type is Geographic. Default value is None.
:type locality: str
:keyword administrative_division: The name of the state or province in which to search for the
area code. e.g. California. Default value is None.
:type administrative_division: str
:keyword skip: An optional parameter for how many entries to skip, for pagination purposes. The
default value is 0. Default value is 0.
:paramtype skip: int
:return: An iterator like instance of PhoneNumberAreaCode
:rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.PhoneNumberAreaCode]
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down
Loading
Loading