Skip to content
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

Fix Pylint warnings for the new checkers #26269

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7a84f54
fixing lint issues
olena-stoliarova Sep 16, 2022
02e7819
Merge branch 'main' of https://github.com/ostoliarova-msft/azure-sdk-…
olena-stoliarova Sep 16, 2022
0fb4e07
fixing imports for phone numbers clients
olena-stoliarova Sep 16, 2022
a2b2897
regenerating sms and chat clients
olena-stoliarova Sep 27, 2022
b969f15
fixing failing tests
olena-stoliarova Sep 27, 2022
b0f3aa7
specifying exact commit for chat swagger
olena-stoliarova Sep 27, 2022
a5539f4
Merge branch 'main' of https://github.com/ostoliarova-msft/azure-sdk-…
olena-stoliarova Sep 30, 2022
e8f1fc3
making comments more precise and fixing pylint warnings for jobrouter
olena-stoliarova Sep 30, 2022
69c409c
fixing long lines in comments
olena-stoliarova Sep 30, 2022
bd4e29e
Merge branch 'main' of https://github.com/ostoliarova-msft/azure-sdk-…
olena-stoliarova Oct 5, 2022
ceef55f
regenerate chat with new autorest version
olena-stoliarova Oct 12, 2022
aca2c40
regenerate phonenumbers code with new autorest
olena-stoliarova Oct 12, 2022
52f94ad
Merge branch 'main' of https://github.com/ostoliarova-msft/azure-sdk-…
olena-stoliarova Oct 12, 2022
edd1bf3
Merge branch 'main' of https://github.com/ostoliarova-msft/azure-sdk-…
olena-stoliarova Oct 13, 2022
508267f
rollback changes for sms modality
olena-stoliarova Oct 17, 2022
0b3e3a5
rollback changes for sms modality
olena-stoliarova Oct 17, 2022
49913f3
rollback changes for sms modality
olena-stoliarova Oct 17, 2022
e3d64fe
add missing versions file
olena-stoliarova Oct 17, 2022
9417329
Merge branch 'main' of https://github.com/ostoliarova-msft/azure-sdk-…
olena-stoliarova Oct 17, 2022
4f27c29
move to correct directory
olena-stoliarova Oct 17, 2022
559bf7e
fixing lint error
olena-stoliarova Oct 17, 2022
31b5b8d
update changelogs
olena-stoliarova Oct 20, 2022
e548305
rollback chat changes
olena-stoliarova Oct 24, 2022
212e2e0
rollback chat changes
olena-stoliarova Oct 24, 2022
722b360
rollback chat changes
olena-stoliarova Oct 24, 2022
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
1 change: 1 addition & 0 deletions sdk/communication/azure-communication-email/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.0.0b2 (Unreleased)

### Features Added
- Added the ability specify the API version by an optional `api_version` keyword parameter.

### Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------

from enum import Enum
from azure.core import CaseInsensitiveEnumMeta


class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
V2021_10_01_PREVIEW = "2021-10-01-preview"


DEFAULT_VERSION = ApiVersion.V2021_10_01_PREVIEW
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
from ._generated._azure_communication_email_service import AzureCommunicationEmailService
from ._version import SDK_MONIKER
from ._generated.models import SendEmailResult, SendStatusResult, EmailMessage
from ._api_versions import DEFAULT_VERSION

class EmailClient(object): # pylint: disable=client-accepts-api-version-keyword

class EmailClient(object):
"""A client to interact with the AzureCommunicationService Email gateway.

This client provides operations to send an email and monitor its status.
Expand All @@ -24,6 +26,10 @@ class EmailClient(object): # pylint: disable=client-accepts-api-version-keyword
The endpoint url for Azure Communication Service resource.
:param Union[TokenCredential, AzureKeyCredential] credential:
The credential we use to authenticate against the service.
:keyword api_version: Azure Communication Email API version.
Default value is "2021-10-01-preview".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
Expand All @@ -40,10 +46,13 @@ def __init__(
if endpoint.endswith("/"):
endpoint = endpoint[:-1]

self._api_version = kwargs.pop("api_version", DEFAULT_VERSION)

authentication_policy = HMACCredentialsPolicy(endpoint, credential)

self._generated_client = AzureCommunicationEmailService(
endpoint,
api_version=self._api_version,
authentication_policy=authentication_policy,
sdk_moniker=SDK_MONIKER,
**kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .._generated.aio._azure_communication_email_service import AzureCommunicationEmailService
from .._version import SDK_MONIKER
from .._generated.models import SendEmailResult, SendStatusResult, EmailMessage
from .._api_versions import DEFAULT_VERSION

class EmailClient(object): # pylint: disable=client-accepts-api-version-keyword
"""A client to interact with the AzureCommunicationService Email gateway asynchronously.
Expand All @@ -24,6 +25,10 @@ class EmailClient(object): # pylint: disable=client-accepts-api-version-keyword
The endpoint url for Azure Communication Service resource.
:param Union[AsyncTokenCredential, AzureKeyCredential] credential:
The credential we use to authenticate against the service.
:keyword api_version: Azure Communication Email API version.
Default value is "2021-10-01-preview".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
Expand All @@ -40,10 +45,13 @@ def __init__(
if endpoint.endswith("/"):
endpoint = endpoint[:-1]

self._api_version = kwargs.pop("api_version", DEFAULT_VERSION)

authentication_policy = HMACCredentialsPolicy(endpoint, credential)

self._generated_client = AzureCommunicationEmailService(
endpoint,
api_version=self._api_version,
authentication_policy=authentication_policy,
sdk_moniker=SDK_MONIKER,
**kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Added support to customize the Communication Identity access token's validity period:
- `create_user_and_token` and `get_token` methods in both sync and async clients can now accept keyword argument `token_expires_in: ~datetime.timedelta` that provides the ability to create a Communication Identity access token with custom expiration.
- Added a new API version `ApiVersion.V2022_10_01` that is now the default API version.
- Added the ability specify the API version by an optional `api_version` keyword parameter.

## 1.2.0 (2022-08-24)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from enum import Enum
from azure.core import CaseInsensitiveEnumMeta

# pylint: disable=enum-must-be-uppercase

class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
V2021_03_07 = "2021-03-07"
V2022_06_01 = "2022-06-01"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@
from ._generated.models import CommunicationTokenScope


class CommunicationIdentityClient(object): # pylint: disable=client-accepts-api-version-keyword
class CommunicationIdentityClient(object):
"""Azure Communication Services Identity client.
:param str endpoint:
The endpoint url for Azure Communication Service resource.
:param TokenCredential credential:
The TokenCredential we use to authenticate against the service.
:keyword api_version: Azure Communication Identity API version.
Default value is "2022-06-01". Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
.. admonition:: Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@
from .._generated.models import CommunicationTokenScope


class CommunicationIdentityClient: # pylint: disable=client-accepts-api-version-keyword
class CommunicationIdentityClient:
"""Azure Communication Services Identity client.
:param str endpoint:
The endpoint url for Azure Communication Service resource.
:param AsyncTokenCredential credential:
The AsyncTokenCredential we use to authenticate against the service.
:keyword api_version: Azure Communication Identity API version.
Default value is "2022-06-01". Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
.. admonition:: Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## 1.0.0b1 (Unreleased)

### Features Added
- Added the ability specify the API version by an optional `api_version` keyword parameter.

### Added
- Preview release of the package.
- Add RouterClient
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
from azure.core import CaseInsensitiveEnumMeta


# pylint: disable=enum-must-be-uppercase
class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
V2022_07_18_preview = "2022-07-18-preview"
V2022_07_18_PREVIEW = "2022-07-18-preview"


DEFAULT_VERSION = ApiVersion.V2022_07_18_preview
DEFAULT_VERSION = ApiVersion.V2022_07_18_PREVIEW
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
_SERIALIZER = Serializer()


class RouterAdministrationClient(object): # pylint: disable=client-accepts-api-version-keyword,too-many-public-methods,too-many-lines
class RouterAdministrationClient(object): # pylint:disable=too-many-public-methods,too-many-lines
"""A client to interact with the AzureCommunicationService JobRouter service.
This client provides operations to create, update, list and delete the following entities: classification policy,
Expand All @@ -67,6 +67,10 @@ class RouterAdministrationClient(object): # pylint: disable=client-accepts-api-
The endpoint of the Azure Communication resource.
:param ~azure.core.credentials.AzureKeyCredential credential:
The credentials with which to authenticate
:keyword api_version: Azure Communication Job Router API version. Default value is "2022-07-18-preview".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
Expand Down Expand Up @@ -98,9 +102,9 @@ def __init__(
self._authentication_policy = HMACCredentialsPolicy(endpoint, credential.key)
self._client = AzureCommunicationJobRouterService(
self._endpoint,
api_version = self._api_version,
authentication_policy = self._authentication_policy,
sdk_moniker = SDK_MONIKER,
api_version=self._api_version,
authentication_policy=self._authentication_policy,
sdk_moniker=SDK_MONIKER,
**kwargs)

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
_SERIALIZER = Serializer()


class RouterClient(object): # pylint: disable=client-accepts-api-version-keyword,too-many-public-methods,too-many-lines
class RouterClient(object): # pylint:disable=too-many-public-methods,too-many-lines
"""A client to interact with the AzureCommunicationService JobRouter service.
This client provides operations to create and update jobs, policies and workers.
Expand All @@ -61,6 +61,10 @@ class RouterClient(object): # pylint: disable=client-accepts-api-version-keywor
The endpoint of the Azure Communication resource.
:param ~azure.core.credentials.AzureKeyCredential credential:
The credentials with which to authenticate
:keyword api_version: Azure Communication Job Router API version.
Default value is "2022-07-18-preview".
Note that overriding this default value may result in unsupported behavior.
"""

def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
_SERIALIZER = Serializer()


class RouterAdministrationClient(object): # pylint: disable=client-accepts-api-version-keyword,too-many-public-methods,too-many-lines
class RouterAdministrationClient(object): # pylint:disable=too-many-public-methods,too-many-lines
"""A client to interact with the AzureCommunicationService JobRouter service.

This client provides operations to create, update, list and delete the following entities: classification policy,
Expand All @@ -69,6 +69,10 @@ class RouterAdministrationClient(object): # pylint: disable=client-accepts-api-
The endpoint of the Azure Communication resource.
:param ~azure.core.credentials.AzureKeyCredential credential:
The credentials with which to authenticate

:keyword api_version: Azure Communication Job Router API version.
Default value is "2022-07-18-preview".
Note that overriding this default value may result in unsupported behavior.
"""

def __init__(
Expand Down Expand Up @@ -100,7 +104,7 @@ def __init__(
self._authentication_policy = HMACCredentialsPolicy(endpoint, credential.key, decode_url=True)
self._client = AzureCommunicationJobRouterService(
self._endpoint,
api_version = self._api_version,
api_version=self._api_version,
authentication_policy=self._authentication_policy,
sdk_moniker=SDK_MONIKER,
**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
_SERIALIZER = Serializer()


class RouterClient(object): # pylint: disable=client-accepts-api-version-keyword,too-many-public-methods,too-many-lines
class RouterClient(object): # pylint:disable=too-many-public-methods,too-many-lines
"""A client to interact with the AzureCommunicationService JobRouter service.

This client provides operations to create and update jobs, policies and workers.
Expand All @@ -63,6 +63,10 @@ class RouterClient(object): # pylint: disable=client-accepts-api-version-keywor
The endpoint of the Azure Communication resource.
:param ~azure.core.credentials.AzureKeyCredential credential:
The credentials with which to authenticate

:keyword api_version: Azure Communication Job Router API version.
Default value is "2022-07-18-preview".
Note that overriding this default value may result in unsupported behavior.
"""

def __init__(
Expand Down Expand Up @@ -94,7 +98,7 @@ def __init__(
self._authentication_policy = HMACCredentialsPolicy(endpoint, credential.key, decode_url=True)
self._client = AzureCommunicationJobRouterService(
self._endpoint,
api_version = self._api_version,
api_version=self._api_version,
authentication_policy=self._authentication_policy,
sdk_moniker=SDK_MONIKER,
**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.1.0b2 (Unreleased)

### Features Added
- Added the ability specify the API version by an optional `api_version` keyword parameter.

### Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------

from enum import Enum
from azure.core import CaseInsensitiveEnumMeta


class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
V2022_03_01_PREVIEW = "2022-03-01-preview"


DEFAULT_VERSION = ApiVersion.V2022_03_01_PREVIEW
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@
from ._shared.utils import parse_connection_str, get_authentication_policy
from ._version import SDK_MONIKER
from ._generated.models import CommunicationRelayConfiguration
from ._api_versions import DEFAULT_VERSION

if TYPE_CHECKING:
from azure.core.credentials import TokenCredential
from azure.communication.identity import CommunicationUserIdentifier
from azure.communication.networktraversal import RouteType

class CommunicationRelayClient(object): # pylint: disable=client-accepts-api-version-keyword
class CommunicationRelayClient(object):
"""Azure Communication Services Relay client.

:param str endpoint:
The endpoint url for Azure Communication Service resource.
:param TokenCredential credential:
The TokenCredential we use to authenticate against the service.

:keyword api_version: Azure Communication Network Traversal API version.
Default value is "2022-03-01-preview".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
.. admonition:: Example:

.. literalinclude:: ../samples/network_traversal_samples.py
Expand All @@ -53,8 +57,10 @@ def __init__(
"You need to provide account shared key to authenticate.")

self._endpoint = endpoint
self._api_version = kwargs.pop("api_version", DEFAULT_VERSION)
self._network_traversal_service_client = CommunicationNetworkTraversalClientGen(
self._endpoint,
api_version=self._api_version,
authentication_policy=get_authentication_policy(endpoint, credential),
sdk_moniker=SDK_MONIKER,
**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import CommunicationNetworkTraversalClient as CommunicationNetworkTraversalClientGen
from .._shared.utils import parse_connection_str, get_authentication_policy
from .._version import SDK_MONIKER
from .._api_versions import DEFAULT_VERSION

if TYPE_CHECKING:
from azure.core.credentials_async import AsyncTokenCredential
Expand All @@ -19,13 +20,17 @@
from azure.communication.networktraversal import RouteType


class CommunicationRelayClient: # pylint: disable=client-accepts-api-version-keyword
class CommunicationRelayClient:
"""Azure Communication Services Network Traversal client.

:param str endpoint:
The endpoint url for Azure Communication Service resource.
:param AsyncTokenCredential credential:
The AsyncTokenCredential we use to authenticate against the service.
:keyword api_version: Azure Communication Network Traversal API version.
Default value is "2022-03-01-preview".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str

.. admonition:: Example:

Expand All @@ -51,8 +56,10 @@ def __init__(
"You need to provide account shared key to authenticate.")

self._endpoint = endpoint
self._api_version = kwargs.pop("api_version", DEFAULT_VERSION)
self._network_traversal_service_client = CommunicationNetworkTraversalClientGen(
self._endpoint,
api_version=self._api_version,
authentication_policy=get_authentication_policy(endpoint, credential, decode_url=True, is_async=True),
sdk_moniker=SDK_MONIKER,
**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Features Added
- Added new SIP routing client for handling Direct routing numbers.
- Added the ability specify the API version by an optional `api_version` keyword parameter.

### Other Changes
Python 3.6 is no longer supported. Please use Python version 3.7 or later. For more details, please read our page on [Azure SDK for Python version support policy](https://github.com/Azure/azure-sdk-for-python/wiki/Azure-SDKs-Python-version-support-policy).
Expand Down
Loading