| | 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.Text.Json; |
| | 9 | | using Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.Messaging.EventGrid.SystemEvents |
| | 12 | | { |
| | 13 | | public partial class MediaJobOutputAsset |
| | 14 | | { |
| | 15 | | internal static MediaJobOutputAsset DeserializeMediaJobOutputAsset(JsonElement element) |
| | 16 | | { |
| 20 | 17 | | Optional<string> assetName = default; |
| 20 | 18 | | Optional<string> odataType = default; |
| 20 | 19 | | Optional<MediaJobError> error = default; |
| 20 | 20 | | Optional<string> label = default; |
| 20 | 21 | | long progress = default; |
| 20 | 22 | | MediaJobState state = default; |
| 272 | 23 | | foreach (var property in element.EnumerateObject()) |
| | 24 | | { |
| 116 | 25 | | if (property.NameEquals("assetName")) |
| | 26 | | { |
| 20 | 27 | | assetName = property.Value.GetString(); |
| 20 | 28 | | continue; |
| | 29 | | } |
| 96 | 30 | | if (property.NameEquals("@odata.type")) |
| | 31 | | { |
| 20 | 32 | | odataType = property.Value.GetString(); |
| 20 | 33 | | continue; |
| | 34 | | } |
| 76 | 35 | | if (property.NameEquals("error")) |
| | 36 | | { |
| 16 | 37 | | error = MediaJobError.DeserializeMediaJobError(property.Value); |
| 16 | 38 | | continue; |
| | 39 | | } |
| 60 | 40 | | if (property.NameEquals("label")) |
| | 41 | | { |
| 20 | 42 | | label = property.Value.GetString(); |
| 20 | 43 | | continue; |
| | 44 | | } |
| 40 | 45 | | if (property.NameEquals("progress")) |
| | 46 | | { |
| 20 | 47 | | progress = property.Value.GetInt64(); |
| 20 | 48 | | continue; |
| | 49 | | } |
| 20 | 50 | | if (property.NameEquals("state")) |
| | 51 | | { |
| 20 | 52 | | state = property.Value.GetString().ToMediaJobState(); |
| | 53 | | continue; |
| | 54 | | } |
| | 55 | | } |
| 20 | 56 | | return new MediaJobOutputAsset(odataType.Value, error.Value, label.Value, progress, state, assetName.Value); |
| | 57 | | } |
| | 58 | | } |
| | 59 | | } |