Skip to content

Commit

Permalink
CodeGen from PR 31719 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge b5bdeeea76f826a1bd921819aaaecb181d0e3d3e into 93a8154cfee7eb198397e256357fa60dce671763
  • Loading branch information
SDKAuto committed Dec 3, 2024
1 parent 82e5682 commit 8040f78
Show file tree
Hide file tree
Showing 60 changed files with 935 additions and 6,950 deletions.
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": "a9551d26660e8879c4dc5ced88a95e3a74ea1b82",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/eventgrid/Azure.Messaging.EventGrid",
"@azure-tools/typespec-python": "0.36.5"
}
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

0 comments on commit 8040f78

Please sign in to comment.