Skip to content

Commit da4f140

Browse files
authored
regen (Azure#38923)
1 parent 8f4fff6 commit da4f140

26 files changed

+816
-969
lines changed

sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@
55
# Code generated by Microsoft (R) Python 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 ._patch import EventGridPublisherClient
10-
from ._patch import EventGridConsumerClient
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 EventGridPublisherClient # type: ignore
16+
from ._client import EventGridConsumerClient # type: ignore
1117
from ._version import VERSION
1218

1319
__version__ = VERSION
1420

1521
try:
1622
from ._patch import __all__ as _patch_all
17-
from ._patch import * # pylint: disable=unused-wildcard-import
23+
from ._patch import *
1824
except ImportError:
1925
_patch_all = []
2026
from ._patch import patch_sdk as _patch_sdk
@@ -23,6 +29,6 @@
2329
"EventGridPublisherClient",
2430
"EventGridConsumerClient",
2531
]
26-
__all__.extend([p for p in _patch_all if p not in __all__])
32+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2733

2834
_patch_sdk()

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_client.py

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

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

1213
from azure.core import PipelineClient
1314
from azure.core.credentials import AzureKeyCredential
@@ -19,13 +20,10 @@
1920
from ._serialization import Deserializer, Serializer
2021

2122
if TYPE_CHECKING:
22-
# pylint: disable=unused-import,ungrouped-imports
2323
from azure.core.credentials import TokenCredential
2424

2525

26-
class EventGridPublisherClient(
27-
EventGridPublisherClientOperationsMixin
28-
): # pylint: disable=client-accepts-api-version-keyword
26+
class EventGridPublisherClient(EventGridPublisherClientOperationsMixin):
2927
"""EventGridPublisherClient.
3028
3129
:param endpoint: The host name of the namespace, e.g.
@@ -95,17 +93,15 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
9593
def close(self) -> None:
9694
self._client.close()
9795

98-
def __enter__(self) -> "EventGridPublisherClient":
96+
def __enter__(self) -> Self:
9997
self._client.__enter__()
10098
return self
10199

102100
def __exit__(self, *exc_details: Any) -> None:
103101
self._client.__exit__(*exc_details)
104102

105103

106-
class EventGridConsumerClient(
107-
EventGridConsumerClientOperationsMixin
108-
): # pylint: disable=client-accepts-api-version-keyword
104+
class EventGridConsumerClient(EventGridConsumerClientOperationsMixin):
109105
"""EventGridConsumerClient.
110106
111107
:param endpoint: The host name of the namespace, e.g.
@@ -175,7 +171,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
175171
def close(self) -> None:
176172
self._client.close()
177173

178-
def __enter__(self) -> "EventGridConsumerClient":
174+
def __enter__(self) -> Self:
179175
self._client.__enter__()
180176
return self
181177

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_configuration.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

21-
class EventGridPublisherClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
class EventGridPublisherClientConfiguration: # pylint: disable=too-many-instance-attributes
2221
"""Configuration for EventGridPublisherClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
@@ -75,7 +74,7 @@ def _configure(self, **kwargs: Any) -> None:
7574
self.authentication_policy = self._infer_policy(**kwargs)
7675

7776

78-
class EventGridConsumerClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
77+
class EventGridConsumerClientConfiguration: # pylint: disable=too-many-instance-attributes
7978
"""Configuration for EventGridConsumerClient.
8079
8180
Note that all parameters used to create this instance are saved as instance

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_event_mappings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from azure.core import CaseInsensitiveEnumMeta
99

1010

11-
# pylint: disable=line-too-long
1211
# pylint: disable=enum-must-be-uppercase
1312
class SystemEventNames(str, Enum, metaclass=CaseInsensitiveEnumMeta):
1413
"""

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_generated/_serialization.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# pylint: disable=too-many-lines
12
# --------------------------------------------------------------------------
23
#
34
# Copyright (c) Microsoft Corporation. All rights reserved.

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def _cloud_event_to_generated(cloud_event, **kwargs):
142142
)
143143

144144

145-
def _from_cncf_events(event): # pylint: disable=inconsistent-return-statements
145+
def _from_cncf_events(event):
146146
"""This takes in a CNCF cloudevent and returns a dictionary.
147147
If cloud events library is not installed, the event is returned back.
148148
@@ -158,7 +158,7 @@ def _from_cncf_events(event): # pylint: disable=inconsistent-return-statements
158158
except (AttributeError, ImportError):
159159
# means this is not a CNCF event
160160
return event
161-
except Exception as err: # pylint: disable=broad-except
161+
except Exception as err:
162162
msg = """Failed to serialize the event. Please ensure your
163163
CloudEvents is correctly formatted (https://pypi.org/project/cloudevents/)"""
164164
raise ValueError(msg) from err

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_messaging_shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import json
1515

1616

17-
def _get_json_content(obj: Any) -> Any: # pylint: disable=inconsistent-return-statements
17+
def _get_json_content(obj: Any) -> Any:
1818
"""Event mixin to have methods that are common to different Event types
1919
like CloudEvent, EventGridEvent etc.
2020

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
5-
# pylint:disable=protected-access
65
from typing import Any, cast
76
import datetime as dt
87
import uuid

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
from ._version import VERSION
4949

5050
if TYPE_CHECKING:
51-
# pylint: disable=unused-import,ungrouped-imports
5251
from azure.core.credentials import (
5352
AzureKeyCredential,
5453
AzureSasCredential,
@@ -71,7 +70,7 @@
7170
ListEventType = Union[List[CloudEvent], List[EventGridEvent], List[Dict]]
7271

7372

74-
class EventGridPublisherClient(object): # pylint: disable=client-accepts-api-version-keyword
73+
class EventGridPublisherClient(object):
7574
"""EventGridPublisherClient publishes events to an EventGrid topic or domain.
7675
It can be used to publish either an EventGridEvent, a CloudEvent or a Custom Schema.
7776
@@ -139,7 +138,7 @@ def _policies(credential, **kwargs):
139138
return policies
140139

141140
@distributed_trace
142-
def send(self, events: SendType, *, channel_name: Optional[str] = None, **kwargs: Any) -> None:
141+
def send(self, events: SendType, *, channel_name: Optional[str] = None, **kwargs: Any) -> None: # pylint:disable=docstring-keyword-should-match-keyword-only
143142
"""Sends events to a topic or a domain specified during the client initialization.
144143
145144
A single instance or a list of dictionaries, CloudEvents or EventGridEvents are accepted.
@@ -212,15 +211,15 @@ def send(self, events: SendType, *, channel_name: Optional[str] = None, **kwargs
212211
content_type = kwargs.pop("content_type", "application/json; charset=utf-8")
213212
if isinstance(events[0], CloudEvent) or _is_cloud_event(events[0]):
214213
try:
215-
events = [_cloud_event_to_generated(e, **kwargs) for e in events] # pylint: disable=protected-access
214+
events = [_cloud_event_to_generated(e, **kwargs) for e in events]
216215
except AttributeError:
217216
## this is either a dictionary or a CNCF cloud event
218217
events = [_from_cncf_events(e) for e in events]
219218
content_type = "application/cloudevents-batch+json; charset=utf-8"
220219
elif isinstance(events[0], EventGridEvent) or _is_eventgrid_event_format(events[0]):
221220
for event in events:
222221
_eventgrid_data_typecheck(event)
223-
response = self._client.send_request( # pylint: disable=protected-access
222+
response = self._client.send_request(
224223
_build_request(
225224
self._endpoint, content_type, events, channel_name=channel_name, api_version=self._api_version
226225
),
@@ -242,9 +241,9 @@ def close(self):
242241

243242
def __enter__(self):
244243
# type: () -> EventGridPublisherClient
245-
self._client.__enter__() # pylint:disable=no-member
244+
self._client.__enter__()
246245
return self
247246

248247
def __exit__(self, *args):
249248
# type: (*Any) -> None
250-
self._client.__exit__(*args) # pylint:disable=no-member
249+
self._client.__exit__(*args)

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/aio/_publisher_client_async.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
ListEventType = Union[List[CloudEvent], List[EventGridEvent], List[Dict]]
6666

6767

68-
class EventGridPublisherClient: # pylint: disable=client-accepts-api-version-keyword
68+
class EventGridPublisherClient:
6969
"""Asynchronous EventGridPublisherClient publishes events to an EventGrid topic or domain.
7070
It can be used to publish either an EventGridEvent, a CloudEvent or a Custom Schema.
7171
@@ -134,7 +134,7 @@ def _policies(
134134
return policies
135135

136136
@distributed_trace_async
137-
async def send(self, events: SendType, *, channel_name: Optional[str] = None, **kwargs: Any) -> None:
137+
async def send(self, events: SendType, *, channel_name: Optional[str] = None, **kwargs: Any) -> None: # pylint:disable=docstring-keyword-should-match-keyword-only
138138
"""Sends events to a topic or a domain specified during the client initialization.
139139
140140
A single instance or a list of dictionaries, CloudEvents or EventGridEvents are accepted.
@@ -207,15 +207,15 @@ async def send(self, events: SendType, *, channel_name: Optional[str] = None, **
207207
content_type = kwargs.pop("content_type", "application/json; charset=utf-8")
208208
if isinstance(events[0], CloudEvent) or _is_cloud_event(events[0]):
209209
try:
210-
events = [_cloud_event_to_generated(e, **kwargs) for e in events] # pylint: disable=protected-access
210+
events = [_cloud_event_to_generated(e, **kwargs) for e in events]
211211
except AttributeError:
212212
## this is either a dictionary or a CNCF cloud event
213213
events = [_from_cncf_events(e) for e in events]
214214
content_type = "application/cloudevents-batch+json; charset=utf-8"
215215
elif isinstance(events[0], EventGridEvent) or _is_eventgrid_event_format(events[0]):
216216
for event in events:
217217
_eventgrid_data_typecheck(event)
218-
response = await self._client.send_request( # pylint: disable=protected-access
218+
response = await self._client.send_request(
219219
_build_request(
220220
self._endpoint, content_type, events, channel_name=channel_name, api_version=self._api_version
221221
),

0 commit comments

Comments
 (0)