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

[EG] Regenerate Code #17053

Merged
merged 3 commits into from
Mar 3, 2021
Merged
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
5 changes: 5 additions & 0 deletions sdk/eventgrid/azure-eventgrid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,11 @@

## 2.0.0b6 (Unreleased)

**Breaking Changes**
- All the `SystemEventNames` related to Azure Communication Service starting with `ACS****` are renamed to `Acs***` to honor pascal case.

**Features**
- Added support for two new `SystemEvents` - `ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData` and `ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData`

## 2.0.0b5 (2021-02-10)

26 changes: 16 additions & 10 deletions sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py
Original file line number Diff line number Diff line change
@@ -12,28 +12,28 @@ class SystemEventNames(str, Enum):
visit https://docs.microsoft.com/azure/event-grid/system-topics.
"""

ACSChatMemberAddedToThreadWithUserEventName = (
AcsChatMemberAddedToThreadWithUserEventName = (
Copy link
Contributor

@yunhaoling yunhaoling Mar 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something public in the previous release?
naming change seems to be a breaking change to me (although it's just ACS* to Acs*, probably something worth to mention in the changelog.

If those are just added in this release, then I have no concern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was on fence to add this in the changelog, but i agree -updated

"Microsoft.Communication.ChatMemberAddedToThreadWithUser"
)
ACSChatMemberRemovedFromThreadWithUserEventName = (
AcsChatMemberRemovedFromThreadWithUserEventName = (
"Microsoft.Communication.ChatMemberRemovedFromThreadWithUser"
)
ACSChatMessageDeletedEventName = "Microsoft.Communication.ChatMessageDeleted"
ACSChatMessageEditedEventName = "Microsoft.Communication.ChatMessageEdited"
ACSChatMessageReceivedEventName = "Microsoft.Communication.ChatMessageReceived"
ACSChatThreadCreatedWithUserEventName = (
AcsChatMessageDeletedEventName = "Microsoft.Communication.ChatMessageDeleted"
AcsChatMessageEditedEventName = "Microsoft.Communication.ChatMessageEdited"
AcsChatMessageReceivedEventName = "Microsoft.Communication.ChatMessageReceived"
AcsChatThreadCreatedWithUserEventName = (
"Microsoft.Communication.ChatThreadCreatedWithUser"
)
ACSChatThreadPropertiesUpdatedPerUserEventName = (
AcsChatThreadPropertiesUpdatedPerUserEventName = (
"Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser"
)
ACSChatThreadWithUserDeletedEventName = (
AcsChatThreadWithUserDeletedEventName = (
"Microsoft.Communication.ChatThreadWithUserDeleted"
)
ACSSMSDeliveryReportReceivedEventName = (
AcsSmsDeliveryReportReceivedEventName = (
"Microsoft.Communication.SMSDeliveryReportReceived"
)
ACSSMSReceivedEventName = "Microsoft.Communication.SMSReceived"
AcsSmsReceivedEventName = "Microsoft.Communication.SMSReceived"
AppConfigurationKeyValueDeletedEventName = (
"Microsoft.AppConfiguration.KeyValueDeleted"
)
@@ -143,6 +143,12 @@ class SystemEventNames(str, Enum):
ServiceBusDeadletterMessagesAvailableWithNoListenerEventName = (
"Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener"
)
ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventName = (
"Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications"
)
ServiceBusActiveMessagesAvailablePeriodicNotificationsEventName = (
"Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications"
)
StorageBlobCreatedEventName = "Microsoft.Storage.BlobCreated"
StorageBlobDeletedEventName = "Microsoft.Storage.BlobDeleted"
StorageBlobRenamedEventName = "Microsoft.Storage.BlobRenamed"
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import EventGridPublisherClientConfiguration
from .operations import EventGridPublisherClientOperationsMixin
from . import models
@@ -36,9 +38,25 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)


def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
http_request.url = self._client.format_url(http_request.url)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
Original file line number Diff line number Diff line change
@@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._event_grid_publisher_client_async import EventGridPublisherClient
from ._event_grid_publisher_client import EventGridPublisherClient
__all__ = ['EventGridPublisherClient']
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
from typing import Any

from azure.core import AsyncPipelineClient
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from msrest import Deserializer, Serializer

from ._configuration import EventGridPublisherClientConfiguration
@@ -31,9 +32,24 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)


async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
http_request.url = self._client.format_url(http_request.url)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar
import warnings

from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -22,7 +22,7 @@ class EventGridPublisherClientOperationsMixin:
async def publish_events(
self,
topic_hostname: str,
events: List["models.EventGridEvent"],
events: List["_models.EventGridEvent"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

random question: how would this be rendered on doc/type hint?

wondering if users would get confused that how they create EventGridEvent from _models module.
(ignore me if this could be rendered corrected by python/sphinx)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not much concerned about this - this is an autogenerated method from swagger which is not used anywhere in our code. (we just need this in the swagger for the sake of other languages)

**kwargs
) -> None:
"""Publishes a batch of events to an Azure Event Grid topic.
@@ -37,7 +37,9 @@ async def publish_events(
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-01-01"
content_type = kwargs.pop("content_type", "application/json")
@@ -76,7 +78,7 @@ async def publish_events(
async def publish_cloud_event_events(
self,
topic_hostname: str,
events: List["models.CloudEvent"],
events: List["_models.CloudEvent"],
**kwargs
) -> None:
"""Publishes a batch of events to an Azure Event Grid topic.
@@ -91,7 +93,9 @@ async def publish_cloud_event_events(
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-01-01"
content_type = kwargs.pop("content_type", "application/cloudevents-batch+json; charset=utf-8")
@@ -145,7 +149,9 @@ async def publish_custom_event_events(
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-01-01"
content_type = kwargs.pop("content_type", "application/json")
Original file line number Diff line number Diff line change
@@ -7,27 +7,40 @@
# --------------------------------------------------------------------------

try:
from ._models_py3 import ACSChatEventBaseProperties
from ._models_py3 import ACSChatMemberAddedToThreadWithUserEventData
from ._models_py3 import ACSChatMemberRemovedFromThreadWithUserEventData
from ._models_py3 import ACSChatMessageDeletedEventData
from ._models_py3 import ACSChatMessageEditedEventData
from ._models_py3 import ACSChatMessageEventBaseProperties
from ._models_py3 import ACSChatMessageReceivedEventData
from ._models_py3 import ACSChatThreadCreatedWithUserEventData
from ._models_py3 import ACSChatThreadEventBaseProperties
from ._models_py3 import ACSChatThreadMemberProperties
from ._models_py3 import ACSChatThreadPropertiesUpdatedPerUserEventData
from ._models_py3 import ACSChatThreadWithUserDeletedEventData
from ._models_py3 import ACSSMSDeliveryAttemptProperties
from ._models_py3 import ACSSMSDeliveryReportReceivedEventData
from ._models_py3 import ACSSMSEventBaseProperties
from ._models_py3 import ACSSMSReceivedEventData
from ._models_py3 import AcsChatEventBaseProperties
from ._models_py3 import AcsChatEventInThreadBaseProperties
from ._models_py3 import AcsChatMessageDeletedEventData
from ._models_py3 import AcsChatMessageDeletedInThreadEventData
from ._models_py3 import AcsChatMessageEditedEventData
from ._models_py3 import AcsChatMessageEditedInThreadEventData
from ._models_py3 import AcsChatMessageEventBaseProperties
from ._models_py3 import AcsChatMessageEventInThreadBaseProperties
from ._models_py3 import AcsChatMessageReceivedEventData
from ._models_py3 import AcsChatMessageReceivedInThreadEventData
from ._models_py3 import AcsChatParticipantAddedToThreadEventData
from ._models_py3 import AcsChatParticipantAddedToThreadWithUserEventData
from ._models_py3 import AcsChatParticipantRemovedFromThreadEventData
from ._models_py3 import AcsChatParticipantRemovedFromThreadWithUserEventData
from ._models_py3 import AcsChatThreadCreatedEventData
from ._models_py3 import AcsChatThreadCreatedWithUserEventData
from ._models_py3 import AcsChatThreadDeletedEventData
from ._models_py3 import AcsChatThreadEventBaseProperties
from ._models_py3 import AcsChatThreadEventInThreadBaseProperties
from ._models_py3 import AcsChatThreadParticipantProperties
from ._models_py3 import AcsChatThreadPropertiesUpdatedEventData
from ._models_py3 import AcsChatThreadPropertiesUpdatedPerUserEventData
from ._models_py3 import AcsChatThreadWithUserDeletedEventData
from ._models_py3 import AcsSmsDeliveryAttemptProperties
from ._models_py3 import AcsSmsDeliveryReportReceivedEventData
from ._models_py3 import AcsSmsEventBaseProperties
from ._models_py3 import AcsSmsReceivedEventData
from ._models_py3 import AppConfigurationKeyValueDeletedEventData
from ._models_py3 import AppConfigurationKeyValueModifiedEventData
from ._models_py3 import AppEventTypeDetail
from ._models_py3 import AppServicePlanEventTypeDetail
from ._models_py3 import CloudEvent
from ._models_py3 import CommunicationIdentifierModel
from ._models_py3 import CommunicationUserIdentifierModel
from ._models_py3 import ContainerRegistryArtifactEventData
from ._models_py3 import ContainerRegistryArtifactEventTarget
from ._models_py3 import ContainerRegistryChartDeletedEventData
@@ -103,6 +116,8 @@
from ._models_py3 import MediaLiveEventIncomingVideoStreamsOutOfSyncEventData
from ._models_py3 import MediaLiveEventIngestHeartbeatEventData
from ._models_py3 import MediaLiveEventTrackDiscontinuityDetectedEventData
from ._models_py3 import MicrosoftTeamsUserIdentifierModel
from ._models_py3 import PhoneNumberIdentifierModel
from ._models_py3 import RedisExportRDBCompletedEventData
from ._models_py3 import RedisImportRDBCompletedEventData
from ._models_py3 import RedisPatchingCompletedEventData
@@ -116,7 +131,9 @@
from ._models_py3 import ResourceWriteCancelData
from ._models_py3 import ResourceWriteFailureData
from ._models_py3 import ResourceWriteSuccessData
from ._models_py3 import ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData
from ._models_py3 import ServiceBusActiveMessagesAvailableWithNoListenersEventData
from ._models_py3 import ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData
from ._models_py3 import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData
from ._models_py3 import SignalRServiceClientConnectionConnectedEventData
from ._models_py3 import SignalRServiceClientConnectionDisconnectedEventData
@@ -146,27 +163,40 @@
from ._models_py3 import WebSlotSwapWithPreviewCancelledEventData
from ._models_py3 import WebSlotSwapWithPreviewStartedEventData
except (SyntaxError, ImportError):
from ._models import ACSChatEventBaseProperties # type: ignore
from ._models import ACSChatMemberAddedToThreadWithUserEventData # type: ignore
from ._models import ACSChatMemberRemovedFromThreadWithUserEventData # type: ignore
from ._models import ACSChatMessageDeletedEventData # type: ignore
from ._models import ACSChatMessageEditedEventData # type: ignore
from ._models import ACSChatMessageEventBaseProperties # type: ignore
from ._models import ACSChatMessageReceivedEventData # type: ignore
from ._models import ACSChatThreadCreatedWithUserEventData # type: ignore
from ._models import ACSChatThreadEventBaseProperties # type: ignore
from ._models import ACSChatThreadMemberProperties # type: ignore
from ._models import ACSChatThreadPropertiesUpdatedPerUserEventData # type: ignore
from ._models import ACSChatThreadWithUserDeletedEventData # type: ignore
from ._models import ACSSMSDeliveryAttemptProperties # type: ignore
from ._models import ACSSMSDeliveryReportReceivedEventData # type: ignore
from ._models import ACSSMSEventBaseProperties # type: ignore
from ._models import ACSSMSReceivedEventData # type: ignore
from ._models import AcsChatEventBaseProperties # type: ignore
from ._models import AcsChatEventInThreadBaseProperties # type: ignore
from ._models import AcsChatMessageDeletedEventData # type: ignore
from ._models import AcsChatMessageDeletedInThreadEventData # type: ignore
from ._models import AcsChatMessageEditedEventData # type: ignore
from ._models import AcsChatMessageEditedInThreadEventData # type: ignore
from ._models import AcsChatMessageEventBaseProperties # type: ignore
from ._models import AcsChatMessageEventInThreadBaseProperties # type: ignore
from ._models import AcsChatMessageReceivedEventData # type: ignore
from ._models import AcsChatMessageReceivedInThreadEventData # type: ignore
from ._models import AcsChatParticipantAddedToThreadEventData # type: ignore
from ._models import AcsChatParticipantAddedToThreadWithUserEventData # type: ignore
from ._models import AcsChatParticipantRemovedFromThreadEventData # type: ignore
from ._models import AcsChatParticipantRemovedFromThreadWithUserEventData # type: ignore
from ._models import AcsChatThreadCreatedEventData # type: ignore
from ._models import AcsChatThreadCreatedWithUserEventData # type: ignore
from ._models import AcsChatThreadDeletedEventData # type: ignore
from ._models import AcsChatThreadEventBaseProperties # type: ignore
from ._models import AcsChatThreadEventInThreadBaseProperties # type: ignore
from ._models import AcsChatThreadParticipantProperties # type: ignore
from ._models import AcsChatThreadPropertiesUpdatedEventData # type: ignore
from ._models import AcsChatThreadPropertiesUpdatedPerUserEventData # type: ignore
from ._models import AcsChatThreadWithUserDeletedEventData # type: ignore
from ._models import AcsSmsDeliveryAttemptProperties # type: ignore
from ._models import AcsSmsDeliveryReportReceivedEventData # type: ignore
from ._models import AcsSmsEventBaseProperties # type: ignore
from ._models import AcsSmsReceivedEventData # type: ignore
from ._models import AppConfigurationKeyValueDeletedEventData # type: ignore
from ._models import AppConfigurationKeyValueModifiedEventData # type: ignore
from ._models import AppEventTypeDetail # type: ignore
from ._models import AppServicePlanEventTypeDetail # type: ignore
from ._models import CloudEvent # type: ignore
from ._models import CommunicationIdentifierModel # type: ignore
from ._models import CommunicationUserIdentifierModel # type: ignore
from ._models import ContainerRegistryArtifactEventData # type: ignore
from ._models import ContainerRegistryArtifactEventTarget # type: ignore
from ._models import ContainerRegistryChartDeletedEventData # type: ignore
@@ -242,6 +272,8 @@
from ._models import MediaLiveEventIncomingVideoStreamsOutOfSyncEventData # type: ignore
from ._models import MediaLiveEventIngestHeartbeatEventData # type: ignore
from ._models import MediaLiveEventTrackDiscontinuityDetectedEventData # type: ignore
from ._models import MicrosoftTeamsUserIdentifierModel # type: ignore
from ._models import PhoneNumberIdentifierModel # type: ignore
from ._models import RedisExportRDBCompletedEventData # type: ignore
from ._models import RedisImportRDBCompletedEventData # type: ignore
from ._models import RedisPatchingCompletedEventData # type: ignore
@@ -255,7 +287,9 @@
from ._models import ResourceWriteCancelData # type: ignore
from ._models import ResourceWriteFailureData # type: ignore
from ._models import ResourceWriteSuccessData # type: ignore
from ._models import ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData # type: ignore
from ._models import ServiceBusActiveMessagesAvailableWithNoListenersEventData # type: ignore
from ._models import ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData # type: ignore
from ._models import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData # type: ignore
from ._models import SignalRServiceClientConnectionConnectedEventData # type: ignore
from ._models import SignalRServiceClientConnectionDisconnectedEventData # type: ignore
@@ -289,6 +323,7 @@
AppAction,
AppServicePlanAction,
AsyncStatus,
CommunicationCloudEnvironmentModel,
MediaJobErrorCategory,
MediaJobErrorCode,
MediaJobRetry,
@@ -297,27 +332,40 @@
)

__all__ = [
'ACSChatEventBaseProperties',
'ACSChatMemberAddedToThreadWithUserEventData',
'ACSChatMemberRemovedFromThreadWithUserEventData',
'ACSChatMessageDeletedEventData',
'ACSChatMessageEditedEventData',
'ACSChatMessageEventBaseProperties',
'ACSChatMessageReceivedEventData',
'ACSChatThreadCreatedWithUserEventData',
'ACSChatThreadEventBaseProperties',
'ACSChatThreadMemberProperties',
'ACSChatThreadPropertiesUpdatedPerUserEventData',
'ACSChatThreadWithUserDeletedEventData',
'ACSSMSDeliveryAttemptProperties',
'ACSSMSDeliveryReportReceivedEventData',
'ACSSMSEventBaseProperties',
'ACSSMSReceivedEventData',
'AcsChatEventBaseProperties',
'AcsChatEventInThreadBaseProperties',
'AcsChatMessageDeletedEventData',
'AcsChatMessageDeletedInThreadEventData',
'AcsChatMessageEditedEventData',
'AcsChatMessageEditedInThreadEventData',
'AcsChatMessageEventBaseProperties',
'AcsChatMessageEventInThreadBaseProperties',
'AcsChatMessageReceivedEventData',
'AcsChatMessageReceivedInThreadEventData',
'AcsChatParticipantAddedToThreadEventData',
'AcsChatParticipantAddedToThreadWithUserEventData',
'AcsChatParticipantRemovedFromThreadEventData',
'AcsChatParticipantRemovedFromThreadWithUserEventData',
'AcsChatThreadCreatedEventData',
'AcsChatThreadCreatedWithUserEventData',
'AcsChatThreadDeletedEventData',
'AcsChatThreadEventBaseProperties',
'AcsChatThreadEventInThreadBaseProperties',
'AcsChatThreadParticipantProperties',
'AcsChatThreadPropertiesUpdatedEventData',
'AcsChatThreadPropertiesUpdatedPerUserEventData',
'AcsChatThreadWithUserDeletedEventData',
'AcsSmsDeliveryAttemptProperties',
'AcsSmsDeliveryReportReceivedEventData',
'AcsSmsEventBaseProperties',
'AcsSmsReceivedEventData',
'AppConfigurationKeyValueDeletedEventData',
'AppConfigurationKeyValueModifiedEventData',
'AppEventTypeDetail',
'AppServicePlanEventTypeDetail',
'CloudEvent',
'CommunicationIdentifierModel',
'CommunicationUserIdentifierModel',
'ContainerRegistryArtifactEventData',
'ContainerRegistryArtifactEventTarget',
'ContainerRegistryChartDeletedEventData',
@@ -393,6 +441,8 @@
'MediaLiveEventIncomingVideoStreamsOutOfSyncEventData',
'MediaLiveEventIngestHeartbeatEventData',
'MediaLiveEventTrackDiscontinuityDetectedEventData',
'MicrosoftTeamsUserIdentifierModel',
'PhoneNumberIdentifierModel',
'RedisExportRDBCompletedEventData',
'RedisImportRDBCompletedEventData',
'RedisPatchingCompletedEventData',
@@ -406,7 +456,9 @@
'ResourceWriteCancelData',
'ResourceWriteFailureData',
'ResourceWriteSuccessData',
'ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData',
'ServiceBusActiveMessagesAvailableWithNoListenersEventData',
'ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData',
'ServiceBusDeadletterMessagesAvailableWithNoListenersEventData',
'SignalRServiceClientConnectionConnectedEventData',
'SignalRServiceClientConnectionDisconnectedEventData',
@@ -438,6 +490,7 @@
'AppAction',
'AppServicePlanAction',
'AsyncStatus',
'CommunicationCloudEnvironmentModel',
'MediaJobErrorCategory',
'MediaJobErrorCode',
'MediaJobRetry',
Original file line number Diff line number Diff line change
@@ -30,75 +30,130 @@ class AppAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Type of action of the operation.
"""

RESTARTED = "Restarted" #: Web app was restarted.
STOPPED = "Stopped" #: Web app was stopped.
CHANGED_APP_SETTINGS = "ChangedAppSettings" #: There was an operation to change app setting on the web app.
STARTED = "Started" #: The job has started.
COMPLETED = "Completed" #: The job has completed.
FAILED = "Failed" #: The job has failed to complete.
#: Web app was restarted.
RESTARTED = "Restarted"
#: Web app was stopped.
STOPPED = "Stopped"
#: There was an operation to change app setting on the web app.
CHANGED_APP_SETTINGS = "ChangedAppSettings"
#: The job has started.
STARTED = "Started"
#: The job has completed.
COMPLETED = "Completed"
#: The job has failed to complete.
FAILED = "Failed"

class AppServicePlanAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Type of action on the app service plan.
"""

UPDATED = "Updated" #: App Service plan is being updated.
#: App Service plan is being updated.
UPDATED = "Updated"

class AsyncStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Asynchronous operation status of the operation on the app service plan.
"""

STARTED = "Started" #: Async operation has started.
COMPLETED = "Completed" #: Async operation has completed.
FAILED = "Failed" #: Async operation failed to complete.
#: Async operation has started.
STARTED = "Started"
#: Async operation has completed.
COMPLETED = "Completed"
#: Async operation failed to complete.
FAILED = "Failed"

class CommunicationCloudEnvironmentModel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The cloud that the identifier belongs to.
"""

PUBLIC = "public"
DOD = "dod"
GCCH = "gcch"

class MediaJobErrorCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Helps with categorization of errors.
"""

SERVICE = "Service" #: The error is service related.
DOWNLOAD = "Download" #: The error is download related.
UPLOAD = "Upload" #: The error is upload related.
CONFIGURATION = "Configuration" #: The error is configuration related.
CONTENT = "Content" #: The error is related to data in the input files.
#: The error is service related.
SERVICE = "Service"
#: The error is download related.
DOWNLOAD = "Download"
#: The error is upload related.
UPLOAD = "Upload"
#: The error is configuration related.
CONFIGURATION = "Configuration"
#: The error is related to data in the input files.
CONTENT = "Content"

class MediaJobErrorCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Error code describing the error.
"""

SERVICE_ERROR = "ServiceError" #: Fatal service error, please contact support.
SERVICE_TRANSIENT_ERROR = "ServiceTransientError" #: Transient error, please retry, if retry is unsuccessful, please contact support.
DOWNLOAD_NOT_ACCESSIBLE = "DownloadNotAccessible" #: While trying to download the input files, the files were not accessible, please check the availability of the source.
DOWNLOAD_TRANSIENT_ERROR = "DownloadTransientError" #: While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source.
UPLOAD_NOT_ACCESSIBLE = "UploadNotAccessible" #: While trying to upload the output files, the destination was not reachable, please check the availability of the destination.
UPLOAD_TRANSIENT_ERROR = "UploadTransientError" #: While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination.
CONFIGURATION_UNSUPPORTED = "ConfigurationUnsupported" #: There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration.
CONTENT_MALFORMED = "ContentMalformed" #: There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files.
CONTENT_UNSUPPORTED = "ContentUnsupported" #: There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files.
#: Fatal service error, please contact support.
SERVICE_ERROR = "ServiceError"
#: Transient error, please retry, if retry is unsuccessful, please contact support.
SERVICE_TRANSIENT_ERROR = "ServiceTransientError"
#: While trying to download the input files, the files were not accessible, please check the
#: availability of the source.
DOWNLOAD_NOT_ACCESSIBLE = "DownloadNotAccessible"
#: While trying to download the input files, there was an issue during transfer (storage service,
#: network errors), see details and check your source.
DOWNLOAD_TRANSIENT_ERROR = "DownloadTransientError"
#: While trying to upload the output files, the destination was not reachable, please check the
#: availability of the destination.
UPLOAD_NOT_ACCESSIBLE = "UploadNotAccessible"
#: While trying to upload the output files, there was an issue during transfer (storage service,
#: network errors), see details and check your destination.
UPLOAD_TRANSIENT_ERROR = "UploadTransientError"
#: There was a problem with the combination of input files and the configuration settings applied,
#: fix the configuration settings and retry with the same input, or change input to match the
#: configuration.
CONFIGURATION_UNSUPPORTED = "ConfigurationUnsupported"
#: There was a problem with the input content (for example: zero byte files, or corrupt/non-
#: decodable files), check the input files.
CONTENT_MALFORMED = "ContentMalformed"
#: There was a problem with the format of the input (not valid media file, or an unsupported
#: file/codec), check the validity of the input files.
CONTENT_UNSUPPORTED = "ContentUnsupported"

class MediaJobRetry(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact
Azure support via Azure Portal.
"""

DO_NOT_RETRY = "DoNotRetry" #: Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected.
MAY_RETRY = "MayRetry" #: Issue may be resolved after waiting for a period of time and resubmitting the same Job.
#: Issue needs to be investigated and then the job resubmitted with corrections or retried once
#: the underlying issue has been corrected.
DO_NOT_RETRY = "DoNotRetry"
#: Issue may be resolved after waiting for a period of time and resubmitting the same Job.
MAY_RETRY = "MayRetry"

class MediaJobState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The previous state of the Job.
"""

CANCELED = "Canceled" #: The job was canceled. This is a final state for the job.
CANCELING = "Canceling" #: The job is in the process of being canceled. This is a transient state for the job.
ERROR = "Error" #: The job has encountered an error. This is a final state for the job.
FINISHED = "Finished" #: The job is finished. This is a final state for the job.
PROCESSING = "Processing" #: The job is processing. This is a transient state for the job.
QUEUED = "Queued" #: The job is in a queued state, waiting for resources to become available. This is a transient state.
SCHEDULED = "Scheduled" #: The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states.
#: The job was canceled. This is a final state for the job.
CANCELED = "Canceled"
#: The job is in the process of being canceled. This is a transient state for the job.
CANCELING = "Canceling"
#: The job has encountered an error. This is a final state for the job.
ERROR = "Error"
#: The job is finished. This is a final state for the job.
FINISHED = "Finished"
#: The job is processing. This is a transient state for the job.
PROCESSING = "Processing"
#: The job is in a queued state, waiting for resources to become available. This is a transient
#: state.
QUEUED = "Queued"
#: The job is being scheduled to run on an available resource. This is a transient state, between
#: queued and processing states.
SCHEDULED = "Scheduled"

class StampKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Kind of environment where app service plan is.
"""

PUBLIC = "Public" #: App Service Plan is running on a public stamp.
ASE_V1 = "AseV1" #: App Service Plan is running on an App Service Environment V1.
ASE_V2 = "AseV2" #: App Service Plan is running on an App Service Environment V2.
#: App Service Plan is running on a public stamp.
PUBLIC = "Public"
#: App Service Plan is running on an App Service Environment V1.
ASE_V1 = "AseV1"
#: App Service Plan is running on an App Service Environment V2.
ASE_V2 = "AseV2"

Large diffs are not rendered by default.

1,228 changes: 985 additions & 243 deletions sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@
from typing import TYPE_CHECKING
import warnings

from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from .. import models
from .. import models as _models

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
@@ -26,7 +26,7 @@ class EventGridPublisherClientOperationsMixin(object):
def publish_events(
self,
topic_hostname, # type: str
events, # type: List["models.EventGridEvent"]
events, # type: List["_models.EventGridEvent"]
**kwargs # type: Any
):
# type: (...) -> None
@@ -42,7 +42,9 @@ def publish_events(
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-01-01"
content_type = kwargs.pop("content_type", "application/json")
@@ -66,7 +68,6 @@ def publish_events(
body_content = self._serialize.body(events, '[EventGridEvent]')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)

pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

@@ -82,7 +83,7 @@ def publish_events(
def publish_cloud_event_events(
self,
topic_hostname, # type: str
events, # type: List["models.CloudEvent"]
events, # type: List["_models.CloudEvent"]
**kwargs # type: Any
):
# type: (...) -> None
@@ -98,7 +99,9 @@ def publish_cloud_event_events(
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-01-01"
content_type = kwargs.pop("content_type", "application/cloudevents-batch+json; charset=utf-8")
@@ -122,7 +125,6 @@ def publish_cloud_event_events(
body_content = self._serialize.body(events, '[CloudEvent]')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)

pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

@@ -154,7 +156,9 @@ def publish_custom_event_events(
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-01-01"
content_type = kwargs.pop("content_type", "application/json")
@@ -178,7 +182,6 @@ def publish_custom_event_events(
body_content = self._serialize.body(events, '[object]')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)

pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

8 changes: 4 additions & 4 deletions sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ no-namespace-folders: true
output-folder: ../azure/eventgrid/_generated
source-code-folder-path: ./azure/eventgrid/_generated
input-file:
- https://github.com/ellismg/azure-rest-api-specs/blob/4bb5b76cb8401896b15f1be3fdaac6bd5d299b17/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Storage/stable/2018-01-01/Storage.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.AppConfiguration/stable/2018-01-01/AppConfiguration.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Cache/stable/2018-01-01/RedisCache.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.ContainerRegistry/stable/2018-01-01/ContainerRegistry.json
@@ -27,10 +27,10 @@ input-file:
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Resources/stable/2018-01-01/Resources.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.ServiceBus/stable/2018-01-01/ServiceBus.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.SignalRService/stable/2018-01-01/SignalRService.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Storage/stable/2018-01-01/Storage.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Web/stable/2018-01-01/Web.json
- https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json

python: true
v3: true
use: "@autorest/python@5.1.0-preview.7"
use: "@autorest/python@5.6.4"
```
2 changes: 1 addition & 1 deletion sdk/eventgrid/azure-eventgrid/tests/test_serialization.py
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ def test_event_grid_event_raises_on_no_data(self):
)

def test_import_from_sytem_events(self):
var = SystemEventNames.ACSChatMemberAddedToThreadWithUserEventName
var = SystemEventNames.AcsChatMemberAddedToThreadWithUserEventName
assert var == "Microsoft.Communication.ChatMemberAddedToThreadWithUser"
assert SystemEventNames.KeyVaultKeyNearExpiryEventName == "Microsoft.KeyVault.KeyNearExpiry"
var = SystemEventNames.ServiceBusActiveMessagesAvailableWithNoListenersEventName