| | 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.ResourceManager.Network.Models |
| | 13 | | { |
| | 14 | | public partial class TroubleshootingDetails |
| | 15 | | { |
| | 16 | | internal static TroubleshootingDetails DeserializeTroubleshootingDetails(JsonElement element) |
| | 17 | | { |
| 0 | 18 | | string id = default; |
| 0 | 19 | | string reasonType = default; |
| 0 | 20 | | string summary = default; |
| 0 | 21 | | string detail = default; |
| 0 | 22 | | IReadOnlyList<TroubleshootingRecommendedActions> recommendedActions = default; |
| 0 | 23 | | foreach (var property in element.EnumerateObject()) |
| | 24 | | { |
| 0 | 25 | | if (property.NameEquals("id")) |
| | 26 | | { |
| 0 | 27 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 28 | | { |
| | 29 | | continue; |
| | 30 | | } |
| 0 | 31 | | id = property.Value.GetString(); |
| 0 | 32 | | continue; |
| | 33 | | } |
| 0 | 34 | | if (property.NameEquals("reasonType")) |
| | 35 | | { |
| 0 | 36 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 37 | | { |
| | 38 | | continue; |
| | 39 | | } |
| 0 | 40 | | reasonType = property.Value.GetString(); |
| 0 | 41 | | continue; |
| | 42 | | } |
| 0 | 43 | | if (property.NameEquals("summary")) |
| | 44 | | { |
| 0 | 45 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 46 | | { |
| | 47 | | continue; |
| | 48 | | } |
| 0 | 49 | | summary = property.Value.GetString(); |
| 0 | 50 | | continue; |
| | 51 | | } |
| 0 | 52 | | if (property.NameEquals("detail")) |
| | 53 | | { |
| 0 | 54 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 55 | | { |
| | 56 | | continue; |
| | 57 | | } |
| 0 | 58 | | detail = property.Value.GetString(); |
| 0 | 59 | | continue; |
| | 60 | | } |
| 0 | 61 | | if (property.NameEquals("recommendedActions")) |
| | 62 | | { |
| 0 | 63 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 64 | | { |
| | 65 | | continue; |
| | 66 | | } |
| 0 | 67 | | List<TroubleshootingRecommendedActions> array = new List<TroubleshootingRecommendedActions>(); |
| 0 | 68 | | foreach (var item in property.Value.EnumerateArray()) |
| | 69 | | { |
| 0 | 70 | | if (item.ValueKind == JsonValueKind.Null) |
| | 71 | | { |
| 0 | 72 | | array.Add(null); |
| | 73 | | } |
| | 74 | | else |
| | 75 | | { |
| 0 | 76 | | array.Add(TroubleshootingRecommendedActions.DeserializeTroubleshootingRecommendedActions(ite |
| | 77 | | } |
| | 78 | | } |
| 0 | 79 | | recommendedActions = array; |
| | 80 | | continue; |
| | 81 | | } |
| | 82 | | } |
| 0 | 83 | | return new TroubleshootingDetails(id, reasonType, summary, detail, recommendedActions); |
| | 84 | | } |
| | 85 | | } |
| | 86 | | } |