|  |  | 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 MediaJobOutputFinishedEventData | 
|  |  | 15 |  |     { | 
|  |  | 16 |  |         internal static MediaJobOutputFinishedEventData DeserializeMediaJobOutputFinishedEventData(JsonElement element) | 
|  |  | 17 |  |         { | 
|  | 2 | 18 |  |             Optional<MediaJobState> previousState = default; | 
|  | 2 | 19 |  |             Optional<MediaJobOutput> output = default; | 
|  | 2 | 20 |  |             Optional<IReadOnlyDictionary<string, string>> jobCorrelationData = default; | 
|  | 16 | 21 |  |             foreach (var property in element.EnumerateObject()) | 
|  |  | 22 |  |             { | 
|  | 6 | 23 |  |                 if (property.NameEquals("previousState")) | 
|  |  | 24 |  |                 { | 
|  | 2 | 25 |  |                     previousState = property.Value.GetString().ToMediaJobState(); | 
|  | 2 | 26 |  |                     continue; | 
|  |  | 27 |  |                 } | 
|  | 4 | 28 |  |                 if (property.NameEquals("output")) | 
|  |  | 29 |  |                 { | 
|  | 2 | 30 |  |                     output = MediaJobOutput.DeserializeMediaJobOutput(property.Value); | 
|  | 2 | 31 |  |                     continue; | 
|  |  | 32 |  |                 } | 
|  | 2 | 33 |  |                 if (property.NameEquals("jobCorrelationData")) | 
|  |  | 34 |  |                 { | 
|  | 2 | 35 |  |                     Dictionary<string, string> dictionary = new Dictionary<string, string>(); | 
|  | 0 | 36 |  |                     foreach (var property0 in property.Value.EnumerateObject()) | 
|  |  | 37 |  |                     { | 
|  | 0 | 38 |  |                         dictionary.Add(property0.Name, property0.Value.GetString()); | 
|  |  | 39 |  |                     } | 
|  | 2 | 40 |  |                     jobCorrelationData = dictionary; | 
|  |  | 41 |  |                     continue; | 
|  |  | 42 |  |                 } | 
|  |  | 43 |  |             } | 
|  | 2 | 44 |  |             return new MediaJobOutputFinishedEventData(Optional.ToNullable(previousState), output.Value, Optional.ToDict | 
|  |  | 45 |  |         } | 
|  |  | 46 |  |     } | 
|  |  | 47 |  | } |