| | 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 BgpPeerStatusListResult |
| | 15 | | { |
| | 16 | | internal static BgpPeerStatusListResult DeserializeBgpPeerStatusListResult(JsonElement element) |
| | 17 | | { |
| 0 | 18 | | IReadOnlyList<BgpPeerStatus> value = default; |
| 0 | 19 | | foreach (var property in element.EnumerateObject()) |
| | 20 | | { |
| 0 | 21 | | if (property.NameEquals("value")) |
| | 22 | | { |
| 0 | 23 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 24 | | { |
| | 25 | | continue; |
| | 26 | | } |
| 0 | 27 | | List<BgpPeerStatus> array = new List<BgpPeerStatus>(); |
| 0 | 28 | | foreach (var item in property.Value.EnumerateArray()) |
| | 29 | | { |
| 0 | 30 | | if (item.ValueKind == JsonValueKind.Null) |
| | 31 | | { |
| 0 | 32 | | array.Add(null); |
| | 33 | | } |
| | 34 | | else |
| | 35 | | { |
| 0 | 36 | | array.Add(BgpPeerStatus.DeserializeBgpPeerStatus(item)); |
| | 37 | | } |
| | 38 | | } |
| 0 | 39 | | value = array; |
| | 40 | | continue; |
| | 41 | | } |
| | 42 | | } |
| 0 | 43 | | return new BgpPeerStatusListResult(value); |
| | 44 | | } |
| | 45 | | } |
| | 46 | | } |