Skip to content

Commit 4c54a6b

Browse files
authored
Update to script (Azure#23852)
* Update to script * update * updates * final update * update
1 parent a869b53 commit 4c54a6b

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class SystemEventNames(str, Enum):
1414
Azure Event Grid. To check the list of recognizable system topics,
1515
visit https://docs.microsoft.com/azure/event-grid/system-topics.
1616
"""
17-
# these names below are for backward compat only - refrain from using them.
17+
# These names at the top are 'corrected' aliases of duplicate values that appear below, which are
18+
# deprecated but maintained for backwards compatibility.
1819
AcsChatMemberAddedToThreadWithUserEventName = 'Microsoft.Communication.ChatMemberAddedToThreadWithUser'
1920

2021
ResourceWriteFailureEventName = 'Microsoft.Resources.ResourceWriteFailure'
@@ -53,13 +54,7 @@ class SystemEventNames(str, Enum):
5354

5455
IoTHubDeviceCreatedEventName = 'Microsoft.Devices.DeviceCreated'
5556

56-
KeyVaultAccessPolicyChangedEventName = 'Microsoft.KeyVault.VaultAccessPolicyChanged'
57-
58-
SubscriptionDeletedEventName = 'Microsoft.EventGrid.SubscriptionDeletedEvent'
59-
60-
SubscriptionValidationEventName = 'Microsoft.EventGrid.SubscriptionValidationEvent'
61-
62-
# backward compat names end here.
57+
# Aliases end here
6358
AcsChatMessageDeletedEventName = 'Microsoft.Communication.ChatMessageDeleted'
6459

6560
AcsChatMessageDeletedInThreadEventName = 'Microsoft.Communication.ChatMessageDeletedInThread'
@@ -312,6 +307,10 @@ class SystemEventNames(str, Enum):
312307

313308
StorageLifecyclePolicyCompletedEventName = 'Microsoft.Storage.LifecyclePolicyCompleted'
314309

310+
SubscriptionDeletedEventName = 'Microsoft.EventGrid.SubscriptionDeletedEvent'
311+
312+
SubscriptionValidationEventName = 'Microsoft.EventGrid.SubscriptionValidationEvent'
313+
315314
WebAppServicePlanUpdatedEventName = 'Microsoft.Web.AppServicePlanUpdated'
316315

317316
WebAppUpdatedEventName = 'Microsoft.Web.AppUpdated'
@@ -338,9 +337,10 @@ class SystemEventNames(str, Enum):
338337

339338
WebSlotSwapWithPreviewStartedEventName = 'Microsoft.Web.SlotSwapWithPreviewStarted'
340339

341-
# servicebus alias
342-
ServiceBusDeadletterMessagesAvailableWithNoListenerEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners'
343-
344340
ContainerRegistryArtifactEventName = 'Microsoft.AppConfiguration.KeyValueModified'
345341

342+
KeyVaultAccessPolicyChangedEventName = 'Microsoft.KeyVault.VaultAccessPolicyChanged'
343+
346344
ContainerRegistryEventName = 'Microsoft.ContainerRegistry.ChartPushed'
345+
346+
ServiceBusDeadletterMessagesAvailableWithNoListenerEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners'

sdk/eventgrid/azure-eventgrid/swagger/_constants.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/eventgrid/data-plane/Microsoft.ContainerRegistry/stable/2018-01-01/ContainerRegistry.json",
1010
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/eventgrid/data-plane/Microsoft.ContainerService/stable/2018-01-01/ContainerService.json",
1111
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/eventgrid/data-plane/Microsoft.EventHub/stable/2018-01-01/EventHub.json",
12+
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json",
1213
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json",
1314
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/eventgrid/data-plane/Microsoft.KeyVault/stable/2018-01-01/KeyVault.json",
1415
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/eventgrid/data-plane/Microsoft.MachineLearningServices/stable/2018-01-01/MachineLearningServices.json",
@@ -48,11 +49,12 @@
4849
'AcsChatThreadParticipantRemovedEventName': "Microsoft.Communication.ChatThreadParticipantRemoved",
4950
'ResourceActionCancelEventName': "Microsoft.Resources.ResourceActionCancel",
5051
'IoTHubDeviceCreatedEventName': "Microsoft.Devices.DeviceCreated",
52+
}
53+
54+
additional_events = {
5155
'ContainerRegistryArtifactEventName': 'Microsoft.AppConfiguration.KeyValueModified',
5256
'KeyVaultAccessPolicyChangedEventName': 'Microsoft.KeyVault.VaultAccessPolicyChanged',
5357
'ContainerRegistryEventName': 'Microsoft.ContainerRegistry.ChartPushed',
54-
'SubscriptionDeletedEventName': 'Microsoft.EventGrid.SubscriptionDeletedEvent',
55-
'SubscriptionValidationEventName': 'Microsoft.EventGrid.SubscriptionValidationEvent',
5658
'ServiceBusDeadletterMessagesAvailableWithNoListenerEventName': 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners'
5759
}
5860

sdk/eventgrid/azure-eventgrid/swagger/postprocess_eventnames.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
from urllib.request import urlopen
66
from azure.eventgrid._generated import models
7-
from _constants import files, backward_compat, EXCEPTIONS
7+
from _constants import files, backward_compat, additional_events, EXCEPTIONS
88

99
def extract(definitions):
1010
if not definitions:
@@ -22,12 +22,15 @@ def extract(definitions):
2222
return tups
2323

2424
def generate_enum_content(tuples):
25-
print("# these names below are for backward compat only - refrain from using them.")
25+
print("# These names at the top are 'corrected' aliases of duplicate values that appear below, which are")
26+
print("# deprecated but maintained for backwards compatibility.")
2627
for k, v in backward_compat.items():
2728
print(k + " = '" + v + "'\n")
28-
print("# backward compat names end here.")
29+
print("# Aliases end here")
2930
for tup in tup_list:
3031
print(tup[0] + " = '" + tup[1].replace('API', 'Api') + "'\n")
32+
for k, v in additional_events.items():
33+
print(k + " = '" + v + "'\n")
3134

3235
definitions = {}
3336
for fp in files:

0 commit comments

Comments
 (0)