Skip to content
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
6 changes: 6 additions & 0 deletions sdk/eventgrid/azure-eventgrid/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"commit": "9fa70321731aae40cf6e49c248dc7bb426ea8668",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/eventgrid/Azure.Messaging.EventGrid",
"@azure-tools/typespec-python": "0.37.0"
}
14 changes: 10 additions & 4 deletions sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._patch import EventGridPublisherClient
from ._patch import EventGridConsumerClient
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._client import EventGridPublisherClient # type: ignore
from ._client import EventGridConsumerClient # type: ignore
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
Expand All @@ -23,6 +29,6 @@
"EventGridPublisherClient",
"EventGridConsumerClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

_patch_sdk()
14 changes: 5 additions & 9 deletions sdk/eventgrid/azure-eventgrid/azure/eventgrid/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING, Union
from typing_extensions import Self

from azure.core import PipelineClient
from azure.core.credentials import AzureKeyCredential
Expand All @@ -19,13 +20,10 @@
from ._serialization import Deserializer, Serializer

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


class EventGridPublisherClient(
EventGridPublisherClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword
class EventGridPublisherClient(EventGridPublisherClientOperationsMixin):
"""EventGridPublisherClient.

:param endpoint: The host name of the namespace, e.g.
Expand Down Expand Up @@ -95,17 +93,15 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

def __enter__(self) -> "EventGridPublisherClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

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


class EventGridConsumerClient(
EventGridConsumerClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword
class EventGridConsumerClient(EventGridConsumerClientOperationsMixin):
"""EventGridConsumerClient.

:param endpoint: The host name of the namespace, e.g.
Expand Down Expand Up @@ -175,7 +171,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

def __enter__(self) -> "EventGridConsumerClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
from ._version import VERSION

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


class EventGridPublisherClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
class EventGridPublisherClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for EventGridPublisherClient.

Note that all parameters used to create this instance are saved as instance
Expand Down Expand Up @@ -75,7 +74,7 @@ def _configure(self, **kwargs: Any) -> None:
self.authentication_policy = self._infer_policy(**kwargs)


class EventGridConsumerClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
class EventGridConsumerClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for EventGridConsumerClient.

Note that all parameters used to create this instance are saved as instance
Expand Down
19 changes: 0 additions & 19 deletions sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/__init__.py

This file was deleted.

This file was deleted.

Loading
Loading