| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.Collections.Generic; |
| | 6 | | using System.Text.Json; |
| | 7 | | using Azure.Messaging.EventGrid.SystemEvents; |
| | 8 | |
|
| | 9 | | namespace Azure.Messaging.EventGrid |
| | 10 | | { |
| | 11 | | internal class SystemEventTypeMappings |
| | 12 | | { |
| 2 | 13 | | public static readonly IReadOnlyDictionary<string, Func<JsonElement, object>> SystemEventDeserializers = new Dic |
| 2 | 14 | | { |
| 2 | 15 | | // KEEP THIS SORTED BY THE NAME OF THE PUBLISHING SERVICE |
| 2 | 16 | | // Add handling for additional event types here. |
| 2 | 17 | |
|
| 2 | 18 | | // AppConfiguration events |
| 2 | 19 | | { EventTypes.AppConfigurationKeyValueDeletedEvent, AppConfigurationKeyValueDeletedEventData.DeserializeAppCo |
| 2 | 20 | | { EventTypes.AppConfigurationKeyValueModifiedEvent, AppConfigurationKeyValueModifiedEventData.DeserializeApp |
| 2 | 21 | |
|
| 2 | 22 | | // ContainerRegistry events |
| 2 | 23 | | { EventTypes.ContainerRegistryImagePushedEvent, ContainerRegistryImagePushedEventData.DeserializeContainerRe |
| 2 | 24 | | { EventTypes.ContainerRegistryImageDeletedEvent, ContainerRegistryImageDeletedEventData.DeserializeContainer |
| 2 | 25 | | { EventTypes.ContainerRegistryChartDeletedEvent, ContainerRegistryChartDeletedEventData.DeserializeContainer |
| 2 | 26 | | { EventTypes.ContainerRegistryChartPushedEvent, ContainerRegistryChartPushedEventData.DeserializeContainerRe |
| 2 | 27 | |
|
| 2 | 28 | | // IoTHub Device events |
| 2 | 29 | | { EventTypes.IoTHubDeviceCreatedEvent, IotHubDeviceCreatedEventData.DeserializeIotHubDeviceCreatedEventData |
| 2 | 30 | | { EventTypes.IoTHubDeviceDeletedEvent, IotHubDeviceDeletedEventData.DeserializeIotHubDeviceDeletedEventData |
| 2 | 31 | | { EventTypes.IoTHubDeviceConnectedEvent, IotHubDeviceConnectedEventData.DeserializeIotHubDeviceConnectedEven |
| 2 | 32 | | { EventTypes.IoTHubDeviceDisconnectedEvent, IotHubDeviceDisconnectedEventData.DeserializeIotHubDeviceDisconn |
| 2 | 33 | | { EventTypes.IotHubDeviceTelemetryEvent, IotHubDeviceTelemetryEventData.DeserializeIotHubDeviceTelemetryEven |
| 2 | 34 | |
|
| 2 | 35 | | // EventGrid events |
| 2 | 36 | | { EventTypes.EventGridSubscriptionValidationEvent, SubscriptionValidationEventData.DeserializeSubscriptionVa |
| 2 | 37 | | { EventTypes.EventGridSubscriptionDeletedEvent, SubscriptionDeletedEventData.DeserializeSubscriptionDeletedE |
| 2 | 38 | |
|
| 2 | 39 | | // Event Hub events |
| 2 | 40 | | { EventTypes.EventHubCaptureFileCreatedEvent, EventHubCaptureFileCreatedEventData.DeserializeEventHubCapture |
| 2 | 41 | |
|
| 2 | 42 | | // MachineLearningServices events |
| 2 | 43 | | { EventTypes.MachineLearningServicesDatasetDriftDetectedEvent, MachineLearningServicesDatasetDriftDetectedEv |
| 2 | 44 | | { EventTypes.MachineLearningServicesModelDeployedEvent, MachineLearningServicesModelDeployedEventData.Deseri |
| 2 | 45 | | { EventTypes.MachineLearningServicesModelRegisteredEvent, MachineLearningServicesModelRegisteredEventData.De |
| 2 | 46 | | { EventTypes.MachineLearningServicesRunCompletedEvent, MachineLearningServicesRunCompletedEventData.Deserial |
| 2 | 47 | | { EventTypes.MachineLearningServicesRunStatusChangedEvent, MachineLearningServicesRunStatusChangedEventData. |
| 2 | 48 | |
|
| 2 | 49 | | // Maps events |
| 2 | 50 | | { EventTypes.MapsGeofenceEnteredEvent, MapsGeofenceEnteredEventData.DeserializeMapsGeofenceEnteredEventData |
| 2 | 51 | | { EventTypes.MapsGeofenceExitedEvent, MapsGeofenceExitedEventData.DeserializeMapsGeofenceExitedEventData }, |
| 2 | 52 | | { EventTypes.MapsGeofenceResultEvent, MapsGeofenceResultEventData.DeserializeMapsGeofenceResultEventData }, |
| 2 | 53 | |
|
| 2 | 54 | | // Media Services events |
| 2 | 55 | | { EventTypes.MediaJobStateChangeEvent, MediaJobStateChangeEventData.DeserializeMediaJobStateChangeEventData |
| 2 | 56 | | { EventTypes.MediaJobOutputStateChangeEvent, MediaJobOutputStateChangeEventData.DeserializeMediaJobOutputSta |
| 2 | 57 | | { EventTypes.MediaJobScheduledEvent, MediaJobScheduledEventData.DeserializeMediaJobScheduledEventData }, |
| 2 | 58 | | { EventTypes.MediaJobProcessingEvent, MediaJobProcessingEventData.DeserializeMediaJobProcessingEventData }, |
| 2 | 59 | | { EventTypes.MediaJobCancelingEvent, MediaJobCancelingEventData.DeserializeMediaJobCancelingEventData }, |
| 2 | 60 | | { EventTypes.MediaJobFinishedEvent, MediaJobFinishedEventData.DeserializeMediaJobFinishedEventData }, |
| 2 | 61 | | { EventTypes.MediaJobCanceledEvent, MediaJobCanceledEventData.DeserializeMediaJobCanceledEventData }, |
| 2 | 62 | | { EventTypes.MediaJobErroredEvent, MediaJobErroredEventData.DeserializeMediaJobErroredEventData }, |
| 2 | 63 | | { EventTypes.MediaJobOutputCanceledEvent, MediaJobOutputCanceledEventData.DeserializeMediaJobOutputCanceledE |
| 2 | 64 | | { EventTypes.MediaJobOutputCancelingEvent, MediaJobOutputCancelingEventData.DeserializeMediaJobOutputCanceli |
| 2 | 65 | | { EventTypes.MediaJobOutputErroredEvent, MediaJobOutputErroredEventData.DeserializeMediaJobOutputErroredEven |
| 2 | 66 | | { EventTypes.MediaJobOutputFinishedEvent, MediaJobOutputFinishedEventData.DeserializeMediaJobOutputFinishedE |
| 2 | 67 | | { EventTypes.MediaJobOutputProcessingEvent, MediaJobOutputProcessingEventData.DeserializeMediaJobOutputProce |
| 2 | 68 | | { EventTypes.MediaJobOutputScheduledEvent, MediaJobOutputScheduledEventData.DeserializeMediaJobOutputSchedul |
| 2 | 69 | | { EventTypes.MediaJobOutputProgressEvent, MediaJobOutputProgressEventData.DeserializeMediaJobOutputProgressE |
| 2 | 70 | | { EventTypes.MediaLiveEventEncoderConnectedEvent, MediaLiveEventEncoderConnectedEventData.DeserializeMediaLi |
| 2 | 71 | | { EventTypes.MediaLiveEventConnectionRejectedEvent, MediaLiveEventConnectionRejectedEventData.DeserializeMed |
| 2 | 72 | | { EventTypes.MediaLiveEventEncoderDisconnectedEvent, MediaLiveEventEncoderDisconnectedEventData.DeserializeM |
| 2 | 73 | | { EventTypes.MediaLiveEventIncomingStreamReceivedEvent, MediaLiveEventIncomingStreamReceivedEventData.Deseri |
| 2 | 74 | | { EventTypes.MediaLiveEventIncomingStreamsOutOfSyncEvent, MediaLiveEventIncomingStreamsOutOfSyncEventData.De |
| 2 | 75 | | { EventTypes.MediaLiveEventIncomingVideoStreamsOutOfSyncEvent, MediaLiveEventIncomingVideoStreamsOutOfSyncEv |
| 2 | 76 | | { EventTypes.MediaLiveEventIncomingChunkDroppedEvent, MediaLiveEventIncomingDataChunkDroppedEventData.Deseri |
| 2 | 77 | | { EventTypes.MediaLiveEventIngestHeartbeatEvent, MediaLiveEventIngestHeartbeatEventData.DeserializeMediaLive |
| 2 | 78 | | { EventTypes.MediaLiveEventTrackDiscontinuityDetectedEvent, MediaLiveEventTrackDiscontinuityDetectedEventDat |
| 2 | 79 | |
|
| 2 | 80 | | // Resource Manager (Azure Subscription/Resource Group) events |
| 2 | 81 | | { EventTypes.ResourceWriteSuccessEvent, ResourceWriteSuccessData.DeserializeResourceWriteSuccessData }, |
| 2 | 82 | | { EventTypes.ResourceWriteFailureEvent, ResourceWriteFailureData.DeserializeResourceWriteFailureData }, |
| 2 | 83 | | { EventTypes.ResourceWriteCancelEvent, ResourceWriteCancelData.DeserializeResourceWriteCancelData }, |
| 2 | 84 | | { EventTypes.ResourceDeleteSuccessEvent, ResourceDeleteSuccessData.DeserializeResourceDeleteSuccessData }, |
| 2 | 85 | | { EventTypes.ResourceDeleteFailureEvent, ResourceDeleteFailureData.DeserializeResourceDeleteFailureData }, |
| 2 | 86 | | { EventTypes.ResourceDeleteCancelEvent, ResourceDeleteCancelData.DeserializeResourceDeleteCancelData }, |
| 2 | 87 | | { EventTypes.ResourceActionSuccessEvent, ResourceActionSuccessData.DeserializeResourceActionSuccessData }, |
| 2 | 88 | | { EventTypes.ResourceActionFailureEvent, ResourceActionFailureData.DeserializeResourceActionFailureData }, |
| 2 | 89 | | { EventTypes.ResourceActionCancelEvent, ResourceActionCancelData.DeserializeResourceActionCancelData }, |
| 2 | 90 | |
|
| 2 | 91 | | // ServiceBus events |
| 2 | 92 | | { EventTypes.ServiceBusActiveMessagesAvailableWithNoListenersEvent, ServiceBusActiveMessagesAvailableWithNoL |
| 2 | 93 | | { EventTypes.ServiceBusDeadletterMessagesAvailableWithNoListenerEvent, ServiceBusDeadletterMessagesAvailable |
| 2 | 94 | |
|
| 2 | 95 | | // Storage events |
| 2 | 96 | | { EventTypes.StorageBlobCreatedEvent, StorageBlobCreatedEventData.DeserializeStorageBlobCreatedEventData }, |
| 2 | 97 | | { EventTypes.StorageBlobDeletedEvent, StorageBlobDeletedEventData.DeserializeStorageBlobDeletedEventData }, |
| 2 | 98 | | { EventTypes.StorageBlobRenamedEvent, StorageBlobRenamedEventData.DeserializeStorageBlobRenamedEventData }, |
| 2 | 99 | | { EventTypes.StorageDirectoryCreatedEvent, StorageDirectoryCreatedEventData.DeserializeStorageDirectoryCreat |
| 2 | 100 | | { EventTypes.StorageDirectoryDeletedEvent, StorageDirectoryDeletedEventData.DeserializeStorageDirectoryDelet |
| 2 | 101 | | { EventTypes.StorageDirectoryRenamedEvent, StorageDirectoryRenamedEventData.DeserializeStorageDirectoryRenam |
| 2 | 102 | |
|
| 2 | 103 | | // App Service |
| 2 | 104 | | { EventTypes.WebAppUpdated, WebAppUpdatedEventData.DeserializeWebAppUpdatedEventData }, |
| 2 | 105 | | { EventTypes.WebBackupOperationStarted, WebBackupOperationStartedEventData.DeserializeWebBackupOperationStar |
| 2 | 106 | | { EventTypes.WebBackupOperationCompleted, WebBackupOperationCompletedEventData.DeserializeWebBackupOperation |
| 2 | 107 | | { EventTypes.WebBackupOperationFailed, WebBackupOperationFailedEventData.DeserializeWebBackupOperationFailed |
| 2 | 108 | | { EventTypes.WebRestoreOperationStarted, WebRestoreOperationStartedEventData.DeserializeWebRestoreOperationS |
| 2 | 109 | | { EventTypes.WebRestoreOperationCompleted, WebRestoreOperationCompletedEventData.DeserializeWebRestoreOperat |
| 2 | 110 | | { EventTypes.WebRestoreOperationFailed, WebRestoreOperationFailedEventData.DeserializeWebRestoreOperationFai |
| 2 | 111 | | { EventTypes.WebSlotSwapStarted, WebSlotSwapStartedEventData.DeserializeWebSlotSwapStartedEventData }, |
| 2 | 112 | | { EventTypes.WebSlotSwapCompleted, WebSlotSwapCompletedEventData.DeserializeWebSlotSwapCompletedEventData }, |
| 2 | 113 | | { EventTypes.WebSlotSwapFailed, WebSlotSwapFailedEventData.DeserializeWebSlotSwapFailedEventData }, |
| 2 | 114 | | { EventTypes.WebSlotSwapWithPreviewStarted, WebSlotSwapWithPreviewStartedEventData.DeserializeWebSlotSwapWit |
| 2 | 115 | | { EventTypes.WebSlotSwapWithPreviewCancelled, WebSlotSwapWithPreviewCancelledEventData.DeserializeWebSlotSwa |
| 2 | 116 | | { EventTypes.WebAppServicePlanUpdated, WebAppServicePlanUpdatedEventData.DeserializeWebAppServicePlanUpdated |
| 2 | 117 | | }; |
| | 118 | | } |
| | 119 | | } |