From 2dc7f98b4090dd6276d916607b034d714358db6e Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 11 May 2021 18:06:23 -0700 Subject: [PATCH 1/5] backward compat fix api diff --- .../azure/eventgrid/_event_mappings.py | 95 ++++++++++--------- .../swagger/postprocess_eventnames.py | 6 +- 2 files changed, 51 insertions(+), 50 deletions(-) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py index 1b2f518a52d1..d862b91846a1 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py @@ -12,6 +12,48 @@ class SystemEventNames(str, Enum): Azure Event Grid. To check the list of recognizable system topics, visit https://docs.microsoft.com/azure/event-grid/system-topics. """ + # these names below are for backward compat only - refrain from using them. + AcsChatMemberAddedToThreadWithUserEventName = 'Microsoft.Communication.ChatMemberAddedToThreadWithUser' + + ResourceWriteFailureEventName = 'Microsoft.Resources.ResourceWriteFailure' + + IoTHubDeviceDeletedEventName = 'Microsoft.Devices.DeviceDeleted' + + IoTHubDeviceDisconnectedEventName = 'Microsoft.Devices.DeviceDisconnected' + + ResourceDeleteFailureEventName = 'Microsoft.Resources.ResourceDeleteFailure' + + ResourceDeleteCancelEventName = 'Microsoft.Resources.ResourceDeleteCancel' + + AcsChatThreadParticipantAddedEventName = 'Microsoft.Communication.ChatThreadParticipantAdded' + + ResourceDeleteSuccessEventName = 'Microsoft.Resources.ResourceDeleteSuccess' + + EventGridSubscriptionValidationEventName = 'Microsoft.EventGrid.SubscriptionValidationEvent' + + ResourceWriteSuccessEventName = 'Microsoft.Resources.ResourceWriteSuccess' + + ResourceActionSuccessEventName = 'Microsoft.Resources.ResourceActionSuccess' + + ResourceWriteCancelEventName = 'Microsoft.Resources.ResourceWriteCancel' + + ServiceBusDeadletterMessagesAvailableWithNoListenerEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener' + + ResourceActionFailureEventName = 'Microsoft.Resources.ResourceActionFailure' + + AcsChatMemberRemovedFromThreadWithUserEventName = 'Microsoft.Communication.ChatMemberRemovedFromThreadWithUser' + + IoTHubDeviceConnectedEventName = 'Microsoft.Devices.DeviceConnected' + + EventGridSubscriptionDeletedEventName = 'Microsoft.EventGrid.SubscriptionDeletedEvent' + + AcsChatThreadParticipantRemovedEventName = 'Microsoft.Communication.ChatThreadParticipantRemoved' + + ResourceActionCancelEventName = 'Microsoft.Resources.ResourceActionCancel' + + IoTHubDeviceCreatedEventName = 'Microsoft.Devices.DeviceCreated' + + # backward compat names end here. AcsChatMessageDeletedEventName = 'Microsoft.Communication.ChatMessageDeleted' AcsChatMessageDeletedInThreadEventName = 'Microsoft.Communication.ChatMessageDeletedInThread' @@ -28,7 +70,7 @@ class SystemEventNames(str, Enum): AcsChatParticipantAddedToThreadWithUserEventName = 'Microsoft.Communication.ChatParticipantAddedToThreadWithUser' - AcsChatParticipantRemovedFromThreadEventName = 'Microsoft.Communication.ChatThreadParticipantRemoved' + AcsChatParticipantRemovedFromThreadEventName = 'Microsoft.Communication.ChatThreadParticipantRemoved' AcsChatParticipantRemovedFromThreadWithUserEventName = 'Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser' @@ -102,7 +144,7 @@ class SystemEventNames(str, Enum): MachineLearningServicesModelDeployedEventName = 'Microsoft.MachineLearningServices.ModelDeployed' - MachineLearningServicesModelRegisteredEventName = 'Microsoft.MachineLearningServices.ModelRegistered' + MachineLearningServicesModelRegisteredEventName = 'Microsoft.MachineLearningServices.ModelRegistered' MachineLearningServicesRunCompletedEventName = 'Microsoft.MachineLearningServices.RunCompleted' @@ -150,17 +192,17 @@ class SystemEventNames(str, Enum): MediaLiveEventEncoderDisconnectedEventName = 'Microsoft.Media.LiveEventEncoderDisconnected' - MediaLiveEventIncomingNameChunkDroppedEventName = 'Microsoft.Media.LiveEventIncomingDataChunkDropped' + MediaLiveEventIncomingNameChunkDroppedEventName = 'Microsoft.Media.LiveEventIncomingDataChunkDropped' MediaLiveEventIncomingStreamReceivedEventName = 'Microsoft.Media.LiveEventIncomingStreamReceived' - MediaLiveEventIncomingStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingStreamsOutOfSync' + MediaLiveEventIncomingStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingStreamsOutOfSync' MediaLiveEventIncomingVideoStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync' MediaLiveEventIngestHeartbeatEventName = 'Microsoft.Media.LiveEventIngestHeartbeat' - MediaLiveEventTrackDiscontinuityDetectedEventName = 'Microsoft.Media.LiveEventTrackDiscontinuityDetected' + MediaLiveEventTrackDiscontinuityDetectedEventName = 'Microsoft.Media.LiveEventTrackDiscontinuityDetected' PolicyInsightsPolicyStateChangedEventName = 'Microsoft.PolicyInsights.PolicyStateChanged' @@ -202,7 +244,7 @@ class SystemEventNames(str, Enum): ServiceBusDeadletterMessagesAvailableWithNoListenersEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListenersEvent' - SignalRServiceClientConnectionConnectedEventName = 'Microsoft.SignalRService.ClientConnectionConnected' + SignalRServiceClientConnectionConnectedEventName = 'Microsoft.SignalRService.ClientConnectionConnected' SignalRServiceClientConnectionDisconnectedEventName = 'Microsoft.SignalRService.ClientConnectionDisconnected' @@ -253,44 +295,3 @@ class SystemEventNames(str, Enum): WebSlotSwapWithPreviewCancelledEventName = 'Microsoft.Web.SlotSwapWithPreviewCancelled' WebSlotSwapWithPreviewStartedEventName = 'Microsoft.Web.SlotSwapWithPreviewStarted' - - # these names below are for backward compat only - refrain from using them. - AcsChatMemberAddedToThreadWithUserEventName = 'Microsoft.Communication.ChatMemberAddedToThreadWithUser' - - ResourceWriteFailureEventName = 'Microsoft.Resources.ResourceWriteFailure' - - IoTHubDeviceDeletedEventName = 'Microsoft.Devices.DeviceDeleted' - - IoTHubDeviceDisconnectedEventName = 'Microsoft.Devices.DeviceDisconnected' - - ResourceDeleteFailureEventName = 'Microsoft.Resources.ResourceDeleteFailure' - - ResourceDeleteCancelEventName = 'Microsoft.Resources.ResourceDeleteCancel' - - AcsChatThreadParticipantAddedEventName = 'Microsoft.Communication.ChatThreadParticipantAdded' - - ResourceDeleteSuccessEventName = 'Microsoft.Resources.ResourceDeleteSuccess' - - EventGridSubscriptionValidationEventName = 'Microsoft.EventGrid.SubscriptionValidationEvent' - - ResourceWriteSuccessEventName = 'Microsoft.Resources.ResourceWriteSuccess' - - ResourceActionSuccessEventName = 'Microsoft.Resources.ResourceActionSuccess' - - ResourceWriteCancelEventName = 'Microsoft.Resources.ResourceWriteCancel' - - ServiceBusDeadletterMessagesAvailableWithNoListenerEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener' - - ResourceActionFailureEventName = 'Microsoft.Resources.ResourceActionFailure' - - AcsChatMemberRemovedFromThreadWithUserEventName = 'Microsoft.Communication.ChatMemberRemovedFromThreadWithUser' - - IoTHubDeviceConnectedEventName = 'Microsoft.Devices.DeviceConnected' - - EventGridSubscriptionDeletedEventName = 'Microsoft.EventGrid.SubscriptionDeletedEvent' - - AcsChatThreadParticipantRemovedEventName = 'Microsoft.Communication.ChatThreadParticipantRemoved' - - ResourceActionCancelEventName = 'Microsoft.Resources.ResourceActionCancel' - - IoTHubDeviceCreatedEventName = 'Microsoft.Devices.DeviceCreated' diff --git a/sdk/eventgrid/azure-eventgrid/swagger/postprocess_eventnames.py b/sdk/eventgrid/azure-eventgrid/swagger/postprocess_eventnames.py index ad20925542ce..3e818204da80 100644 --- a/sdk/eventgrid/azure-eventgrid/swagger/postprocess_eventnames.py +++ b/sdk/eventgrid/azure-eventgrid/swagger/postprocess_eventnames.py @@ -42,12 +42,12 @@ def event_tuples(system_events): return tup_list def generate_enum_content(tuples): - for tup in tup_list: - print(tup[0] + " = '" + tup[1] + "'\n") print("# these names below are for backward compat only - refrain from using them.") for k, v in backward_compat.items(): print(k + " = '" + v + "'\n") - + print("# backward compat names end here.") + for tup in tup_list: + print(tup[0] + " = '" + tup[1] + "'\n") system_events = [m for m in inspect.getmembers(models) if m[0].endswith('Data')] tup_list = event_tuples(system_events) From dc3b0da42a402fd68bf74db221b767939ec2e4af Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 11 May 2021 18:06:58 -0700 Subject: [PATCH 2/5] changelog --- sdk/eventgrid/azure-eventgrid/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventgrid/azure-eventgrid/CHANGELOG.md b/sdk/eventgrid/azure-eventgrid/CHANGELOG.md index 2b91553c0709..2421976a45f9 100644 --- a/sdk/eventgrid/azure-eventgrid/CHANGELOG.md +++ b/sdk/eventgrid/azure-eventgrid/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.2.0 (2021-05-11) +## 4.2.0 (2021-05-12) **New Features** - Added new event names to the `SystemEventNames` enum. From 59223dc19d5b8ca88faee176879784907b71ae3d Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 11 May 2021 18:10:21 -0700 Subject: [PATCH 3/5] fix --- .../azure-eventgrid/azure/eventgrid/_event_mappings.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py index d862b91846a1..37f32719b80a 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py @@ -70,7 +70,7 @@ class SystemEventNames(str, Enum): AcsChatParticipantAddedToThreadWithUserEventName = 'Microsoft.Communication.ChatParticipantAddedToThreadWithUser' - AcsChatParticipantRemovedFromThreadEventName = 'Microsoft.Communication.ChatThreadParticipantRemoved' + AcsChatParticipantRemovedFromThreadEventName = 'Microsoft.Communication.ChatThreadParticipantRemoved' AcsChatParticipantRemovedFromThreadWithUserEventName = 'Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser' @@ -140,11 +140,11 @@ class SystemEventNames(str, Enum): KeyVaultSecretNewVersionCreatedEventName = 'Microsoft.KeyVault.SecretNewVersionCreated' - MachineLearningServicesNamesetDriftDetectedEventName = 'Microsoft.MachineLearningServices.DatasetDriftDetected' + MachineLearningServicesDatasetDriftDetectedEventName = 'Microsoft.MachineLearningServices.DatasetDriftDetected' MachineLearningServicesModelDeployedEventName = 'Microsoft.MachineLearningServices.ModelDeployed' - MachineLearningServicesModelRegisteredEventName = 'Microsoft.MachineLearningServices.ModelRegistered' + MachineLearningServicesModelRegisteredEventName = 'Microsoft.MachineLearningServices.ModelRegistered' MachineLearningServicesRunCompletedEventName = 'Microsoft.MachineLearningServices.RunCompleted' @@ -192,7 +192,7 @@ class SystemEventNames(str, Enum): MediaLiveEventEncoderDisconnectedEventName = 'Microsoft.Media.LiveEventEncoderDisconnected' - MediaLiveEventIncomingNameChunkDroppedEventName = 'Microsoft.Media.LiveEventIncomingDataChunkDropped' + MediaLiveEventIncomingDataChunkDroppedEventName = 'Microsoft.Media.LiveEventIncomingDataChunkDropped' MediaLiveEventIncomingStreamReceivedEventName = 'Microsoft.Media.LiveEventIncomingStreamReceived' @@ -244,7 +244,7 @@ class SystemEventNames(str, Enum): ServiceBusDeadletterMessagesAvailableWithNoListenersEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListenersEvent' - SignalRServiceClientConnectionConnectedEventName = 'Microsoft.SignalRService.ClientConnectionConnected' + SignalRServiceClientConnectionConnectedEventName = 'Microsoft.SignalRService.ClientConnectionConnected' SignalRServiceClientConnectionDisconnectedEventName = 'Microsoft.SignalRService.ClientConnectionDisconnected' From c2da6e549a043ee399e51fb6ddbfcc5b3853a8e2 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 11 May 2021 18:11:38 -0700 Subject: [PATCH 4/5] Apply suggestions from code review --- .../azure-eventgrid/azure/eventgrid/_event_mappings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py index 37f32719b80a..2327089d5498 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py @@ -196,13 +196,13 @@ class SystemEventNames(str, Enum): MediaLiveEventIncomingStreamReceivedEventName = 'Microsoft.Media.LiveEventIncomingStreamReceived' - MediaLiveEventIncomingStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingStreamsOutOfSync' + MediaLiveEventIncomingStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingStreamsOutOfSync' MediaLiveEventIncomingVideoStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync' MediaLiveEventIngestHeartbeatEventName = 'Microsoft.Media.LiveEventIngestHeartbeat' - MediaLiveEventTrackDiscontinuityDetectedEventName = 'Microsoft.Media.LiveEventTrackDiscontinuityDetected' + MediaLiveEventTrackDiscontinuityDetectedEventName = 'Microsoft.Media.LiveEventTrackDiscontinuityDetected' PolicyInsightsPolicyStateChangedEventName = 'Microsoft.PolicyInsights.PolicyStateChanged' From 0dcab419b087082cedae72420a882395f7d4c344 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 11 May 2021 18:11:54 -0700 Subject: [PATCH 5/5] Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py --- .../azure-eventgrid/azure/eventgrid/_event_mappings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py index 2327089d5498..da2593bacb96 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py @@ -196,7 +196,7 @@ class SystemEventNames(str, Enum): MediaLiveEventIncomingStreamReceivedEventName = 'Microsoft.Media.LiveEventIncomingStreamReceived' - MediaLiveEventIncomingStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingStreamsOutOfSync' + MediaLiveEventIncomingStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingStreamsOutOfSync' MediaLiveEventIncomingVideoStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync'