| | 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.Compute.Models |
| | 13 | | { |
| | 14 | | public partial class ContainerServiceListResult |
| | 15 | | { |
| | 16 | | internal static ContainerServiceListResult DeserializeContainerServiceListResult(JsonElement element) |
| | 17 | | { |
| 0 | 18 | | IReadOnlyList<ContainerService> value = default; |
| 0 | 19 | | string nextLink = default; |
| 0 | 20 | | foreach (var property in element.EnumerateObject()) |
| | 21 | | { |
| 0 | 22 | | if (property.NameEquals("value")) |
| | 23 | | { |
| 0 | 24 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 25 | | { |
| | 26 | | continue; |
| | 27 | | } |
| 0 | 28 | | List<ContainerService> array = new List<ContainerService>(); |
| 0 | 29 | | foreach (var item in property.Value.EnumerateArray()) |
| | 30 | | { |
| 0 | 31 | | if (item.ValueKind == JsonValueKind.Null) |
| | 32 | | { |
| 0 | 33 | | array.Add(null); |
| | 34 | | } |
| | 35 | | else |
| | 36 | | { |
| 0 | 37 | | array.Add(ContainerService.DeserializeContainerService(item)); |
| | 38 | | } |
| | 39 | | } |
| 0 | 40 | | value = array; |
| 0 | 41 | | continue; |
| | 42 | | } |
| 0 | 43 | | if (property.NameEquals("nextLink")) |
| | 44 | | { |
| 0 | 45 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 46 | | { |
| | 47 | | continue; |
| | 48 | | } |
| 0 | 49 | | nextLink = property.Value.GetString(); |
| | 50 | | continue; |
| | 51 | | } |
| | 52 | | } |
| 0 | 53 | | return new ContainerServiceListResult(value, nextLink); |
| | 54 | | } |
| | 55 | | } |
| | 56 | | } |