|   |  | 1 |  | // Copyright (c) Microsoft Corporation. All rights reserved. | 
|   |  | 2 |  | // Licensed under the MIT License. | 
|   |  | 3 |  |  | 
|   |  | 4 |  | // <auto-generated/> | 
|   |  | 5 |  |  | 
|   |  | 6 |  | #nullable disable | 
|   |  | 7 |  |  | 
|   |  | 8 |  | using System.Collections.Generic; | 
|   |  | 9 |  | using System.Text.Json; | 
|   |  | 10 |  | using Azure.Core; | 
|   |  | 11 |  |  | 
|   |  | 12 |  | namespace Azure.Messaging.EventGrid.SystemEvents | 
|   |  | 13 |  | { | 
|   |  | 14 |  |     public partial class MediaJobErroredEventData | 
|   |  | 15 |  |     { | 
|   |  | 16 |  |         internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(JsonElement element) | 
|   |  | 17 |  |         { | 
|   | 2 | 18 |  |             Optional<IReadOnlyList<MediaJobOutput>> outputs = default; | 
|   | 2 | 19 |  |             Optional<MediaJobState> previousState = default; | 
|   | 2 | 20 |  |             Optional<MediaJobState> state = default; | 
|   | 2 | 21 |  |             Optional<IReadOnlyDictionary<string, string>> correlationData = default; | 
|   | 20 | 22 |  |             foreach (var property in element.EnumerateObject()) | 
|   |  | 23 |  |             { | 
|   | 8 | 24 |  |                 if (property.NameEquals("outputs")) | 
|   |  | 25 |  |                 { | 
|   | 2 | 26 |  |                     List<MediaJobOutput> array = new List<MediaJobOutput>(); | 
|   | 8 | 27 |  |                     foreach (var item in property.Value.EnumerateArray()) | 
|   |  | 28 |  |                     { | 
|   | 2 | 29 |  |                         array.Add(MediaJobOutput.DeserializeMediaJobOutput(item)); | 
|   |  | 30 |  |                     } | 
|   | 2 | 31 |  |                     outputs = array; | 
|   | 2 | 32 |  |                     continue; | 
|   |  | 33 |  |                 } | 
|   | 6 | 34 |  |                 if (property.NameEquals("previousState")) | 
|   |  | 35 |  |                 { | 
|   | 2 | 36 |  |                     previousState = property.Value.GetString().ToMediaJobState(); | 
|   | 2 | 37 |  |                     continue; | 
|   |  | 38 |  |                 } | 
|   | 4 | 39 |  |                 if (property.NameEquals("state")) | 
|   |  | 40 |  |                 { | 
|   | 2 | 41 |  |                     state = property.Value.GetString().ToMediaJobState(); | 
|   | 2 | 42 |  |                     continue; | 
|   |  | 43 |  |                 } | 
|   | 2 | 44 |  |                 if (property.NameEquals("correlationData")) | 
|   |  | 45 |  |                 { | 
|   | 2 | 46 |  |                     Dictionary<string, string> dictionary = new Dictionary<string, string>(); | 
|   | 0 | 47 |  |                     foreach (var property0 in property.Value.EnumerateObject()) | 
|   |  | 48 |  |                     { | 
|   | 0 | 49 |  |                         dictionary.Add(property0.Name, property0.Value.GetString()); | 
|   |  | 50 |  |                     } | 
|   | 2 | 51 |  |                     correlationData = dictionary; | 
|   |  | 52 |  |                     continue; | 
|   |  | 53 |  |                 } | 
|   |  | 54 |  |             } | 
|   | 2 | 55 |  |             return new MediaJobErroredEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Optional | 
|   |  | 56 |  |         } | 
|   |  | 57 |  |     } | 
|   |  | 58 |  | } |